-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix span for non-satisfied trivial trait bounds #90884
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
d976ab6
to
a67938a
Compare
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
a67938a
to
24acf86
Compare
estebank
reviewed
Nov 15, 2021
Comment on lines
1
to
+5
error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied | ||
--> $DIR/issue-67185-2.rs:12:1 | ||
--> $DIR/issue-67185-2.rs:15:5 | ||
| | ||
LL | / trait Foo | ||
LL | | | ||
LL | | where | ||
LL | | [<u8 as Baz>::Quaks; 2]: Bar, | ||
LL | | <u8 as Baz>::Quaks: Bar, | ||
LL | | { | ||
LL | | } | ||
| |_^ the trait `Bar` is not implemented for `[u16; 3]` | ||
LL | <u8 as Baz>::Quaks: Bar, | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `[u16; 3]` |
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.
Ideally this should have a secondary span pointing at line 5, but that can be accomplished with maybe a new ObligationCauseCode
(or maybe an ImplObligation
).
@bors r+ |
📌 Commit 24acf86 has been approved by |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
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 pull request
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 pull request
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 pull request
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 pull request
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 pull request
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 pull request
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
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 17, 2021
…askrgr Rollup of 8 pull requests Successful merges: - rust-lang#89610 (warn on must_use use on async fn's) - rust-lang#90667 (Improve diagnostics when a static lifetime is expected) - rust-lang#90687 (Permit const panics in stable const contexts in stdlib) - rust-lang#90772 (Add Vec::retain_mut) - rust-lang#90861 (Print escaped string if char literal has multiple characters, but only one printable character) - rust-lang#90884 (Fix span for non-satisfied trivial trait bounds) - rust-lang#90900 (Remove workaround for the forward progress handling in LLVM) - rust-lang#90901 (Improve ManuallyDrop suggestion) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 #90869