mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
21 lines
345 B
Rust
21 lines
345 B
Rust
|
// 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>();
|
||
|
}
|