diff options
Diffstat (limited to 'src/test/ui/mir/mir-inlining')
-rw-r--r-- | src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.rs | 30 |
1 files changed, 30 insertions, 0 deletions
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 000000000..f67b07354 --- /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<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!() +} |