summaryrefslogtreecommitdiffstats
path: root/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr')
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
new file mode 100644
index 000000000..2648b0043
--- /dev/null
+++ b/src/test/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:21: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: the lint level is defined here
+ --> $DIR/mir_calls_to_shims.rs:4:9
+ |
+LL | #![deny(rust_2021_incompatible_closure_captures)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
+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
+