You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
proc-macro param attrs dropping first attrs in impl fns #64682
As you can see, hello and hello2 are missing their attrs on the a param. The addition of self however gives both self and the a param their attrs. Weird.
error: unused variable: `p1`
--> src/lib.rs:8:39
|
8 | fn _f1(#[allow(unused_variables)] p1: u8){}
| ^^ help: consider prefixing with an underscore: `_p1`
|
note: lint level defined here
--> src/lib.rs:1:9
|
1 | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^
However: the problem is not in the parser:
pubstructS;implS{fn_f1(#[allow(lint)]p1:u8){}}
results in:
error[E0658]: attributes on function parameters are unstable
--> src/lib.rs:4:12
|
4 | fn _f1(#[allow(lint)] p1: u8){}
| ^^^^^^^^^^^^^^
|
= note:for more information, see https://github.com/rust-lang/rust/issues/60406
on stable.
But the problem does appear at least in AST validation:
pubstructS;implS{fn_f2(/// abc <-- compiles but it should be rejected!_p1:u8){}}
Actually, it turns out the problem is in the parser, and we have a bug that allows:
Activity
bbqsrc commentedon Sep 22, 2019
Ping @Centril
bbqsrc commentedon Sep 22, 2019
Also pinging @c410-f3r due to impact on #64010.
c410-f3r commentedon Sep 25, 2019
I'm rather busy this week and I can only take a look into it in this weekend
pnkfelix commentedon Sep 26, 2019
triage: P-high. Leaving nominated in hopes to find someone to look into it, since @c410-f3r won't have time for next few days.
pnkfelix commentedon Sep 26, 2019
assigning to @Centril
Centril commentedon Sep 29, 2019
Investigation thus far: I don't think the problem is in pretty printing but somewhere else.
results in:
However: the problem is not in the parser:results in:
on stable.
But the problem does appear at least in AST validation:
Actually, it turns out the problem is in the parser, and we have a bug that allows:
syntax: fix rust-lang#64682.
syntax: fix rust-lang#64682.