tests: add regression test for #74614

This commit adds a regression test for #74614 so that it is fixed before
polymorphisation is re-enabled.

Signed-off-by: David Wood <david@davidtw.co>
This commit is contained in:
David Wood 2020-07-22 15:35:52 +01:00
parent f39ed207fe
commit 799d52eff7
No known key found for this signature in database
GPG key ID: 2592E76C87381FD9

View file

@ -0,0 +1,17 @@
// 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>();
}