Skip to content

Commit 0e8f1d2

Browse files
committed
Add multistep-coercion regression test
1 parent 82dd3cb commit 0e8f1d2

3 files changed

Lines changed: 1016 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
error[E0277]: the trait bound `TopTypeNoTrait: Dynable` is not satisfied
2+
--> $DIR/multistep.rs:479:14
3+
|
4+
LL | 1 => &TopTypeNoTrait as &FinalType as &dyn Dynable,
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
6+
|
7+
help: the trait `Dynable` is not implemented for `TopTypeNoTrait`
8+
--> $DIR/multistep.rs:76:1
9+
|
10+
LL | struct TopTypeNoTrait;
11+
| ^^^^^^^^^^^^^^^^^^^^^
12+
help: the following other types implement trait `Dynable`
13+
--> $DIR/multistep.rs:41:1
14+
|
15+
LL | impl Dynable for Inner {}
16+
| ^^^^^^^^^^^^^^^^^^^^^^ `Inner`
17+
...
18+
LL | impl Dynable for FinalType {}
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `FinalType`
20+
= note: required for the cast from `&TopTypeNoTrait` to `&dyn Dynable`
21+
22+
error[E0308]: `match` arms have incompatible types
23+
--> $DIR/multistep.rs:489:14
24+
|
25+
LL | / match 0 {
26+
LL | | 0 => &A as &A,
27+
| | ----------------- this is found to be of type `&B`
28+
LL | | 1 => &B as &B,
29+
| | ----------------- this is found to be of type `&B`
30+
LL | | 2 => &C as &C,
31+
| | ^^^^^^^^^^^^^^^^^ expected `&B`, found `&C`
32+
LL | | 3 => &D as &D,
33+
LL | | _ => loop {},
34+
LL | | };
35+
| |_____- `match` arms have incompatible types
36+
|
37+
= note: expected reference `&B`
38+
found reference `&C`
39+
40+
error[E0055]: reached the recursion limit while auto-dereferencing `P`
41+
--> $DIR/multistep.rs:623:14
42+
|
43+
LL | 1 => &P as &P,
44+
| ^^^^^^^^^^^^^ deref recursion limit reached
45+
|
46+
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`multistep`)
47+
48+
error: aborting due to 3 previous errors
49+
50+
Some errors have detailed explanations: E0055, E0277, E0308.
51+
For more information about an error, try `rustc --explain E0055`.

0 commit comments

Comments
 (0)