2017-02-06 05:44:38 -06:00
|
|
|
// aux-build:derive-foo.rs
|
|
|
|
// aux-build:derive-clona.rs
|
2019-05-21 17:09:58 -05:00
|
|
|
// aux-build:test-macros.rs
|
2017-02-06 05:44:38 -06:00
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate derive_foo;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate derive_clona;
|
2019-05-21 17:09:58 -05:00
|
|
|
extern crate test_macros;
|
2017-02-06 05:44:38 -06:00
|
|
|
|
2019-05-21 17:09:58 -05:00
|
|
|
use test_macros::empty as bang_proc_macro;
|
|
|
|
use test_macros::empty_attr as attr_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;
|
|
|
|
|
2019-09-07 20:34:24 -05:00
|
|
|
// Interpreted as an unstable custom attribute
|
2019-09-15 04:55:18 -05:00
|
|
|
#[attr_proc_macra] //~ ERROR cannot find attribute `attr_proc_macra` in this scope
|
2017-02-06 05:44:38 -06:00
|
|
|
struct Bar;
|
|
|
|
|
2019-09-07 20:34:24 -05:00
|
|
|
// Interpreted as an unstable custom attribute
|
2019-09-15 04:55:18 -05:00
|
|
|
#[FooWithLongNan] //~ ERROR cannot find attribute `FooWithLongNan` in this scope
|
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
|
|
|
}
|