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
|
2020-01-08 20:02:10 +03:00
|
|
|
//~| ERROR cannot find
|
2017-02-06 22:14:38 +10:30
|
|
|
struct Foo;
|
|
|
|
|
2019-09-08 09:34:24 +08:00
|
|
|
// Interpreted as an unstable custom attribute
|
2019-09-15 12:55:18 +03:00
|
|
|
#[attr_proc_macra] //~ ERROR cannot find attribute `attr_proc_macra` in this scope
|
2017-02-06 22:14:38 +10:30
|
|
|
struct Bar;
|
|
|
|
|
2019-09-08 09:34:24 +08:00
|
|
|
// Interpreted as an unstable custom attribute
|
2019-09-15 12:55:18 +03:00
|
|
|
#[FooWithLongNan] //~ ERROR cannot find attribute `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
|
2020-01-08 20:02:10 +03: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
|
2020-01-08 20:02:10 +03: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
|
2020-01-08 20:02:10 +03: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
|
|
|
}
|