-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make spans for tuple patterns in E0023 more precise #88123
Conversation
src/test/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr
Outdated
Show resolved
Hide resolved
src/test/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
As suggested in rust-lang#86307.
15b1b2c
to
da25af2
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This should cause a compiler error in the future if more variants are added without `Node::ident()` being updated.
4ffe312
to
08ceac8
Compare
This comment has been minimized.
This comment has been minimized.
help: a tuple struct with a similar name exists | ||
| | ||
LL | Z1(_, _) => {} | ||
| ~~ |
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.
It seems to me that we should suggest this only if the number of fields matches or if nothing else is being suggested (but that seems out of scope for this PR).
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.
Have to say, love how this is shaping up 😍
* Highlight the whole pattern if it has no fields * Highlight the whole definition if it has no fields * Only highlight the pattern name if the pattern is multi-line * Determine whether a pattern is multi-line based on distance from name to last field, rather than first field
Ok, done! I'll let you approve it so you can check that the new output matches what you were expecting :) |
From the commit message:
I made this change so that code like the following that uses "visual indentation" is understood as multi-line: M(1,
2,
3) |
Personally I would lean towards hiding the secondary span label under @bors r+ |
📌 Commit 8a6501d has been approved by |
…tebank Make spans for tuple patterns in E0023 more precise As suggested in rust-lang#86307. Closes rust-lang#86307. r? `@estebank`
…tebank Make spans for tuple patterns in E0023 more precise As suggested in rust-lang#86307. Closes rust-lang#86307. r? ``@estebank``
…tebank Make spans for tuple patterns in E0023 more precise As suggested in rust-lang#86307. Closes rust-lang#86307. r? ```@estebank```
…arth Rollup of 11 pull requests Successful merges: - rust-lang#87832 (Fix debugger stepping behavior with `match` expressions) - rust-lang#88123 (Make spans for tuple patterns in E0023 more precise) - rust-lang#88215 (Reland rust-lang#83738: "rustdoc: Don't load all extern crates unconditionally") - rust-lang#88216 (Don't stabilize creation of TryReserveError instances) - rust-lang#88270 (Handle type ascription type ops in NLL HRTB diagnostics) - rust-lang#88289 (Fixes for LLVM change 0f45c16) - rust-lang#88320 (type_implements_trait consider obligation failure on overflow) - rust-lang#88332 (Add argument types tait tests) - rust-lang#88340 (Add `c_size_t` and `c_ssize_t` to `std::os::raw`.) - rust-lang#88346 (Revert "Add type of a let tait test impl trait straight in let") - rust-lang#88348 (Add field types tait tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
As suggested in #86307. Closes #86307.
r? @estebank