From f5e8a7d3982ab6d3a1ec0eeea489bc898073787c Mon Sep 17 00:00:00 2001 From: Roxane Date: Sat, 3 Jul 2021 14:39:10 -0400 Subject: [PATCH] Add new test case --- .../migrations/unpin_no_migration.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/test/ui/closures/2229_closure_analysis/migrations/unpin_no_migration.rs diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/unpin_no_migration.rs b/src/test/ui/closures/2229_closure_analysis/migrations/unpin_no_migration.rs new file mode 100644 index 00000000000..e39adf4e294 --- /dev/null +++ b/src/test/ui/closures/2229_closure_analysis/migrations/unpin_no_migration.rs @@ -0,0 +1,13 @@ +//run-pass +#![deny(disjoint_capture_migration)] +#![allow(unused_must_use)] + +fn filter_try_fold( + predicate: &mut impl FnMut() -> bool, +) -> impl FnMut() -> bool + '_ { + move || predicate() +} + +fn main() { + filter_try_fold(&mut || true); +}