Skip to content

Commit d361fb6

Browse files
committed
rebase and update fixed crashes
1 parent 60a4538 commit d361fb6

10 files changed

+55
-74
lines changed

Diff for: tests/crashes/118987.rs

-17
This file was deleted.

Diff for: tests/crashes/119272.rs

-27
This file was deleted.

Diff for: tests/crashes/74299.rs

-24
This file was deleted.

Diff for: tests/crashes/118987-2.rs renamed to tests/ui/specialization/defaultimpl/coherence-ice-issue-118987.rs

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

45
trait Assoc {
@@ -14,4 +15,6 @@ impl Assoc for u8 {}
1415
trait Foo {}
1516

1617
impl Foo for <u8 as Assoc>::Output {}
17-
impl Foo for <u16 as Assoc>::Output {}
18+
impl Foo for u16 {}
19+
20+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/coherence-ice-issue-118987.rs:3:12
3+
|
4+
LL | #![feature(specialization)]
5+
| ^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
8+
= help: consider using `min_specialization` instead, which is more stable and complete
9+
= note: `#[warn(incomplete_features)]` on by default
10+
11+
warning: 1 warning emitted
12+

Diff for: tests/ui/specialization/specialization-default-items-drop-coherence.current.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
2-
--> $DIR/specialization-default-items-drop-coherence.rs:26:1
2+
--> $DIR/specialization-default-items-drop-coherence.rs:28:1
33
|
44
LL | impl Overlap for u32 {
55
| -------------------- first implementation here

Diff for: tests/ui/specialization/specialization-default-items-drop-coherence.next.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0119]: conflicting implementations of trait `Overlap` for type `u32`
2-
--> $DIR/specialization-default-items-drop-coherence.rs:26:1
2+
--> $DIR/specialization-default-items-drop-coherence.rs:28:1
33
|
44
LL | impl Overlap for u32 {
55
| -------------------- first implementation here
@@ -8,7 +8,7 @@ LL | impl Overlap for <u32 as Default>::Id {
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u32`
99

1010
error[E0282]: type annotations needed
11-
--> $DIR/specialization-default-items-drop-coherence.rs:15:23
11+
--> $DIR/specialization-default-items-drop-coherence.rs:17:23
1212
|
1313
LL | default type Id = T;
1414
| ^ cannot infer type for associated type `<T as Default>::Id`

Diff for: tests/ui/specialization/specialization-default-items-drop-coherence.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

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

79
#![feature(specialization)]
810
#![allow(incomplete_features)]
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
//@ known-bug: #124207
1+
// A regression test for #124207.
2+
//
3+
// This previous caused an ICE in the old solver.
24
#![feature(transmutability)]
35
#![feature(type_alias_impl_trait)]
46
trait OpaqueTrait {}
57
type OpaqueType = impl OpaqueTrait;
8+
//~^ ERROR unconstrained opaque type
69
trait AnotherTrait {}
710
impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
11+
//~^ ERROR type provided when a constant was expected
812
impl AnotherTrait for OpaqueType {}
13+
//~^ ERROR conflicting implementations of trait `AnotherTrait`
914
pub fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
error: unconstrained opaque type
2+
--> $DIR/opaque-type-layout-ice-issue-124207.rs:7:19
3+
|
4+
LL | type OpaqueType = impl OpaqueTrait;
5+
| ^^^^^^^^^^^^^^^^
6+
|
7+
= note: `OpaqueType` must be used in combination with a concrete type within the same module
8+
9+
error[E0747]: type provided when a constant was expected
10+
--> $DIR/opaque-type-layout-ice-issue-124207.rs:10:45
11+
|
12+
LL | impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
13+
| ^^
14+
15+
error[E0119]: conflicting implementations of trait `AnotherTrait`
16+
--> $DIR/opaque-type-layout-ice-issue-124207.rs:12:1
17+
|
18+
LL | impl<T: std::mem::BikeshedIntrinsicFrom<(), ()>> AnotherTrait for T {}
19+
| ------------------------------------------------------------------- first implementation here
20+
LL |
21+
LL | impl AnotherTrait for OpaqueType {}
22+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
23+
24+
error: aborting due to 3 previous errors
25+
26+
Some errors have detailed explanations: E0119, E0747.
27+
For more information about an error, try `rustc --explain E0119`.

0 commit comments

Comments
 (0)