forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
4911224
commit 7a96957
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
tests/ui/transmute/missing-bound-normalization-ice-113272.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// test for ICE #113272 Failed to normalize <() as Trait>::RefTarget ... | ||
|
||
trait Trait { | ||
type RefTarget; | ||
} | ||
|
||
impl Trait for () where Missing: Trait {} | ||
//~^ ERROR: cannot find type `Missing` in this scope | ||
//~^^ ERROR: not all trait items implemented, missing: `RefTarget` | ||
|
||
struct Other { | ||
data: <() as Trait>::RefTarget, | ||
} | ||
|
||
fn main() { | ||
unsafe { | ||
std::mem::transmute::<Option<()>, Option<&Other>>(None); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/ui/transmute/missing-bound-normalization-ice-113272.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0412]: cannot find type `Missing` in this scope | ||
--> $DIR/missing-bound-normalization-ice-113272.rs:7:25 | ||
| | ||
LL | impl Trait for () where Missing: Trait {} | ||
| ^^^^^^^ not found in this scope | ||
|
||
error[E0046]: not all trait items implemented, missing: `RefTarget` | ||
--> $DIR/missing-bound-normalization-ice-113272.rs:7:1 | ||
| | ||
LL | type RefTarget; | ||
| -------------- `RefTarget` from trait | ||
... | ||
LL | impl Trait for () where Missing: Trait {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `RefTarget` in implementation | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0046, E0412. | ||
For more information about an error, try `rustc --explain E0046`. |