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 Apr 29, 2024
1 parent b34b50e commit 75da8ca
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 107 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.

17 changes: 2 additions & 15 deletions tests/ui/coherence/skip-reporting-if-references-err.current.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@ help: indicate the anonymous lifetime
LL | impl<T> ToUnit<'_> for T {}
| ++++

error[E0277]: the trait bound `for<'a> (): ToUnit<'a>` is not satisfied
--> $DIR/skip-reporting-if-references-err.rs:15:29
|
LL | impl Overlap for for<'a> fn(<() as ToUnit<'a>>::Unit) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `()`

error[E0277]: the trait bound `for<'a> (): ToUnit<'a>` is not satisfied
--> $DIR/skip-reporting-if-references-err.rs:15:18
|
LL | impl Overlap for for<'a> fn(<() as ToUnit<'a>>::Unit) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `()`

error: aborting due to 3 previous errors
error: aborting due to 1 previous error

Some errors have detailed explanations: E0277, E0726.
For more information about an error, try `rustc --explain E0277`.
For more information about this error, try `rustc --explain E0726`.
5 changes: 0 additions & 5 deletions tests/ui/coherence/skip-reporting-if-references-err.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// Regression test for #121006.
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver

trait ToUnit<'a> {
type Unit;
Expand All @@ -13,7 +10,5 @@ impl<T> ToUnit for T {}
trait Overlap {}
impl<U> Overlap for fn(U) {}
impl Overlap for for<'a> fn(<() as ToUnit<'a>>::Unit) {}
//[current]~^ ERROR the trait bound `for<'a> (): ToUnit<'a>` is not satisfied
//[current]~| ERROR the trait bound `for<'a> (): ToUnit<'a>` is not satisfied

fn main() {}
14 changes: 14 additions & 0 deletions tests/ui/coherence/skip-reporting-if-references-err.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0726]: implicit elided lifetime not allowed here
--> $DIR/skip-reporting-if-references-err.rs:7:9
|
LL | impl<T> ToUnit for T {}
| ^^^^^^ expected lifetime parameter
|
help: indicate the anonymous lifetime
|
LL | impl<T> ToUnit<'_> for T {}
| ++++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0726`.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ trait Trait {}
impl<const N: u32> Trait for A<N> {}

impl<const N: u32> Trait for A<N> {}
//~^ ERROR conflicting implementations of trait `Trait` for type `A<_>`

pub fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ error[E0423]: expected value, found builtin type `u8`
LL | struct A<const N: u32 = 1, const M: u32 = u8>;
| ^^ not a value

error[E0119]: conflicting implementations of trait `Trait` for type `A<_>`
--> $DIR/unknown-alias-defkind-anonconst-ice-116710.rs:12:1
|
LL | impl<const N: u32> Trait for A<N> {}
| --------------------------------- first implementation here
LL |
LL | impl<const N: u32> Trait for A<N> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `A<_>`

error: aborting due to 2 previous errors
error: aborting due to 1 previous error

Some errors have detailed explanations: E0119, E0423.
For more information about an error, try `rustc --explain E0119`.
For more information about this error, try `rustc --explain E0423`.
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 75da8ca

Please sign in to comment.