summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes/lifetime-errors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
commit023939b627b7dc93b01471f7d41fb8553ddb4ffa (patch)
tree60fc59477c605c72b0a1051409062ddecc43f877 /tests/ui/lifetimes/lifetime-errors
parentAdding debian version 1.72.1+dfsg1-1. (diff)
downloadrustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.tar.xz
rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/lifetimes/lifetime-errors')
-rw-r--r--tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr22
-rw-r--r--tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr22
2 files changed, 22 insertions, 22 deletions
diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr
index cc2447b18..cb629d2e3 100644
--- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr
+++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr
@@ -1,3 +1,14 @@
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+ --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3
+ |
+LL | y.push(z);
+ | ^ cannot borrow as mutable
+ |
+help: consider changing this to be mutable
+ |
+LL | fn foo(x:fn(&u8, &u8), mut y: Vec<&u8>, z: &u8) {
+ | +++
+
error: lifetime may not live long enough
--> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3
|
@@ -13,17 +24,6 @@ help: consider introducing a named lifetime parameter
LL | fn foo<'a>(x:fn(&u8, &u8), y: Vec<&'a u8>, z: &'a u8) {
| ++++ ++ ++
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
- --> $DIR/ex3-both-anon-regions-using-fn-items.rs:2:3
- |
-LL | y.push(z);
- | ^^^^^^^^^ cannot borrow as mutable
- |
-help: consider changing this to be mutable
- |
-LL | fn foo(x:fn(&u8, &u8), mut y: Vec<&u8>, z: &u8) {
- | +++
-
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0596`.
diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr
index 2ba5afa80..05f930812 100644
--- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr
+++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr
@@ -1,3 +1,14 @@
+error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
+ --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:2:3
+ |
+LL | y.push(z);
+ | ^ cannot borrow as mutable
+ |
+help: consider changing this to be mutable
+ |
+LL | fn foo(x:Box<dyn Fn(&u8, &u8)> , mut y: Vec<&u8>, z: &u8) {
+ | +++
+
error: lifetime may not live long enough
--> $DIR/ex3-both-anon-regions-using-trait-objects.rs:2:3
|
@@ -13,17 +24,6 @@ help: consider introducing a named lifetime parameter
LL | fn foo<'a>(x:Box<dyn Fn(&u8, &u8)> , y: Vec<&'a u8>, z: &'a u8) {
| ++++ ++ ++
-error[E0596]: cannot borrow `y` as mutable, as it is not declared as mutable
- --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:2:3
- |
-LL | y.push(z);
- | ^^^^^^^^^ cannot borrow as mutable
- |
-help: consider changing this to be mutable
- |
-LL | fn foo(x:Box<dyn Fn(&u8, &u8)> , mut y: Vec<&u8>, z: &u8) {
- | +++
-
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0596`.