summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dst/dst-bad-coerce3.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/dst/dst-bad-coerce3.stderr')
-rw-r--r--src/test/ui/dst/dst-bad-coerce3.stderr58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/test/ui/dst/dst-bad-coerce3.stderr b/src/test/ui/dst/dst-bad-coerce3.stderr
new file mode 100644
index 000000000..957e98bbe
--- /dev/null
+++ b/src/test/ui/dst/dst-bad-coerce3.stderr
@@ -0,0 +1,58 @@
+error[E0597]: `f1` does not live long enough
+ --> $DIR/dst-bad-coerce3.rs:16:32
+ |
+LL | fn baz<'a>() {
+ | -- lifetime `'a` defined here
+...
+LL | let f2: &Fat<[isize; 3]> = &f1;
+ | ^^^ borrowed value does not live long enough
+LL | let f3: &'a Fat<[isize]> = f2;
+ | ---------------- type annotation requires that `f1` is borrowed for `'a`
+...
+LL | }
+ | - `f1` dropped here while still borrowed
+
+error[E0597]: `f1` does not live long enough
+ --> $DIR/dst-bad-coerce3.rs:21:25
+ |
+LL | fn baz<'a>() {
+ | -- lifetime `'a` defined here
+...
+LL | let f2: &Fat<Foo> = &f1;
+ | ^^^ borrowed value does not live long enough
+LL | let f3: &'a Fat<dyn Bar> = f2;
+ | ---------------- type annotation requires that `f1` is borrowed for `'a`
+...
+LL | }
+ | - `f1` dropped here while still borrowed
+
+error[E0597]: `f1` does not live long enough
+ --> $DIR/dst-bad-coerce3.rs:26:30
+ |
+LL | fn baz<'a>() {
+ | -- lifetime `'a` defined here
+...
+LL | let f2: &([isize; 3],) = &f1;
+ | ^^^ borrowed value does not live long enough
+LL | let f3: &'a ([isize],) = f2;
+ | -------------- type annotation requires that `f1` is borrowed for `'a`
+...
+LL | }
+ | - `f1` dropped here while still borrowed
+
+error[E0597]: `f1` does not live long enough
+ --> $DIR/dst-bad-coerce3.rs:31:23
+ |
+LL | fn baz<'a>() {
+ | -- lifetime `'a` defined here
+...
+LL | let f2: &(Foo,) = &f1;
+ | ^^^ borrowed value does not live long enough
+LL | let f3: &'a (dyn Bar,) = f2;
+ | -------------- type annotation requires that `f1` is borrowed for `'a`
+LL | }
+ | - `f1` dropped here while still borrowed
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0597`.