-
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
Span for "trait bound not satisfied" errors in case of trivial bounds too large #90869
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
LukasKalbertodt
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Nov 13, 2021
@rustbot claim |
Noratrieb
added a commit
to Noratrieb/rust
that referenced
this issue
Nov 14, 2021
The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 15, 2021
…und, r=estebank Fix span for non-satisfied trivial trait bounds The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 15, 2021
…und, r=estebank Fix span for non-satisfied trivial trait bounds The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 16, 2021
…und, r=estebank Fix span for non-satisfied trivial trait bounds The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 16, 2021
…und, r=estebank Fix span for non-satisfied trivial trait bounds The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 16, 2021
…und, r=estebank Fix span for non-satisfied trivial trait bounds The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 16, 2021
…und, r=estebank Fix span for non-satisfied trivial trait bounds The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 17, 2021
…und, r=estebank Fix span for non-satisfied trivial trait bounds The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 17, 2021
…und, r=estebank Fix span for non-satisfied trivial trait bounds The spans for "trait bound not satisfied" errors in trivial trait bounds referenced the entire item (fn, impl, struct) before. Now they only reference the obligation itself (`String: Copy`) Address rust-lang#90869
It's fixed now and soon coming to a nightly near you :) |
@LukasKalbertodt the issue wasn't linked to the PR, so you'll have to close it manually |
Oh, true. Thanks for solving this so quickly :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code (Playground):
The current output is:
Ideally the output should look like:
The difference is just the span. This is particularly useful for macros which are probably the main producers of trivial bounds. You want the "the trait bound not satisfied" error of emitted code to have a good span. But since rustc currently uses the span of the whole item, that's often not possible.
Related: #48214
The text was updated successfully, but these errors were encountered: