-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Closed
Copy link
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-bugCategory: This is a bug.Category: This is a bug.
Description
Macro:
#[proc_macro]
pub fn same(input: TokenStream) -> TokenStream {
input
}Usage of the macro:
same! {
fn 32() {}
}Error:
error: expected identifier, found `32`
--> wrapper/src/lib.rs:24:1
|
24 | / same! {
25 | | fn 32() {}
26 | | }
| |_^I expect a more specific error. For example the usage
same! {
fn f(a: 32) {}
}triggers the error:
error: expected type, found `32`
--> wrapper/src/lib.rs:25:13
|
25 | fn f(a: 32) {}
| ^^ expected type- only 32 is pointed!
Meta
I've tried the above using the latest stable (rustc 1.49.0 (e1884a8e3 2020-12-29)) and nightly (rustc 1.51.0-nightly (b12290861 2021-01-29)) versions of the compiler.
Metadata
Metadata
Assignees
Labels
A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-bugCategory: This is a bug.Category: This is a bug.