Skip to content

Commit

Permalink
add test for #90192
Browse files Browse the repository at this point in the history
Fixes #90192
  • Loading branch information
matthiaskrgr committed Mar 24, 2024
1 parent 548e14b commit fc5085d
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 fc5085d

Please sign in to comment.