2017-02-06 05:44:38 -06:00
|
|
|
// aux-build:derive-foo.rs
|
|
|
|
// aux-build:derive-clona.rs
|
|
|
|
// aux-build:attr_proc_macro.rs
|
2017-02-27 14:03:19 -06:00
|
|
|
// aux-build:bang_proc_macro.rs
|
2017-02-06 05:44:38 -06:00
|
|
|
|
2018-08-03 21:17:51 -05:00
|
|
|
#![feature(custom_attribute)]
|
2017-02-06 05:44:38 -06:00
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate derive_foo;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate derive_clona;
|
|
|
|
extern crate attr_proc_macro;
|
2017-02-27 14:03:19 -06:00
|
|
|
extern crate bang_proc_macro;
|
2017-02-06 05:44:38 -06:00
|
|
|
|
|
|
|
use attr_proc_macro::attr_proc_macro;
|
2017-02-27 14:03:19 -06:00
|
|
|
use bang_proc_macro::bang_proc_macro;
|
2017-02-06 05:44:38 -06:00
|
|
|
|
2017-02-23 03:48:20 -06:00
|
|
|
macro_rules! FooWithLongNam {
|
|
|
|
() => {}
|
|
|
|
}
|
|
|
|
|
2017-02-27 14:03:19 -06:00
|
|
|
macro_rules! attr_proc_mac {
|
|
|
|
() => {}
|
|
|
|
}
|
|
|
|
|
2017-02-23 03:48:20 -06:00
|
|
|
#[derive(FooWithLongNan)]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find
|
2017-02-06 05:44:38 -06:00
|
|
|
struct Foo;
|
|
|
|
|
2018-08-03 21:17:51 -05:00
|
|
|
#[attr_proc_macra] // OK, interpreted as a custom attribute
|
2017-02-06 05:44:38 -06:00
|
|
|
struct Bar;
|
|
|
|
|
2018-08-03 21:17:51 -05:00
|
|
|
#[FooWithLongNan] // OK, interpreted as a custom attribute
|
2017-02-23 03:48:20 -06:00
|
|
|
struct Asdf;
|
|
|
|
|
2017-02-06 05:44:38 -06:00
|
|
|
#[derive(Dlone)]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find
|
2017-02-06 05:44:38 -06:00
|
|
|
struct A;
|
|
|
|
|
|
|
|
#[derive(Dlona)]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find
|
2017-02-06 05:44:38 -06:00
|
|
|
struct B;
|
|
|
|
|
2017-02-23 03:48:20 -06:00
|
|
|
#[derive(attr_proc_macra)]
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find
|
2017-02-23 03:48:20 -06:00
|
|
|
struct C;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
FooWithLongNama!();
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find
|
2017-02-23 03:48:20 -06:00
|
|
|
|
|
|
|
attr_proc_macra!();
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find
|
2017-02-23 03:48:20 -06:00
|
|
|
|
|
|
|
Dlona!();
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find
|
2017-02-27 14:03:19 -06:00
|
|
|
|
|
|
|
bang_proc_macrp!();
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find
|
2017-02-23 03:48:20 -06:00
|
|
|
}
|