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.
Rollup merge of rust-lang#125792 - compiler-errors:dont-drop-upcast-cand, r=lcnr Don't drop `Unsize` candidate in intercrate mode Fixes rust-lang#125767
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#![feature(unsize)] | ||
|
||
use std::marker::Unsize; | ||
use std::ops::Deref; | ||
|
||
trait Foo: Bar {} | ||
trait Bar {} | ||
|
||
impl<T> Bar for T where dyn Foo: Unsize<dyn Bar> {} | ||
impl Bar for () {} | ||
//~^ ERROR conflicting implementations of trait `Bar` for type `()` | ||
|
||
fn main() {} |
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,11 @@ | ||
error[E0119]: conflicting implementations of trait `Bar` for type `()` | ||
--> $DIR/dont-drop-upcast-candidate.rs:10:1 | ||
| | ||
LL | impl<T> Bar for T where dyn Foo: Unsize<dyn Bar> {} | ||
| ------------------------------------------------ first implementation here | ||
LL | impl Bar for () {} | ||
| ^^^^^^^^^^^^^^^ conflicting implementation for `()` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |