2017-02-06 22:14:38 +10:30
|
|
|
// aux-build:derive-foo.rs
|
|
|
|
// aux-build:derive-clona.rs
|
2019-05-22 01:09:58 +03:00
|
|
|
// aux-build:test-macros.rs
|
2017-02-06 22:14:38 +10:30
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate derive_foo;
|
|
|
|
#[macro_use]
|
|
|
|
extern crate derive_clona;
|
2019-05-22 01:09:58 +03:00
|
|
|
extern crate test_macros;
|
2017-02-06 22:14:38 +10:30
|
|
|
|
2019-05-22 01:09:58 +03:00
|
|
|
use test_macros::empty as bang_proc_macro;
|
|
|
|
use test_macros::empty_attr as attr_proc_macro;
|
2017-02-06 22:14:38 +10:30
|
|
|
|
2017-02-23 20:18:20 +10:30
|
|
|
macro_rules! FooWithLongNam {
|
|
|
|
() => {}
|
|
|
|
}
|
|
|
|
|
2017-02-27 12:03:19 -08:00
|
|
|
macro_rules! attr_proc_mac {
|
|
|
|
() => {}
|
|
|
|
}
|
|
|
|
|
2017-02-23 20:18:20 +10:30
|
|
|
#[derive(FooWithLongNan)]
|
2017-11-20 13:13:27 +01:00
|
|
|
//~^ ERROR cannot find
|
2017-02-06 22:14:38 +10:30
|
|
|
struct Foo;
|
|
|
|
|
2019-06-08 17:35:54 +03:00
|
|
|
// Interpreted as a feature gated custom attribute
|
2019-07-12 01:00:20 +03:00
|
|
|
#[attr_proc_macra] //~ ERROR cannot find attribute macro `attr_proc_macra` in this scope
|
2017-02-06 22:14:38 +10:30
|
|
|
struct Bar;
|
|
|
|
|
2019-06-08 17:35:54 +03:00
|
|
|
// Interpreted as a feature gated custom attribute
|
2019-07-12 01:00:20 +03:00
|
|
|
#[FooWithLongNan] //~ ERROR cannot find attribute macro `FooWithLongNan` in this scope
|
2017-02-23 20:18:20 +10:30
|
|
|
struct Asdf;
|
|
|
|
|
2017-02-06 22:14:38 +10:30
|
|
|
#[derive(Dlone)]
|
2017-11-20 13:13:27 +01:00
|
|
|
//~^ ERROR cannot find
|
2017-02-06 22:14:38 +10:30
|
|
|
struct A;
|
|
|
|
|
|
|
|
#[derive(Dlona)]
|
2017-11-20 13:13:27 +01:00
|
|
|
//~^ ERROR cannot find
|
2017-02-06 22:14:38 +10:30
|
|
|
struct B;
|
|
|
|
|
2017-02-23 20:18:20 +10:30
|
|
|
#[derive(attr_proc_macra)]
|
2017-11-20 13:13:27 +01:00
|
|
|
//~^ ERROR cannot find
|
2017-02-23 20:18:20 +10:30
|
|
|
struct C;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
FooWithLongNama!();
|
2017-11-20 13:13:27 +01:00
|
|
|
//~^ ERROR cannot find
|
2017-02-23 20:18:20 +10:30
|
|
|
|
|
|
|
attr_proc_macra!();
|
2017-11-20 13:13:27 +01:00
|
|
|
//~^ ERROR cannot find
|
2017-02-23 20:18:20 +10:30
|
|
|
|
|
|
|
Dlona!();
|
2017-11-20 13:13:27 +01:00
|
|
|
//~^ ERROR cannot find
|
2017-02-27 12:03:19 -08:00
|
|
|
|
|
|
|
bang_proc_macrp!();
|
2017-11-20 13:13:27 +01:00
|
|
|
//~^ ERROR cannot find
|
2017-02-23 20:18:20 +10:30
|
|
|
}
|