diff options
Diffstat (limited to 'tests/ui/polymorphization/issue-74636.rs')
-rw-r--r-- | tests/ui/polymorphization/issue-74636.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/polymorphization/issue-74636.rs b/tests/ui/polymorphization/issue-74636.rs new file mode 100644 index 000000000..4c532f451 --- /dev/null +++ b/tests/ui/polymorphization/issue-74636.rs @@ -0,0 +1,16 @@ +// 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>(); +} |