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 May 2, 2024
1 parent 60a4538 commit d361fb6
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 74 deletions.
17 changes: 0 additions & 17 deletions tests/crashes/118987.rs

This file was deleted.

27 changes: 0 additions & 27 deletions tests/crashes/119272.rs

This file was deleted.

24 changes: 0 additions & 24 deletions tests/crashes/74299.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ known-bug: #118987
//@ check-pass
// Regression test for #118987 which previously caused an ICE.
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete

trait Assoc {
Expand All @@ -14,4 +15,6 @@ impl Assoc for u8 {}
trait Foo {}

impl Foo for <u8 as Assoc>::Output {}
impl Foo for <u16 as Assoc>::Output {}
impl Foo for u16 {}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/coherence-ice-issue-118987.rs:3: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

warning: 1 warning emitted

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
--> $DIR/specialization-default-items-drop-coherence.rs:26:1
--> $DIR/specialization-default-items-drop-coherence.rs:28:1
|
LL | impl Overlap for u32 {
| -------------------- first implementation here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
--> $DIR/specialization-default-items-drop-coherence.rs:26:1
--> $DIR/specialization-default-items-drop-coherence.rs:28:1
|
LL | impl Overlap for u32 {
| -------------------- first implementation here
Expand All @@ -8,7 +8,7 @@ LL | impl Overlap for <u32 as Default>::Id {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u32`

error[E0282]: type annotations needed
--> $DIR/specialization-default-items-drop-coherence.rs:15:23
--> $DIR/specialization-default-items-drop-coherence.rs:17:23
|
LL | default type Id = T;
| ^ cannot infer type for associated type `<T as Default>::Id`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

// Should fail. Default items completely drop candidates instead of ambiguity,
// which is unsound during coherence, since coherence requires completeness.
//
// A regression test for #105782.

#![feature(specialization)]
#![allow(incomplete_features)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
//@ known-bug: #124207
// A regression test for #124207.
//
// This previous caused an ICE in the old solver.
#![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/opaque-type-layout-ice-issue-124207.rs:7: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/opaque-type-layout-ice-issue-124207.rs:10:45
|
LL | impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
| ^^

error[E0119]: conflicting implementations of trait `AnotherTrait`
--> $DIR/opaque-type-layout-ice-issue-124207.rs:12: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 d361fb6

Please sign in to comment.