Rollup merge of #122886 - matthiaskrgr:issue90192, r=fee1-dead

add test for #90192

Fixes #90192
This commit is contained in:
Matthias Krüger 2024-03-24 17:08:16 +01:00 committed by GitHub
commit 702261dce6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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>();
}