Skip to content

Commit

Permalink
Rollup merge of rust-lang#122886 - matthiaskrgr:issue90192, r=fee1-dead
Browse files Browse the repository at this point in the history
add test for rust-lang#90192

Fixes rust-lang#90192
  • Loading branch information
matthiaskrgr committed Mar 24, 2024
2 parents d1dc4be + fc5085d commit ed3e660
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/ui/polymorphization/ice-poly-with-mir-opts-90192.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// issue: rust-lang/rust#90192
// ICE assertion failed: matches!(ty.kind(), ty :: Param(_))
//@ compile-flags:-Zpolymorphize=on -Zmir-opt-level=3
//@ build-pass

fn test<T>() {
std::mem::size_of::<T>();
}

pub fn foo<T>(_: T) -> &'static fn() {
&(test::<T> as fn())
}

fn outer<T>() {
foo(|| ());
}

fn main() {
outer::<u8>();
}

0 comments on commit ed3e660

Please sign in to comment.