diff options
| author | Rageking8 <tomleetyt@gmail.com> | 2022-10-21 18:20:11 +0800 |
|---|---|---|
| committer | Rageking8 <tomleetyt@gmail.com> | 2022-10-21 18:42:31 +0800 |
| commit | 353ef694fbd95f65212752365241eb3cd9dab4aa (patch) | |
| tree | 2682564485049050bd5cfdb40d176971f14092e3 | |
| parent | b1ab3b738ac718da74cd4aa0bb7f362d0adbdf84 (diff) | |
| download | rust-353ef694fbd95f65212752365241eb3cd9dab4aa.tar.gz rust-353ef694fbd95f65212752365241eb3cd9dab4aa.zip | |
add test for issue 97607
| -rw-r--r-- | src/test/ui/closures/issue-97607.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/closures/issue-97607.rs b/src/test/ui/closures/issue-97607.rs new file mode 100644 index 00000000000..74c910ad0bb --- /dev/null +++ b/src/test/ui/closures/issue-97607.rs @@ -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() {} |
