Skip to content

Commit 55b9c71

Browse files
committed
update crashes
1 parent d25ecfd commit 55b9c71

File tree

3 files changed

+89
-15
lines changed

3 files changed

+89
-15
lines changed

tests/crashes/129444.rs

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// A regression test for #129444. This previously ICE'd as
2+
// computing the best obligation for one ambiguous obligation
3+
// added spurious inference constraints which causes another
4+
// candidate to pass.
5+
trait Trait {
6+
type Assoc;
7+
}
8+
9+
struct W<T: Trait>(*mut T);
10+
impl<T> Trait for W<W<W<T>>> {}
11+
//~^ ERROR the trait bound `W<W<T>>: Trait` is not satisfied
12+
//~| ERROR the trait bound `W<T>: Trait` is not satisfied
13+
//~| ERROR the trait bound `T: Trait` is not satisfied
14+
//~| ERROR not all trait items implemented, missing: `Assoc`
15+
16+
trait NoOverlap {}
17+
impl<T: Trait> NoOverlap for T {}
18+
impl<T: Trait<Assoc = u32>> NoOverlap for W<T> {}
19+
//~^ ERROR conflicting implementations of trait `NoOverlap` for type `W<W<W<W<_>>>>`
20+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
error[E0277]: the trait bound `W<W<T>>: Trait` is not satisfied
2+
--> $DIR/best-obligation-ICE.rs:10:19
3+
|
4+
LL | impl<T> Trait for W<W<W<T>>> {}
5+
| ^^^^^^^^^^ the trait `Trait` is not implemented for `W<W<T>>`
6+
|
7+
note: required by a bound in `W`
8+
--> $DIR/best-obligation-ICE.rs:9:13
9+
|
10+
LL | struct W<T: Trait>(*mut T);
11+
| ^^^^^ required by this bound in `W`
12+
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
13+
|
14+
LL | impl<T> Trait for W<W<W<T>>> where W<W<T>>: Trait {}
15+
| ++++++++++++++++++++
16+
17+
error[E0277]: the trait bound `W<T>: Trait` is not satisfied
18+
--> $DIR/best-obligation-ICE.rs:10:19
19+
|
20+
LL | impl<T> Trait for W<W<W<T>>> {}
21+
| ^^^^^^^^^^ the trait `Trait` is not implemented for `W<T>`
22+
|
23+
note: required by a bound in `W`
24+
--> $DIR/best-obligation-ICE.rs:9:13
25+
|
26+
LL | struct W<T: Trait>(*mut T);
27+
| ^^^^^ required by this bound in `W`
28+
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
29+
|
30+
LL | impl<T> Trait for W<W<W<T>>> where W<T>: Trait {}
31+
| +++++++++++++++++
32+
33+
error[E0277]: the trait bound `T: Trait` is not satisfied
34+
--> $DIR/best-obligation-ICE.rs:10:19
35+
|
36+
LL | impl<T> Trait for W<W<W<T>>> {}
37+
| ^^^^^^^^^^ the trait `Trait` is not implemented for `T`
38+
|
39+
note: required by a bound in `W`
40+
--> $DIR/best-obligation-ICE.rs:9:13
41+
|
42+
LL | struct W<T: Trait>(*mut T);
43+
| ^^^^^ required by this bound in `W`
44+
help: consider restricting type parameter `T`
45+
|
46+
LL | impl<T: Trait> Trait for W<W<W<T>>> {}
47+
| +++++++
48+
49+
error[E0046]: not all trait items implemented, missing: `Assoc`
50+
--> $DIR/best-obligation-ICE.rs:10:1
51+
|
52+
LL | type Assoc;
53+
| ---------- `Assoc` from trait
54+
...
55+
LL | impl<T> Trait for W<W<W<T>>> {}
56+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Assoc` in implementation
57+
58+
error[E0119]: conflicting implementations of trait `NoOverlap` for type `W<W<W<W<_>>>>`
59+
--> $DIR/best-obligation-ICE.rs:18:1
60+
|
61+
LL | impl<T: Trait> NoOverlap for T {}
62+
| ------------------------------ first implementation here
63+
LL | impl<T: Trait<Assoc = u32>> NoOverlap for W<T> {}
64+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `W<W<W<W<_>>>>`
65+
66+
error: aborting due to 5 previous errors
67+
68+
Some errors have detailed explanations: E0046, E0119, E0277.
69+
For more information about an error, try `rustc --explain E0046`.

0 commit comments

Comments
 (0)