diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs b/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs new file mode 100644 index 000000000..2ed50d709 --- /dev/null +++ b/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs @@ -0,0 +1,39 @@ +// check-pass + +// compile-flags: --emit=mir,link -O + +// There is an ICE somewhere in type normalization, and we are hitting it during +// the MIR inlining pass on this code. +// +// Long term, we should fix that ICE and change the compile-flags for this test +// to explicitly enable MIR inlining. +// +// Short term, we are diabling MIR inlining for Rust 1.64-beta, so that we avoid +// this ICE in this instance. + +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!() +} + +fn main() { } |