Skip to content

Commit f9b319f

Browse files
authored
Rollup merge of rust-lang#103341 - Rageking8:add-test-for-issue-97607, r=compiler-errors
Add test for issue 97607 Fixes rust-lang#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.
2 parents 9fcbde8 + 353ef69 commit f9b319f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/ui/closures/issue-97607.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// check-pass
2+
#[allow(unused)]
3+
4+
fn test<T, F, U>(f: F) -> Box<dyn Fn(T) -> U + 'static>
5+
where
6+
F: 'static + Fn(T) -> U,
7+
for<'a> U: 'a, // < This is the problematic line, see #97607
8+
{
9+
Box::new(move |t| f(t))
10+
}
11+
12+
fn main() {}

0 commit comments

Comments
 (0)