Skip to content

Commit

Permalink
rebase and update fixed crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Aug 15, 2024
1 parent adadad8 commit 859d2f6
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 21 deletions.
17 changes: 0 additions & 17 deletions tests/crashes/118987.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ known-bug: #118987
// regression test for #118987
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete

trait Assoc {
Expand All @@ -15,3 +15,5 @@ trait Foo {}

impl Foo for <u8 as Assoc>::Output {}
impl Foo for <u16 as Assoc>::Output {}
//~^ ERROR the trait bound `u16: Assoc` is not satisfied
fn main() {}
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ known-bug: #74299
#![feature(specialization)]
// regression test for #73299.
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete

trait X {
type U;
Expand All @@ -18,6 +18,7 @@ trait Y {

impl Y for <() as X>::U {}
impl Y for <i32 as X>::U {}
//~^ ERROR conflicting implementations of trait `Y` for type `<() as X>::U`

fn main() {
().f().g();
Expand Down
Original file line number Diff line number Diff line change
@@ -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`.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
//@ known-bug: #124207
#![feature(transmutability)]
#![feature(type_alias_impl_trait)]
trait OpaqueTrait {}
type OpaqueType = impl OpaqueTrait;
//~^ ERROR unconstrained opaque type
trait AnotherTrait {}
impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
//~^ ERROR type provided when a constant was expected
impl AnotherTrait for OpaqueType {}
//~^ ERROR conflicting implementations of trait `AnotherTrait`
pub fn main() {}
Original file line number Diff line number Diff line change
@@ -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:45
|
LL | impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
| ^^

error[E0119]: conflicting implementations of trait `AnotherTrait`
--> $DIR/coherence-bikeshed-intrinsic-from.rs:9:1
|
LL | impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> 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`.

0 comments on commit 859d2f6

Please sign in to comment.