summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/user-annotations/cast_static_lifetime.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/nll/user-annotations/cast_static_lifetime.stderr')
-rw-r--r--tests/ui/nll/user-annotations/cast_static_lifetime.stderr14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/nll/user-annotations/cast_static_lifetime.stderr b/tests/ui/nll/user-annotations/cast_static_lifetime.stderr
new file mode 100644
index 000000000..4599d04e7
--- /dev/null
+++ b/tests/ui/nll/user-annotations/cast_static_lifetime.stderr
@@ -0,0 +1,14 @@
+error[E0597]: `x` does not live long enough
+ --> $DIR/cast_static_lifetime.rs:5:19
+ |
+LL | let y: &u32 = (&x) as &'static u32;
+ | ^^^^----------------
+ | |
+ | borrowed value does not live long enough
+ | type annotation requires that `x` is borrowed for `'static`
+LL | }
+ | - `x` dropped here while still borrowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.