File tree 3 files changed +44
-0
lines changed
3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ // force-host
2
+ // no-prefer-dynamic
3
+
4
+ #![ crate_type = "proc-macro" ]
5
+
6
+ extern crate proc_macro;
7
+
8
+ use proc_macro:: TokenStream ;
9
+
10
+ #[ proc_macro_attribute]
11
+ pub fn foo ( _args : TokenStream , item : TokenStream ) -> TokenStream {
12
+ item
13
+ }
Original file line number Diff line number Diff line change
1
+ // aux-build: issue-75801.rs
2
+
3
+ // Regression test for #75801.
4
+
5
+ #[ macro_use]
6
+ extern crate issue_75801;
7
+
8
+ macro_rules! foo {
9
+ ( $arg: expr) => {
10
+ #[ foo]
11
+ fn bar( ) {
12
+ let _bar: u32 = $arg;
13
+ }
14
+ } ;
15
+ }
16
+
17
+ foo ! ( "baz" ) ; //~ ERROR: mismatched types [E0308]
18
+
19
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0308]: mismatched types
2
+ --> $DIR/issue-75801.rs:17:6
3
+ |
4
+ LL | let _bar: u32 = $arg;
5
+ | --- expected due to this
6
+ ...
7
+ LL | foo!("baz");
8
+ | ^^^^^ expected `u32`, found `&str`
9
+
10
+ error: aborting due to previous error
11
+
12
+ For more information about this error, try `rustc --explain E0308`.
You can’t perform that action at this time.
0 commit comments