-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Error on Reserved Syntax for Raw Keywords: k#foo
#84037
Error on Reserved Syntax for Raw Keywords: k#foo
#84037
Conversation
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
@bors try |
⌛ Trying commit 692220c974656fac8908e4edc45b731a22fcb220 with merge 183585b6408d129d017caa116edd19c6d5f7f716... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
I fixed the build errors in rustdoc, but the try build already ran into breakage in the ecosystem. tracing-attributes contains:
Instances like this one should be somewhat common with the What's the best way forward here? Should I just leave the error for raw keywords |
Yeah, let's prioritize getting a crater run that just checks if we can use |
k#foo
, bar"baz"
, cha'r'
k#foo
Ok, I removed the other errors and updated the PR description. |
@bors try |
⌛ Trying commit 2bbdfdfac232fea427fdb311560411c39e0d6c39 with merge 2bf0c8e648350595527d984daafa09b33c338d13... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Looks like one test failed due to the change in lexer structures. Can you fix that up, please? |
Done. |
@bors try |
⌛ Trying commit 85844b1980f1137c308f83cae30bb5b174391c48 with merge b0d0ea232bdae12fa8da8491a91ae1db029990ef... |
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
I reviewed the crater results, and it looks like zero failures as a result of the |
I'll update this PR to more accurately implement the @rustbot label: -S-waiting-on-review +S-waiting-on-author |
85844b1
to
56ae0f1
Compare
56ae0f1
to
b517682
Compare
k#foo
k#foo
k#foo
k#foo
@petrochenkov this is ready for review now, and I guess also for lang team discussion. I also updated the PR description. @scottmcm can you verify that this is what you had in mind in the RFC? @rustbot label: +S-waiting-on-review -S-waiting-on-author |
@Julian-Wollersberger |
Blocked on #85359 according to #85359 (comment) |
☔ The latest upstream changes (presumably #85359) made this pull request unmergeable. Please resolve the merge conflicts. |
This is still blocked on the RFC 3098, but work on that seems to have stalled. |
This PR makes the raw keyword syntax from rust-lang/rfcs#3098 a hard error on all editions. (In contrast to what the RFC currently says.)
More specifically, it becomes a tokenization error, so macros cannot use it.
k#ident
is now lexed as one token, similar tor#ident
, although this could be changed later without breaking anything.Note that this is a breaking change, since macros previously interpreted it as three tokens, so something like
quote!{ #k#other_variable }
was valid. The crater run showed no real regressions though. You can easily get the old behavior by inserting a whitespace betweenk
and#
.The actual raw keywords feature for things like
k#async
is not implemented here.Previously, this PR was inteded to do a crater run for all reserved prefixes from rust-lang/rfcs#3101, but even the try build ran into breakage in the ecosystem, so only
k#...
was tested.