Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Aug 21, 2022
1 parent 10e71df commit 911cbae
Showing 1 changed file with 30 additions and 0 deletions.
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!()
}

0 comments on commit 911cbae

Please sign in to comment.