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