File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,8 @@ use proc_macro::TokenStream;
11
11
pub fn derive_a ( _input : TokenStream ) -> TokenStream {
12
12
"struct A { inner }" . parse ( ) . unwrap ( )
13
13
}
14
+
15
+ #[ proc_macro_derive( B ) ]
16
+ pub fn derive_b ( _input : TokenStream ) -> TokenStream {
17
+ "const _: () = (); { HEY! }" . parse ( ) . unwrap ( )
18
+ }
Original file line number Diff line number Diff line change @@ -8,4 +8,8 @@ extern crate derive_bad;
8
8
//~| ERROR expected `:`, found `}`
9
9
struct A ; //~ ERROR the name `A` is defined multiple times
10
10
11
+ #[ derive( B ) ]
12
+ //~^ ERROR proc-macro derive produced unparseable tokens
13
+ struct B ;
14
+
11
15
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ LL | struct A;
23
23
|
24
24
= note: `A` must be defined only once in the type namespace of this module
25
25
26
- error: aborting due to 3 previous errors
26
+ error: proc-macro derive produced unparseable tokens
27
+ --> $DIR/derive-bad.rs:11:10
28
+ |
29
+ LL | #[derive(B)]
30
+ | ^
31
+
32
+ error: aborting due to 4 previous errors
27
33
28
34
For more information about this error, try `rustc --explain E0428`.
You can’t perform that action at this time.
0 commit comments