Skip to content

Commit 7a96957

Browse files
committed
add test for rust-lang#113272
error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <() as Trait>::RefTarget, maybe try to call `try_normalize_erasing_regions` instead Fixes rust-lang#113272
1 parent 4911224 commit 7a96957

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// test for ICE #113272 Failed to normalize <() as Trait>::RefTarget ...
2+
3+
trait Trait {
4+
type RefTarget;
5+
}
6+
7+
impl Trait for () where Missing: Trait {}
8+
//~^ ERROR: cannot find type `Missing` in this scope
9+
//~^^ ERROR: not all trait items implemented, missing: `RefTarget`
10+
11+
struct Other {
12+
data: <() as Trait>::RefTarget,
13+
}
14+
15+
fn main() {
16+
unsafe {
17+
std::mem::transmute::<Option<()>, Option<&Other>>(None);
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0412]: cannot find type `Missing` in this scope
2+
--> $DIR/missing-bound-normalization-ice-113272.rs:7:25
3+
|
4+
LL | impl Trait for () where Missing: Trait {}
5+
| ^^^^^^^ not found in this scope
6+
7+
error[E0046]: not all trait items implemented, missing: `RefTarget`
8+
--> $DIR/missing-bound-normalization-ice-113272.rs:7:1
9+
|
10+
LL | type RefTarget;
11+
| -------------- `RefTarget` from trait
12+
...
13+
LL | impl Trait for () where Missing: Trait {}
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `RefTarget` in implementation
15+
16+
error: aborting due to 2 previous errors
17+
18+
Some errors have detailed explanations: E0046, E0412.
19+
For more information about an error, try `rustc --explain E0046`.

0 commit comments

Comments
 (0)