-
Notifications
You must be signed in to change notification settings - Fork 493
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
Document that <- is a single token #1424
Conversation
Thanks, yea, I noted this in #583. Since there was an attempt to remove this that was then later backed out, I'm assuming the language team agrees that the emplacement operator has to stay permanently. However, I'm not 100% sure based on rust-lang/rust#50832 (comment). Since I'm not completely confident that the language team doesn't want to try to remove this in the future, I'm going to nominate this for their attention for approval. I think this PR probably should be merged. I wouldn't be surprised if there were more macros using it since the last time it was attempted to be removed. |
It looks like the main question in rust-lang/rust#50832 is whether to remove this feature from the parser. Perhaps the question of whether it will be removed from the lexer is easier. In particular, if the answer to that one is "perhaps, but if so it would happen in a future edition", then I think there'd be no reason to delay documenting the current behaviour any further. |
@rfcbot merge I agree that we should reflect what's actually happening in the reference. (And I think that it's not worth trying to change the lexing rules for this at this point.) |
Team member @scottmcm has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
It isn't clear to me why the token removal was backed out; the crater run above rust-lang/rust#60803 (comment) didn't find any actual regressions and the comment didn't leave a rationale. It seems like it would have been possible to remove the token then, but now it might be harder. It seems worth running crater again to check, if only to make @rfcbot concern can we still remove the token Otherwise, I'm not opposed to documenting the current behavior. @rfcbot reviewed |
It sounds like from rust-lang/rust#60803 that Centril and petrochenkov wanted to keep the Perhaps it could be removed, and then added again later in an edition (though I don't know how feasible that is)? |
Hmm, it looks like macro_rules! foo {
($x:tt) => {};
}
fn main() {
foo!(->);
foo!(=>);
foo!(<-);
foo!(<=);
} So I think I'm now being pushed further to "let's just leave it as is", so tt-muncher macros can all keep using these as arrows if they want, since there's very little cost to keeping it. |
Discussed in t-lang and we agreed to unblock documenting this for now. @compiler-errors also wants to do a crater run so we can consider removing it, but that doesn't need to block this PR. @rfcbot resolve can we still remove the token |
The crater run: rust-lang/rust#118920 (comment) |
@rustbot labels -I-lang-nominated As mentioned above, we discussed this today and the consensus was that we should separate the question of documenting the current behavior from maybe changing that behavior. This can proceed as soon as enough people review and approve. Once the crater run is analyzed, if someone wants to make a case for changing this behavior, please discuss the pros/cons and nominate for T-lang over in rust-lang/rust#118920 or in a new issue. |
The crater analysis was done in rust-lang/rust#118920, and @compiler-errors decided that there was enough breakage to not make it worth it. I'm going to consider the comment in #1424 (comment) to imply that the team as a whole has agreed to this even though the rfcbot checkboxes weren't checked. I don't know who was in attendance, but I assume it was more than just two. |
Update books ## rust-lang/nomicon 1 commits in f6bd083c4ccfc4ce6699b8b4154e3c45c5a27a8c..6bc2415218d4dd0cb01433d8320f5ccf79c343a1 2024-01-03 04:01:04 UTC to 2024-01-03 04:01:04 UTC - Update an example of `thread_local` to use `local_key_cell_methods` (rust-lang/nomicon#438) ## rust-lang/reference 1 commits in 3565c7978cfc9662f5963b135690ff9cbbfa0318..8c77e8be9da1a9c70545556218d563c8d061f1fd 2024-01-08 15:16:51 UTC to 2024-01-08 15:16:51 UTC - Document that <- is a single token (rust-lang/reference#1424) ## rust-lang/rust-by-example 4 commits in c0be6299e52e4164c30ba6f41bd0ad0aaee64972..ddf5cb0e6ee54ba2dd84c8ca3e1314120014e20d 2024-01-13 11:06:22 UTC to 2024-01-13 11:01:00 UTC - Update attribute.md, (rust-lang/rust-by-example#1791) - fix: typo `unusude` (rust-lang/rust-by-example#1797) - Update print.md (rust-lang/rust-by-example#1796) - Update alias.md (rust-lang/rust-by-example#1790) ## rust-lang/rustc-dev-guide 4 commits in d13e85152a977cd0bcaf583cf5f49e86225697de..4af29d1a7f64f88a36539662c6a84fe1fbe6cde1 2024-01-14 10:42:53 UTC to 2024-01-06 17:47:01 UTC - Expand upon PR guidelines (rust-lang/rustc-dev-guide#1851) - Correct the link to rust reference (rust-lang/rustc-dev-guide#1848) - Explain the important concepts of exhaustiveness checking (rust-lang/rustc-dev-guide#1830) - Add guide for rustdoc search implementation (rust-lang/rustc-dev-guide#1846)
Rollup merge of rust-lang#119998 - rustbot:docs-update, r=ehuss Update books ## rust-lang/nomicon 1 commits in f6bd083c4ccfc4ce6699b8b4154e3c45c5a27a8c..6bc2415218d4dd0cb01433d8320f5ccf79c343a1 2024-01-03 04:01:04 UTC to 2024-01-03 04:01:04 UTC - Update an example of `thread_local` to use `local_key_cell_methods` (rust-lang/nomicon#438) ## rust-lang/reference 1 commits in 3565c7978cfc9662f5963b135690ff9cbbfa0318..8c77e8be9da1a9c70545556218d563c8d061f1fd 2024-01-08 15:16:51 UTC to 2024-01-08 15:16:51 UTC - Document that <- is a single token (rust-lang/reference#1424) ## rust-lang/rust-by-example 4 commits in c0be6299e52e4164c30ba6f41bd0ad0aaee64972..ddf5cb0e6ee54ba2dd84c8ca3e1314120014e20d 2024-01-13 11:06:22 UTC to 2024-01-13 11:01:00 UTC - Update attribute.md, (rust-lang/rust-by-example#1791) - fix: typo `unusude` (rust-lang/rust-by-example#1797) - Update print.md (rust-lang/rust-by-example#1796) - Update alias.md (rust-lang/rust-by-example#1790) ## rust-lang/rustc-dev-guide 4 commits in d13e85152a977cd0bcaf583cf5f49e86225697de..4af29d1a7f64f88a36539662c6a84fe1fbe6cde1 2024-01-14 10:42:53 UTC to 2024-01-06 17:47:01 UTC - Expand upon PR guidelines (rust-lang/rustc-dev-guide#1851) - Correct the link to rust reference (rust-lang/rustc-dev-guide#1848) - Explain the important concepts of exhaustiveness checking (rust-lang/rustc-dev-guide#1830) - Add guide for rustdoc search implementation (rust-lang/rustc-dev-guide#1846)
<-
was the "move operator", removed in Rust 0.5, but is still lexed as a single token.So I think it should be listed in the Punctuation table (like the tilde token is).
Originally reported as ferrocene/specification#452
Fixes #583