-
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
Merged
Changes from 1 commit
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
86 changes: 75 additions & 11 deletions
86
tests/ui/associated-types/defaults-unsound-62211-1.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 |
---|---|---|
@@ -1,17 +1,81 @@ | ||
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing | ||
--> $DIR/defaults-unsound-62211-1.rs:52:5 | ||
error[E0277]: `Self` doesn't implement `std::fmt::Display` | ||
--> $DIR/defaults-unsound-62211-1.rs:24:96 | ||
| | ||
LL | drop(origin); | ||
| ^^^^^------^ | ||
| | | ||
| argument has type `<T as UncheckedCopy>::Output` | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ `Self` cannot be formatted with the default formatter | ||
| | ||
= note: `#[warn(dropping_copy_types)]` on by default | ||
help: use `let _ = ...` to ignore the expression or result | ||
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-1.rs:24:86 | ||
| | ||
LL - drop(origin); | ||
LL + let _ = origin; | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^^^^ required by this bound in `UncheckedCopy::Output` | ||
help: consider further restricting `Self` | ||
| | ||
LL | trait UncheckedCopy: Sized + std::fmt::Display { | ||
| +++++++++++++++++++ | ||
|
||
warning: 1 warning emitted | ||
error[E0277]: cannot add-assign `&'static str` to `Self` | ||
--> $DIR/defaults-unsound-62211-1.rs:24:96 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ no implementation for `Self += &'static str` | ||
| | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-1.rs:24:47 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output` | ||
help: consider further restricting `Self` | ||
| | ||
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> { | ||
| +++++++++++++++++++++++++ | ||
|
||
error[E0271]: type mismatch resolving `<Self as Deref>::Target == str` | ||
--> $DIR/defaults-unsound-62211-1.rs:24:96 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ types differ | ||
| | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-1.rs:24:31 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output` | ||
|
||
error[E0277]: the trait bound `Self: Deref` is not satisfied | ||
--> $DIR/defaults-unsound-62211-1.rs:24:96 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ the trait `Deref` is not implemented for `Self` | ||
| | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-1.rs:24:25 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output` | ||
help: consider further restricting `Self` | ||
| | ||
LL | trait UncheckedCopy: Sized + Deref { | ||
| +++++++ | ||
|
||
error[E0277]: the trait bound `Self: Copy` is not satisfied | ||
--> $DIR/defaults-unsound-62211-1.rs:24:96 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ the trait `Copy` is not implemented for `Self` | ||
| | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-1.rs:24:18 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ required by this bound in `UncheckedCopy::Output` | ||
help: consider further restricting `Self` | ||
| | ||
LL | trait UncheckedCopy: Sized + Copy { | ||
| ++++++ | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
Some errors have detailed explanations: E0271, E0277. | ||
For more information about an error, try `rustc --explain E0271`. |
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
86 changes: 75 additions & 11 deletions
86
tests/ui/associated-types/defaults-unsound-62211-2.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 |
---|---|---|
@@ -1,17 +1,81 @@ | ||
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing | ||
--> $DIR/defaults-unsound-62211-2.rs:52:5 | ||
error[E0277]: `Self` doesn't implement `std::fmt::Display` | ||
--> $DIR/defaults-unsound-62211-2.rs:24:96 | ||
| | ||
LL | drop(origin); | ||
| ^^^^^------^ | ||
| | | ||
| argument has type `<T as UncheckedCopy>::Output` | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ `Self` cannot be formatted with the default formatter | ||
| | ||
= note: `#[warn(dropping_copy_types)]` on by default | ||
help: use `let _ = ...` to ignore the expression or result | ||
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-2.rs:24:86 | ||
| | ||
LL - drop(origin); | ||
LL + let _ = origin; | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^^^^ required by this bound in `UncheckedCopy::Output` | ||
help: consider further restricting `Self` | ||
| | ||
LL | trait UncheckedCopy: Sized + std::fmt::Display { | ||
| +++++++++++++++++++ | ||
|
||
warning: 1 warning emitted | ||
error[E0277]: cannot add-assign `&'static str` to `Self` | ||
--> $DIR/defaults-unsound-62211-2.rs:24:96 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ no implementation for `Self += &'static str` | ||
| | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-2.rs:24:47 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output` | ||
help: consider further restricting `Self` | ||
| | ||
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> { | ||
| +++++++++++++++++++++++++ | ||
|
||
error[E0271]: type mismatch resolving `<Self as Deref>::Target == str` | ||
--> $DIR/defaults-unsound-62211-2.rs:24:96 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ types differ | ||
| | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-2.rs:24:31 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output` | ||
|
||
error[E0277]: the trait bound `Self: Deref` is not satisfied | ||
--> $DIR/defaults-unsound-62211-2.rs:24:96 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ the trait `Deref` is not implemented for `Self` | ||
| | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-2.rs:24:25 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output` | ||
help: consider further restricting `Self` | ||
| | ||
LL | trait UncheckedCopy: Sized + Deref { | ||
| +++++++ | ||
|
||
error[E0277]: the trait bound `Self: Copy` is not satisfied | ||
--> $DIR/defaults-unsound-62211-2.rs:24:96 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ the trait `Copy` is not implemented for `Self` | ||
| | ||
note: required by a bound in `UncheckedCopy::Output` | ||
--> $DIR/defaults-unsound-62211-2.rs:24:18 | ||
| | ||
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self; | ||
| ^^^^ required by this bound in `UncheckedCopy::Output` | ||
help: consider further restricting `Self` | ||
| | ||
LL | trait UncheckedCopy: Sized + Copy { | ||
| ++++++ | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
Some errors have detailed explanations: E0271, E0277. | ||
For more information about an error, try `rustc --explain E0271`. |
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 👍