diff options
Diffstat (limited to 'tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr')
-rw-r--r-- | tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr new file mode 100644 index 000000000..e10898f98 --- /dev/null +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr @@ -0,0 +1,26 @@ +error: changes to closure capture in Rust 2021 will affect which traits the closure implements + --> $DIR/mir_calls_to_shims.rs:20:38 + | +LL | let result = panic::catch_unwind(move || { + | ^^^^^^^ + | | + | in Rust 2018, this closure implements `RefUnwindSafe` as `f` implements `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `RefUnwindSafe` because `f` is not fully captured and `f.0` does not implement `RefUnwindSafe` + | in Rust 2018, this closure implements `UnwindSafe` as `f` implements `UnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe` because `f` is not fully captured and `f.0` does not implement `UnwindSafe` +... +LL | f.0() + | --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0` + | + = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> +note: the lint level is defined here + --> $DIR/mir_calls_to_shims.rs:4:9 + | +LL | #![deny(rust_2021_incompatible_closure_captures)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: add a dummy let to cause `f` to be fully captured + | +LL ~ let result = panic::catch_unwind(move || { +LL + let _ = &f; + | + +error: aborting due to previous error + |