-
-
Notifications
You must be signed in to change notification settings - Fork 17.2k
Don't merge distinct impl candidates #161386
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7e43fd2
add trait_is_marker to Interner
bit-aloo 819623a
don't merge distinct impl candidates
bit-aloo f002f33
drop specialized impls with equal inference constraints
bit-aloo d86cf85
update fallout tests
bit-aloo 0adc046
add tests
bit-aloo 781bc2b
replace has_distinct_impl_candidates with try_merge_impl_candidates a…
bit-aloo b49ec62
add merge_candidates_or_bail_with_ambiguity and merge_impl_candidates…
bit-aloo 0c27f4b
Remove flounder from merge_trait_candidates
bit-aloo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
17 changes: 17 additions & 0 deletions
17
tests/ui/traits/next-solver/ambiguous-impl-in-resolve.next.stderr
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| error[E0283]: type annotations needed: cannot satisfy `Option<T>: Overlap` | ||
| --> $DIR/ambiguous-impl-in-resolve.rs:17:6 | ||
| | | ||
| LL | <Option<T> as Overlap>::f(); | ||
| | ^^^^^^^^^ | ||
| | | ||
| note: multiple `impl`s satisfying `Option<T>: Overlap` found | ||
| --> $DIR/ambiguous-impl-in-resolve.rs:10:1 | ||
| | | ||
| LL | impl<T> Overlap for Option<T> where Self: Clone, { fn f() {} } | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| LL | impl<T> Overlap for Option<T> where Self: Local, { fn f() {} } | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| error: aborting due to 1 previous error | ||
|
|
||
| For more information about this error, try `rustc --explain E0283`. |
17 changes: 17 additions & 0 deletions
17
tests/ui/traits/next-solver/ambiguous-impl-in-resolve.old.stderr
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| error[E0283]: type annotations needed: cannot satisfy `Option<T>: Overlap` | ||
| --> $DIR/ambiguous-impl-in-resolve.rs:17:6 | ||
| | | ||
| LL | <Option<T> as Overlap>::f(); | ||
| | ^^^^^^^^^ | ||
| | | ||
| note: multiple `impl`s satisfying `Option<T>: Overlap` found | ||
| --> $DIR/ambiguous-impl-in-resolve.rs:10:1 | ||
| | | ||
| LL | impl<T> Overlap for Option<T> where Self: Clone, { fn f() {} } | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| LL | impl<T> Overlap for Option<T> where Self: Local, { fn f() {} } | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| error: aborting due to 1 previous error | ||
|
|
||
| For more information about this error, try `rustc --explain E0283`. |
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
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
59 changes: 57 additions & 2 deletions
59
tests/ui/traits/next-solver/cycles/fixpoint-rerun-all-cycle-heads.stderr
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,65 @@ | ||
| error[E0283]: type annotations needed: cannot satisfy `B<T>: Trait<'a, 'b>` | ||
| --> $DIR/fixpoint-rerun-all-cycle-heads.rs:21:35 | ||
| | | ||
| LL | impl<'a, 'b, T> Trait<'a, 'b> for B<T> | ||
| | ^^^^ | ||
| | | ||
| note: multiple `impl`s satisfying `B<T>: Trait<'a, 'b>` found | ||
| --> $DIR/fixpoint-rerun-all-cycle-heads.rs:21:1 | ||
| | | ||
| LL | / impl<'a, 'b, T> Trait<'a, 'b> for B<T> | ||
| LL | | | ||
| LL | | where | ||
| LL | | A<T>: Trait<'a, 'b>, | ||
| LL | | A<T>: NotImplemented, | ||
| | |_________________________^ | ||
| ... | ||
| LL | / impl<'a, 'b, T> Trait<'a, 'b> for B<T> | ||
| LL | | | ||
| LL | | where | ||
| LL | | A<T>: NotImplemented, | ||
| | |_________________________^ | ||
| ... | ||
| LL | / impl<'a, T> Trait<'a, 'static> for B<T> | ||
| LL | | where | ||
| LL | | C<T>: Trait<'a, 'a>, | ||
| | |________________________^ | ||
|
|
||
| error[E0283]: type annotations needed: cannot satisfy `B<T>: Trait<'a, 'b>` | ||
| --> $DIR/fixpoint-rerun-all-cycle-heads.rs:36:35 | ||
| | | ||
| LL | impl<'a, 'b, T> Trait<'a, 'b> for B<T> | ||
| | ^^^^ | ||
| | | ||
| note: multiple `impl`s satisfying `B<T>: Trait<'a, 'b>` found | ||
| --> $DIR/fixpoint-rerun-all-cycle-heads.rs:21:1 | ||
| | | ||
| LL | / impl<'a, 'b, T> Trait<'a, 'b> for B<T> | ||
| LL | | | ||
| LL | | where | ||
| LL | | A<T>: Trait<'a, 'b>, | ||
| LL | | A<T>: NotImplemented, | ||
| | |_________________________^ | ||
| ... | ||
| LL | / impl<'a, 'b, T> Trait<'a, 'b> for B<T> | ||
| LL | | | ||
| LL | | where | ||
| LL | | A<T>: NotImplemented, | ||
| | |_________________________^ | ||
| ... | ||
| LL | / impl<'a, T> Trait<'a, 'static> for B<T> | ||
| LL | | where | ||
| LL | | C<T>: Trait<'a, 'a>, | ||
| | |________________________^ | ||
|
|
||
| error: lifetime may not live long enough | ||
| --> $DIR/fixpoint-rerun-all-cycle-heads.rs:60:5 | ||
| --> $DIR/fixpoint-rerun-all-cycle-heads.rs:62:5 | ||
| | | ||
| LL | fn check<'a, T>() { | ||
| | -- lifetime `'a` defined here | ||
| LL | impls_trait::<'a, 'static, A<T>>(); | ||
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` | ||
|
|
||
| error: aborting due to 1 previous error | ||
| error: aborting due to 3 previous errors | ||
|
|
||
| For more information about this error, try `rustc --explain E0283`. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
can you add a debug assert that all candidates are actually impl candidates here?
View changes since the review