-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Make some diagnostics not depend on the source of what they reference being available #105500
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon. Please see the contribution instructions for more information. |
src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr
Outdated
Show resolved
Hide resolved
I'm seeing a bunch of test output changes that do not seem related to your code changes. Could there be a missing commit? |
I don't believe so |
src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr
Outdated
Show resolved
Hide resolved
src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr
Outdated
Show resolved
Hide resolved
408b93c
to
a412710
Compare
src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
Outdated
Show resolved
Hide resolved
a412710
to
ae21671
Compare
let snippet = match source_map.span_to_snippet(interior_span) { | ||
// #70935: If snippet contains newlines, display "the value" instead | ||
// so that we do not emit complex diagnostics. | ||
Ok(snippet) if !snippet.contains('\n') => format!("`{}`", snippet), |
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.
Should we add a length check here too, just to make sure that the snippet is not for a long expr in one line?
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.
maybe this entire diagnostic deserves a redesign to point at the span instead of getting the snippet in a message?
☔ The latest upstream changes (presumably #105554) made this pull request unmergeable. Please resolve the merge conflicts. |
ae21671
to
18d8fe4
Compare
@@ -3,11 +3,9 @@ error[E0412]: cannot find type `n` in this scope | |||
| | |||
LL | type_ascribe!(2, n([u8; || 1])) | |||
| ^ help: a trait with a similar name exists: `Fn` | |||
--> $SRC_DIR/core/src/ops/function.rs:LL:COL |
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.
This is outstanding: it should be :::
or
note: similarly named
--> $SRC_DIR/...
@bors r+ |
📌 Commit e9dae2129800ad96b1b0ead3a0f485dbd412c06c has been approved by It is now in the queue for this repository. |
☔ The latest upstream changes (presumably #105644) made this pull request unmergeable. Please resolve the merge conflicts. |
… of relying on the span making it obvious
e9dae21
to
82ce70a
Compare
@bors r=estebank |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#105147 (Allow unsafe through inline const) - rust-lang#105438 (Move some codegen-y methods from `rustc_hir_analysis::collect` -> `rustc_codegen_ssa`) - rust-lang#105464 (Support #[track_caller] on async closures) - rust-lang#105476 (Change pattern borrowing suggestions to be verbose and remove invalid suggestion) - rust-lang#105500 (Make some diagnostics not depend on the source of what they reference being available) - rust-lang#105628 (Small doc fixes) - rust-lang#105659 (Don't require owned data in `MaybeStorageLive`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
r? @estebank
follow up to #104449