From 353ef694fbd95f65212752365241eb3cd9dab4aa Mon Sep 17 00:00:00 2001 From: Rageking8 Date: Fri, 21 Oct 2022 18:20:11 +0800 Subject: [PATCH] add test for issue 97607 --- src/test/ui/closures/issue-97607.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/test/ui/closures/issue-97607.rs diff --git a/src/test/ui/closures/issue-97607.rs b/src/test/ui/closures/issue-97607.rs new file mode 100644 index 0000000000000..74c910ad0bba6 --- /dev/null +++ b/src/test/ui/closures/issue-97607.rs @@ -0,0 +1,12 @@ +// check-pass +#[allow(unused)] + +fn test(f: F) -> Box 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() {}