Trait predicate ambiguities are not always in Self#78111
Merged
bors merged 2 commits intorust-lang:masterfrom Oct 20, 2020
Merged
Trait predicate ambiguities are not always in Self#78111bors merged 2 commits intorust-lang:masterfrom
Self#78111bors merged 2 commits intorust-lang:masterfrom
Conversation
Contributor
|
r? @lcnr (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Collaborator
|
📌 Commit 4cf890cacd538c608e8ac6dcfc7b22a7d5043344 has been approved by |
Contributor
|
@bors r- missed something in my review |
lcnr
reviewed
Oct 19, 2020
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
4cf890c to
c146e8c
Compare
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit c146e8c has been approved by |
Contributor
Author
|
Searching "type annotations needed" shows a whole bunch of other open issue reports that should be fixed by this (and I can confirm a few locally), non-exhaustive list: #75398, #72616, #71732 I'm not sure if/how many of these are worth adding extra tests for or just marking as closed by this. |
Contributor
Contributor
Author
|
Should we r- and add tests to this PR or clean these up later? |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 20, 2020
Rollup of 10 pull requests Successful merges: - rust-lang#77612 (BTreeMap: test invariants more thoroughly and more readably) - rust-lang#77761 (Assert that pthread mutex initialization succeeded) - rust-lang#77778 ([x.py setup] Allow setting up git hooks from other worktrees) - rust-lang#77838 (const keyword: brief paragraph on 'const fn') - rust-lang#77923 ([net] apply clippy lints) - rust-lang#77931 (Fix false positive for `unused_parens` lint) - rust-lang#77959 (Tweak ui-tests structure) - rust-lang#78105 (change name in .mailmap) - rust-lang#78111 (Trait predicate ambiguities are not always in `Self`) - rust-lang#78121 (Do not ICE on pattern that uses a binding multiple times in generator) Failed merges: r? `@ghost`
Contributor
|
will mark these issues as |
This was referenced Oct 20, 2020
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When reporting ambiguities in trait predicates, the compiler incorrectly assumed the ambiguity was always in the type the trait should be implemented on, and never the generic parameters of the trait. This caused silly suggestions for predicates like
<KnownType as Trait<_>>, such as giving explicit types to completely unrelated variables that happened to be of typeKnownType.This also reverts #73027, which worked around this issue in some cases and does not appear to be necessary any more.
fixes #77982
fixes #78055