-
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
Reject integer suffix when tuple indexing #59421
Conversation
Fixed indenting in the block, you can ignore the whitespace changes with https://github.com/rust-lang/rust/pull/59421/files?w=1 |
The message could probably be rephrased to sound less awkward, but r=me either way. |
I had done exactly the same thing 😄 |
@bors r=varkor |
📌 Commit 6ad77b0 has been approved by |
I was going to blame beginner contributors and diagnostic improvements for this regression, but it turned out it was me - 44acea4. |
@estebank
|
@petrochenkov @estebank This is already r+ed, should we add the extra test cases in follow up PRs? (or do you want to r-?) |
@bors r- |
Added the requested changes. r? @petrochenkov, can you take a look to give final approval? For the case you asked the output is
Which is why I think it shouldn't be added to the test, as it is not handled by this PR. |
I think what this PR is doing (accept suffixed literal, report a non-fatal error, continue) is a better alternative than "expected identifier, found |
I see. Fixed. |
Thanks! |
📌 Commit 8d1cc72 has been approved by |
…ochenkov Reject integer suffix when tuple indexing Fix rust-lang#59418. r? @varkor
let d = c.1suffix; | ||
//~^ ERROR suffixes on a tuple index are invalid | ||
println!("{}", d); | ||
let s = X { 0suffix: 0, 1: 1, 2: 2 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about X { 0usize: 0, 1: 1, 2: 2 };
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(don't r- the PR in either case since it's in a rollup now... if changes need to be made, do it in a follow up PR)
…ochenkov Reject integer suffix when tuple indexing Fix rust-lang#59418. r? @varkor
…ochenkov Reject integer suffix when tuple indexing Fix rust-lang#59418. r? @varkor
Rollup of 18 pull requests Successful merges: - #57293 (Make some lints incremental) - #57565 (syntax: Remove warning for unnecessary path disambiguators) - #58253 (librustc_driver => 2018) - #58837 (librustc_interface => 2018) - #59268 (Add suggestion to use `&*var` when `&str: From<String>` is expected) - #59283 (Make ASCII case conversions more than 4× faster) - #59284 (adjust MaybeUninit API to discussions) - #59372 (add rustfix-able suggestions to trim_{left,right} deprecations) - #59390 (Make `ptr::eq` documentation mention fat-pointer behavior) - #59393 (Refactor tuple comparison tests) - #59420 ([CI] record docker image info for reuse) - #59421 (Reject integer suffix when tuple indexing) - #59430 (Renames `EvalContext` to `InterpretCx`) - #59439 (Generalize diagnostic for `x = y` where `bool` is the expected type) - #59449 (fix: Make incremental artifact deletion more robust) - #59451 (Add `Default` to `std::alloc::System`) - #59459 (Add some tests) - #59460 (Include id in Thread's Debug implementation) Failed merges: r? @ghost
Fix #59418.
r? @varkor