diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/closures/issue-113087.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/closures/issue-113087.rs b/tests/ui/closures/issue-113087.rs new file mode 100644 index 000000000..a4edc2f2f --- /dev/null +++ b/tests/ui/closures/issue-113087.rs @@ -0,0 +1,11 @@ +fn some_fn<'a>(_: &'a i32, _: impl FnOnce(&'a i32)) {} + +fn main() { + let some_closure = |_| {}; + + for a in [1] { + some_fn(&a, |c| { //~ ERROR does not live long enough + some_closure(c); + }); + } +} |