-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…nikomatsakis Account for capture kind in auto traits migration Modifies the current auto traits migration for RFC2229 so it takes into account capture kind Closes rust-lang/project-rfc-2229#51 r? `@nikomatsakis`
- Loading branch information
Showing
2 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/test/ui/closures/2229_closure_analysis/migrations/unpin_no_migration.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//run-pass | ||
#![deny(rust_2021_incompatible_closure_captures)] | ||
#![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); | ||
} |