Rollup merge of #103341 - Rageking8:add-test-for-issue-97607, r=compiler-errors

Add test for issue 97607

Fixes #97607

r? ``@compiler-errors``

Not sure which UI test dir to put this under, kindly let me know of a better dir if necessary and I will change it. Thanks.
This commit is contained in:
Matthias Krüger 2022-10-22 00:14:01 +02:00 committed by GitHub
commit db4696a546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,12 @@
// check-pass
#[allow(unused)]
fn test<T, F, U>(f: F) -> Box<dyn Fn(T) -> U + 'static>
where
F: 'static + Fn(T) -> U,
for<'a> U: 'a, // < This is the problematic line, see #97607
{
Box::new(move |t| f(t))
}
fn main() {}