-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attributes at the beginning of a file have confusing semantics #2568
Comments
This is sort of related to #2498 - I want to add javadoc comments (to the parser probably as a special type of attribute), but attributes can either be 'outer' or 'inner' types so that needs to be indicated by the javadocs as well. Adding significant semicolons after comments is bizarre so I was going to use doxygen's |
+1 for getting rid of the significant semicolon on attributes. Those may very well be the most frightening thing in the language. |
Added #2569 for changing the inner attribute syntax |
I didn't even know you could put a semicolon after an attribute, so there you go. |
Merge rustc changes back into the miri repo This uses https://github.com/josh-project/josh (RIIR ftw) The first time it looks a bit odd with the merges and so, all future syncs will work just like the instructions say. I'll add instructions for the sync from miri to rustc, too, starting to do that right now. Initial cache building now takes 5 mins 🥳
I was trying to add a
#warn
attribute to a test case in order to turn a warning into an error, and I spent an embarrassingly large amount of time trying to debug why the warning still seemed to be treated as a warning. The reason was that I put:#[warn(err_non_implicitly_copyable_typarams)]
at the very beginning of the file, which of course meant it applied to only the first item in the file -- which wasn't the one containing the code that triggers the warning. I'd forgotten that attributes only apply to the next item, not the whole file (or module). But I'm sure I'm not the only one who will get confused by this.
I'm not sure what a good solution would be, but I thought I would report it as a potential source of confusion. Maybe when the compiler prints a lint warning or error, it could also print something like "Printing a warning because this is the default setting for item
fn quux(...
", or "Printing an error because the itemclass foo {...
has a#[warn(err_no_cats_allowed)]
attribute"?The text was updated successfully, but these errors were encountered: