Skip to content

Commit

Permalink
tests: add regression test for #74614
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
davidtwco committed Jul 22, 2020
1 parent f39ed20 commit 799d52e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/ui/issues/issue-74614.rs
@@ -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>();
}

0 comments on commit 799d52e

Please sign in to comment.