-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Change #[lang="foo"]-style items to #[lang("foo")] #11886
Comments
Is this just to simplify the syntax for attributes? Personally, I like seeing |
It also lets us remove the brackets. |
I like the brackets! Removing the brackets means giving up the potential future use of Also, regarding the one literal restriction, doesn't that cause problems for |
@kballard the word "literal" in "one literal restriction" is referring solely to string literals. All existing attribute syntax that doesn't use |
Sorry, misclick. |
I'd rather use |
@kballard The problem with brackets is that we also want to add the bang to inner attributes, which means the syntax for inner attributes is |
@brson Why not drop the semicolon in that case? And I agree that |
Maybe we should have a discussion on the mailing list about the complete plan for attributes before going through with this. Personally, I also like the brackets. |
If we just leave attribute syntax alone it will prevent a lot of work, at the expensive of people forever wtfing over the semicolon distinction. |
Ever since the idea came up I've been writing attributes as |
Accepted for 1.0, P-backcompat-lang. |
I think I've made my peace with |
Is there a consensus for this issue? Should it be I've created a quick proof of concept patch that uses |
@fhahn Yes, let's do it. It does require changes to the parser. |
Okay, so the parser should be extended to accept strings in items, like I'll be away for a week or so, so I'll probably won't get much work done next week. |
@fhahn yes. |
Nominating for closure. I think with #12538 we don't need to change this |
closing; there are some proponents for doing this but the presented arguments are not really strong enough to continue discussing it. (e.g. some arguments involve coupling in other changes to the attribute syntax, such as switching to |
Are there any compelling arguments for having the brackets other than historical inertia? |
…1995 Fix `FormatArgs` storage when `-Zthreads` > 1 Fixes rust-lang#11886 The initial way I thought of was a little gross so I never opened a PR for it, I thought of a nicer way today that no longer involves any `thread_local`s or `static`s `rustc_data_strucutres::sync::{Lrc, OnceLock}` implement `DynSend` + `DynSync` so we can pass them to the lint passes that need the storage changelog: none r? `@flip1995`
…1995 Fix `FormatArgs` storage when `-Zthreads` > 1 Fixes rust-lang#11886 The initial way I thought of was a little gross so I never opened a PR for it, I thought of a nicer way today that no longer involves any `thread_local`s or `static`s `rustc_data_strucutres::sync::{Lrc, OnceLock}` implement `DynSend` + `DynSync` so we can pass them to the lint passes that need the storage changelog: none r? `@flip1995`
…1995 Fix `FormatArgs` storage when `-Zthreads` > 1 Fixes rust-lang#11886 The initial way I thought of was a little gross so I never opened a PR for it, I thought of a nicer way today that no longer involves any `thread_local`s or `static`s `rustc_data_strucutres::sync::{Lrc, OnceLock}` implement `DynSend` + `DynSync` so we can pass them to the lint passes that need the storage changelog: none r? `@flip1995`
Only one ("string") literal allowed.
The text was updated successfully, but these errors were encountered: