rust/tests/ui/closures/issue-97607.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
235 B
Rust
Raw Normal View History

2022-10-21 05:20:11 -05:00
//@ 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() {}