forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#132289 - compiler-errors:vanquish-dyn-incompl…
…eteness, r=<try> Disqualify built-in trait impl if it seems likely to be overlap in an unsound way with a blanket impl r? lcnr
- Loading branch information
Showing
14 changed files
with
161 additions
and
18 deletions.
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
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
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
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
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
25 changes: 25 additions & 0 deletions
25
tests/ui/coherence/indirect-impl-for-trait-obj-coherence.current.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,25 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/indirect-impl-for-trait-obj-coherence.rs:23:41 | ||
| | ||
LL | fn transmute<T, U>(x: T) -> U { | ||
| - - expected type parameter | ||
| | | ||
| found type parameter | ||
LL | foo::<dyn Object<U, Output = T>, U>(x) | ||
| ----------------------------------- ^ expected type parameter `U`, found type parameter `T` | ||
| | | ||
| arguments to this function are incorrect | ||
| | ||
= note: expected type parameter `U` | ||
found type parameter `T` | ||
= note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound | ||
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters | ||
note: function defined here | ||
--> $DIR/indirect-impl-for-trait-obj-coherence.rs:17:4 | ||
| | ||
LL | fn foo<T: ?Sized, U>(x: <T as Object<U>>::Output) -> U { | ||
| ^^^ --------------------------- | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
24 changes: 20 additions & 4 deletions
24
tests/ui/coherence/indirect-impl-for-trait-obj-coherence.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,9 +1,25 @@ | ||
error[E0284]: type annotations needed: cannot normalize `<dyn Object<U, Output = T> as Object<U>>::Output` | ||
--> $DIR/indirect-impl-for-trait-obj-coherence.rs:25:41 | ||
error[E0308]: mismatched types | ||
--> $DIR/indirect-impl-for-trait-obj-coherence.rs:23:41 | ||
| | ||
LL | fn transmute<T, U>(x: T) -> U { | ||
| - - expected type parameter | ||
| | | ||
| found type parameter | ||
LL | foo::<dyn Object<U, Output = T>, U>(x) | ||
| ^ cannot normalize `<dyn Object<U, Output = T> as Object<U>>::Output` | ||
| ----------------------------------- ^ expected type parameter `U`, found type parameter `T` | ||
| | | ||
| arguments to this function are incorrect | ||
| | ||
= note: expected type parameter `U` | ||
found type parameter `T` | ||
= note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound | ||
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters | ||
note: function defined here | ||
--> $DIR/indirect-impl-for-trait-obj-coherence.rs:17:4 | ||
| | ||
LL | fn foo<T: ?Sized, U>(x: <T as Object<U>>::Output) -> U { | ||
| ^^^ --------------------------- | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0284`. | ||
For more information about this error, try `rustc --explain E0308`. |
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
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