-
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
Fold item bounds before proving them in check_type_bounds
in new solver
#125786
Merged
+557
−144
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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 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
142 changes: 142 additions & 0 deletions
142
tests/ui/associated-types/defaults-suitability.next.stderr
This file contains 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,142 @@ | ||
error[E0277]: the trait bound `NotClone: Clone` is not satisfied | ||
--> $DIR/defaults-suitability.rs:16:22 | ||
| | ||
LL | type Ty: Clone = NotClone; | ||
| ^^^^^^^^ the trait `Clone` is not implemented for `NotClone` | ||
| | ||
note: required by a bound in `Tr::Ty` | ||
--> $DIR/defaults-suitability.rs:16:14 | ||
| | ||
LL | type Ty: Clone = NotClone; | ||
| ^^^^^ required by this bound in `Tr::Ty` | ||
help: consider annotating `NotClone` with `#[derive(Clone)]` | ||
| | ||
LL + #[derive(Clone)] | ||
LL | struct NotClone; | ||
| | ||
|
||
error[E0277]: the trait bound `NotClone: Clone` is not satisfied | ||
--> $DIR/defaults-suitability.rs:25:15 | ||
| | ||
LL | type Ty = NotClone; | ||
| ^^^^^^^^ the trait `Clone` is not implemented for `NotClone` | ||
| | ||
note: required by a bound in `Tr2::Ty` | ||
--> $DIR/defaults-suitability.rs:23:15 | ||
| | ||
LL | Self::Ty: Clone, | ||
| ^^^^^ required by this bound in `Tr2::Ty` | ||
LL | { | ||
LL | type Ty = NotClone; | ||
| -- required by a bound in this associated type | ||
help: consider annotating `NotClone` with `#[derive(Clone)]` | ||
| | ||
LL + #[derive(Clone)] | ||
LL | struct NotClone; | ||
| | ||
|
||
error[E0277]: the trait bound `T: Clone` is not satisfied | ||
--> $DIR/defaults-suitability.rs:31:23 | ||
| | ||
LL | type Bar: Clone = Vec<T>; | ||
| ^^^^^^ the trait `Clone` is not implemented for `T`, which is required by `Vec<T>: Clone` | ||
| | ||
= note: required for `Vec<T>` to implement `Clone` | ||
note: required by a bound in `Foo::Bar` | ||
--> $DIR/defaults-suitability.rs:31:15 | ||
| | ||
LL | type Bar: Clone = Vec<T>; | ||
| ^^^^^ required by this bound in `Foo::Bar` | ||
help: consider restricting type parameter `T` | ||
| | ||
LL | trait Foo<T: std::clone::Clone> { | ||
| +++++++++++++++++++ | ||
|
||
error[E0277]: the trait bound `(): Foo<Self>` is not satisfied | ||
--> $DIR/defaults-suitability.rs:37:29 | ||
| | ||
LL | type Assoc: Foo<Self> = (); | ||
| ^^ the trait `Foo<Self>` is not implemented for `()` | ||
| | ||
help: this trait has no implementations, consider adding one | ||
--> $DIR/defaults-suitability.rs:30:1 | ||
| | ||
LL | trait Foo<T> { | ||
| ^^^^^^^^^^^^ | ||
note: required by a bound in `Bar::Assoc` | ||
--> $DIR/defaults-suitability.rs:37:17 | ||
| | ||
LL | type Assoc: Foo<Self> = (); | ||
| ^^^^^^^^^ required by this bound in `Bar::Assoc` | ||
|
||
error[E0277]: the trait bound `NotClone: IsU8<NotClone>` is not satisfied | ||
--> $DIR/defaults-suitability.rs:59:18 | ||
| | ||
LL | type Assoc = NotClone; | ||
| ^^^^^^^^ the trait `IsU8<NotClone>` is not implemented for `NotClone` | ||
| | ||
note: required by a bound in `D::Assoc` | ||
--> $DIR/defaults-suitability.rs:56:18 | ||
| | ||
LL | Self::Assoc: IsU8<Self::Assoc>, | ||
| ^^^^^^^^^^^^^^^^^ required by this bound in `D::Assoc` | ||
... | ||
LL | type Assoc = NotClone; | ||
| ----- required by a bound in this associated type | ||
|
||
error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied | ||
--> $DIR/defaults-suitability.rs:68:23 | ||
| | ||
LL | type Bar: Clone = Vec<Self::Baz>; | ||
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`, which is required by `Vec<<Self as Foo2<T>>::Baz>: Clone` | ||
| | ||
= note: required for `Vec<<Self as Foo2<T>>::Baz>` to implement `Clone` | ||
note: required by a bound in `Foo2::Bar` | ||
--> $DIR/defaults-suitability.rs:68:15 | ||
| | ||
LL | type Bar: Clone = Vec<Self::Baz>; | ||
| ^^^^^ required by this bound in `Foo2::Bar` | ||
help: consider further restricting the associated type | ||
| | ||
LL | trait Foo2<T> where <Self as Foo2<T>>::Baz: Clone { | ||
| +++++++++++++++++++++++++++++++++++ | ||
|
||
error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied | ||
--> $DIR/defaults-suitability.rs:77:23 | ||
| | ||
LL | type Bar: Clone = Vec<Self::Baz>; | ||
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`, which is required by `Vec<<Self as Foo25<T>>::Baz>: Clone` | ||
| | ||
= note: required for `Vec<<Self as Foo25<T>>::Baz>` to implement `Clone` | ||
note: required by a bound in `Foo25::Bar` | ||
--> $DIR/defaults-suitability.rs:77:15 | ||
| | ||
LL | type Bar: Clone = Vec<Self::Baz>; | ||
| ^^^^^ required by this bound in `Foo25::Bar` | ||
help: consider further restricting the associated type | ||
| | ||
LL | trait Foo25<T: Clone> where <Self as Foo25<T>>::Baz: Clone { | ||
| ++++++++++++++++++++++++++++++++++++ | ||
|
||
error[E0277]: the trait bound `T: Clone` is not satisfied | ||
--> $DIR/defaults-suitability.rs:90:16 | ||
| | ||
LL | type Baz = T; | ||
| ^ the trait `Clone` is not implemented for `T` | ||
| | ||
note: required by a bound in `Foo3::Baz` | ||
--> $DIR/defaults-suitability.rs:87:16 | ||
| | ||
LL | Self::Baz: Clone, | ||
| ^^^^^ required by this bound in `Foo3::Baz` | ||
... | ||
LL | type Baz = T; | ||
| --- required by a bound in this associated type | ||
help: consider further restricting type parameter `T` | ||
| | ||
LL | Self::Baz: Clone, T: std::clone::Clone | ||
| ~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
error: aborting due to 8 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
This file contains 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 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
Oops, something went wrong.
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.
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.
move this into the
next_solver
branch?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.
then it happens once per
for mut obligation in util::elaborate(tcx, obligations) {
.I could invert the
if
statement, and duplicate the for loop?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.
you're right, didn't see the for loop 👍