summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/trait-object-lifetime-default-note.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/trait-object-lifetime-default-note.stderr')
-rw-r--r--tests/ui/traits/trait-object-lifetime-default-note.stderr19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/traits/trait-object-lifetime-default-note.stderr b/tests/ui/traits/trait-object-lifetime-default-note.stderr
new file mode 100644
index 000000000..4244e3487
--- /dev/null
+++ b/tests/ui/traits/trait-object-lifetime-default-note.stderr
@@ -0,0 +1,19 @@
+error[E0597]: `local` does not live long enough
+ --> $DIR/trait-object-lifetime-default-note.rs:7:13
+ |
+LL | let local = 0;
+ | ----- binding `local` declared here
+LL | let r = &local;
+ | ^^^^^^ borrowed value does not live long enough
+...
+LL | require_box(Box::new(r));
+ | ----------- cast requires that `local` is borrowed for `'static`
+...
+LL | }
+ | - `local` dropped here while still borrowed
+ |
+ = note: due to object lifetime defaults, `Box<dyn A>` actually means `Box<(dyn A + 'static)>`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0597`.