forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#124936 - lcnr:cool-beans, r=compiler-errors
analyse visitor: build proof tree in probe see inline comments fixes rust-lang#124791 fixes rust-lang#124702 r? `@compiler-errors`
- Loading branch information
Showing
8 changed files
with
113 additions
and
34 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 was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
tests/ui/traits/next-solver/coherence/ambiguity-causes-canonical-state-ice-1.rs
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,43 @@ | ||
//@ compile-flags: -Znext-solver=coherence | ||
//@ check-pass | ||
|
||
// A regression test for #124791. Computing ambiguity causes | ||
// for the overlap of the `ToString` impls caused an ICE. | ||
#![crate_type = "lib"] | ||
#![feature(min_specialization)] | ||
trait Display {} | ||
|
||
trait ToOwned { | ||
type Owned; | ||
} | ||
|
||
impl<T> ToOwned for T { | ||
type Owned = T; | ||
} | ||
|
||
struct Cow<B: ?Sized>(B); | ||
|
||
impl<B: ?Sized> Display for Cow<B> | ||
where | ||
B: ToOwned, | ||
B::Owned: Display, | ||
{ | ||
} | ||
|
||
impl Display for () {} | ||
|
||
trait ToString { | ||
fn to_string(); | ||
} | ||
|
||
impl<T: Display + ?Sized> ToString for T { | ||
default fn to_string() {} | ||
} | ||
|
||
impl ToString for Cow<str> { | ||
fn to_string() {} | ||
} | ||
|
||
impl ToOwned for str { | ||
type Owned = (); | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/ui/traits/next-solver/coherence/ambiguity-causes-canonical-state-ice-2.rs
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,19 @@ | ||
//@ compile-flags: -Znext-solver=coherence | ||
|
||
// A regression test for #124791. Computing ambiguity causes | ||
// for the overlap of the `ToString` impls caused an ICE. | ||
#![crate_type = "lib"] | ||
trait ToOwned { | ||
type Owned; | ||
} | ||
impl<T> ToOwned for T { | ||
type Owned = u8; | ||
} | ||
impl ToOwned for str { | ||
type Owned = i8; | ||
} | ||
|
||
trait Overlap {} | ||
impl<T: ToOwned<Owned = i8> + ?Sized> Overlap for T {} | ||
impl Overlap for str {} | ||
//~^ ERROR conflicting implementations of trait `Overlap` |
11 changes: 11 additions & 0 deletions
11
tests/ui/traits/next-solver/coherence/ambiguity-causes-canonical-state-ice-2.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,11 @@ | ||
error[E0119]: conflicting implementations of trait `Overlap` for type `str` | ||
--> $DIR/ambiguity-causes-canonical-state-ice-2.rs:18:1 | ||
| | ||
LL | impl<T: ToOwned<Owned = i8> + ?Sized> Overlap for T {} | ||
| --------------------------------------------------- first implementation here | ||
LL | impl Overlap for str {} | ||
| ^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `str` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
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