rebase and update fixed crashes

This commit is contained in:
lcnr 2024-04-15 18:10:46 +02:00
parent 1a893ac648
commit d93e047c9f
7 changed files with 78 additions and 21 deletions

View File

@ -1,17 +0,0 @@
//@ known-bug: #118987
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
trait Assoc {
type Output;
}
default impl<T: Clone> Assoc for T {
type Output = bool;
}
impl Assoc for u8 {}
trait Foo {}
impl Foo for <u8 as Assoc>::Output {}
impl Foo for <u16 as Assoc>::Output {}

View File

@ -1,4 +1,4 @@
//@ known-bug: #118987 // regression test for #118987
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
trait Assoc { trait Assoc {
@ -15,3 +15,5 @@ trait Foo {}
impl Foo for <u8 as Assoc>::Output {} impl Foo for <u8 as Assoc>::Output {}
impl Foo for <u16 as Assoc>::Output {} impl Foo for <u16 as Assoc>::Output {}
//~^ ERROR the trait bound `u16: Assoc` is not satisfied
fn main() {}

View File

@ -0,0 +1,21 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default-impl-normalization-ambig-2.rs:2:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default
error[E0277]: the trait bound `u16: Assoc` is not satisfied
--> $DIR/default-impl-normalization-ambig-2.rs:17:14
|
LL | impl Foo for <u16 as Assoc>::Output {}
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Assoc` is not implemented for `u16`
|
= help: the trait `Assoc` is implemented for `u8`
error: aborting due to 1 previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0277`.

View File

@ -1,5 +1,5 @@
//@ known-bug: #74299 // regression test for #73299.
#![feature(specialization)] #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
trait X { trait X {
type U; type U;
@ -18,6 +18,7 @@ fn g(&self) {}
impl Y for <() as X>::U {} impl Y for <() as X>::U {}
impl Y for <i32 as X>::U {} impl Y for <i32 as X>::U {}
//~^ ERROR conflicting implementations of trait `Y` for type `<() as X>::U`
fn main() { fn main() {
().f().g(); ().f().g();

View File

@ -0,0 +1,21 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default-item-normalization-ambig-1.rs:2:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default
error[E0119]: conflicting implementations of trait `Y` for type `<() as X>::U`
--> $DIR/default-item-normalization-ambig-1.rs:20:1
|
LL | impl Y for <() as X>::U {}
| ----------------------- first implementation here
LL | impl Y for <i32 as X>::U {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<() as X>::U`
error: aborting due to 1 previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0119`.

View File

@ -1,9 +1,11 @@
//@ known-bug: #124207
#![feature(transmutability)] #![feature(transmutability)]
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
trait OpaqueTrait {} trait OpaqueTrait {}
type OpaqueType = impl OpaqueTrait; type OpaqueType = impl OpaqueTrait;
//~^ ERROR unconstrained opaque type
trait AnotherTrait {} trait AnotherTrait {}
impl<T: std::mem::TransmuteFrom<(), ()>> AnotherTrait for T {} impl<T: std::mem::TransmuteFrom<(), ()>> AnotherTrait for T {}
//~^ ERROR type provided when a constant was expected
impl AnotherTrait for OpaqueType {} impl AnotherTrait for OpaqueType {}
//~^ ERROR conflicting implementations of trait `AnotherTrait`
pub fn main() {} pub fn main() {}

View File

@ -0,0 +1,27 @@
error: unconstrained opaque type
--> $DIR/coherence-bikeshed-intrinsic-from.rs:4:19
|
LL | type OpaqueType = impl OpaqueTrait;
| ^^^^^^^^^^^^^^^^
|
= note: `OpaqueType` must be used in combination with a concrete type within the same module
error[E0747]: type provided when a constant was expected
--> $DIR/coherence-bikeshed-intrinsic-from.rs:7:37
|
LL | impl<T: std::mem::TransmuteFrom<(), ()>> AnotherTrait for T {}
| ^^
error[E0119]: conflicting implementations of trait `AnotherTrait`
--> $DIR/coherence-bikeshed-intrinsic-from.rs:9:1
|
LL | impl<T: std::mem::TransmuteFrom<(), ()>> AnotherTrait for T {}
| ----------------------------------------------------------- first implementation here
LL |
LL | impl AnotherTrait for OpaqueType {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0119, E0747.
For more information about an error, try `rustc --explain E0119`.