forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.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,30 @@ | ||
// This test verifies that we do not ICE due to MIR inlining in case of normalization failure | ||
// in a projection. | ||
// | ||
// compile-flags: --crate-type lib -C opt-level=3 | ||
// build-pass | ||
|
||
pub trait Trait { | ||
type Associated; | ||
} | ||
impl<T> Trait for T { | ||
type Associated = T; | ||
} | ||
|
||
pub struct Struct<T>(<T as Trait>::Associated); | ||
|
||
pub fn foo<T>() -> Struct<T> | ||
where | ||
T: Trait, | ||
{ | ||
bar() | ||
} | ||
|
||
#[inline] | ||
fn bar<T>() -> Struct<T> { | ||
Struct(baz()) | ||
} | ||
|
||
fn baz<T>() -> T { | ||
unimplemented!() | ||
} |