diff --git a/src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.rs b/src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.rs new file mode 100644 index 0000000000000..f67b073548167 --- /dev/null +++ b/src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.rs @@ -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 Trait for T { + type Associated = T; +} + +pub struct Struct(::Associated); + +pub fn foo() -> Struct +where + T: Trait, +{ + bar() +} + +#[inline] +fn bar() -> Struct { + Struct(baz()) +} + +fn baz() -> T { + unimplemented!() +}