mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 03:25:55 +00:00
17 lines
218 B
Rust
17 lines
218 B
Rust
|
//@ compile-flags:-Zpolymorphize=on
|
||
|
//@ build-pass
|
||
|
|
||
|
use std::any::TypeId;
|
||
|
|
||
|
pub fn foo<T: 'static>(_: T) -> TypeId {
|
||
|
TypeId::of::<T>()
|
||
|
}
|
||
|
|
||
|
fn outer<T: 'static>() {
|
||
|
foo(|| ());
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
outer::<u8>();
|
||
|
}
|