summaryrefslogtreecommitdiffstats
path: root/tests/ui/span
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/ui/span
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/span')
-rw-r--r--tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr8
-rw-r--r--tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr2
-rw-r--r--tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr2
-rw-r--r--tests/ui/span/borrowck-fn-in-const-b.stderr2
-rw-r--r--tests/ui/span/borrowck-let-suggestion-suffixes.stderr2
-rw-r--r--tests/ui/span/borrowck-object-mutability.stderr4
-rw-r--r--tests/ui/span/destructor-restrictions.stderr2
-rw-r--r--tests/ui/span/issue-23338-locals-die-before-temps-of-body.stderr4
-rw-r--r--tests/ui/span/issue-36537.stderr2
-rw-r--r--tests/ui/span/issue-39698.stderr20
-rw-r--r--tests/ui/span/issue-40157.stderr2
-rw-r--r--tests/ui/span/mut-arg-hint.stderr6
-rw-r--r--tests/ui/span/mut-ptr-cant-outlive-ref.stderr2
-rw-r--r--tests/ui/span/regionck-unboxed-closure-lifetimes.stderr2
-rw-r--r--tests/ui/span/regions-escape-loop-via-vec.stderr10
-rw-r--r--tests/ui/span/send-is-not-static-std-sync.stderr10
-rw-r--r--tests/ui/span/slice-borrow.stderr2
-rw-r--r--tests/ui/span/suggestion-non-ascii.stderr4
-rw-r--r--tests/ui/span/visibility-ty-params.rs2
-rw-r--r--tests/ui/span/visibility-ty-params.stderr6
20 files changed, 48 insertions, 46 deletions
diff --git a/tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr b/tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr
index 80c5f9da4..4aad88437 100644
--- a/tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr
+++ b/tests/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr
@@ -66,7 +66,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:109:5
|
LL | x.set(0, 0);
- | ^^^^^^^^^^^ cannot borrow as mutable
+ | ^ cannot borrow as mutable
|
help: consider changing this to be mutable
|
@@ -77,7 +77,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:121:5
|
LL | x.y_mut()
- | ^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
@@ -88,7 +88,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:129:6
|
LL | *x.y_mut() = 3;
- | ^^^^^^^^^ cannot borrow as mutable
+ | ^ cannot borrow as mutable
|
help: consider changing this to be mutable
|
@@ -99,7 +99,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:133:6
|
LL | *x.y_mut() = 3;
- | ^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
diff --git a/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr b/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr
index 99c8fa1f9..ba8da2e75 100644
--- a/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr
+++ b/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr
@@ -25,7 +25,7 @@ error[E0596]: cannot borrow `f.f` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-call-is-borrow-issue-12224.rs:34:5
|
LL | f.f.call_mut(())
- | ^^^^^^^^^^^^^^^^ `f` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^^^ `f` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
diff --git a/tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr b/tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr
index 328197ae9..3f033f5e4 100644
--- a/tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr
+++ b/tests/ui/span/borrowck-call-method-from-mut-aliasable.stderr
@@ -2,7 +2,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-call-method-from-mut-aliasable.rs:17:5
|
LL | x.h();
- | ^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
diff --git a/tests/ui/span/borrowck-fn-in-const-b.stderr b/tests/ui/span/borrowck-fn-in-const-b.stderr
index 17fdcc622..929878026 100644
--- a/tests/ui/span/borrowck-fn-in-const-b.stderr
+++ b/tests/ui/span/borrowck-fn-in-const-b.stderr
@@ -2,7 +2,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-fn-in-const-b.rs:7:9
|
LL | x.push(format!("this is broken"));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
diff --git a/tests/ui/span/borrowck-let-suggestion-suffixes.stderr b/tests/ui/span/borrowck-let-suggestion-suffixes.stderr
index 545b235a5..78cadc8c6 100644
--- a/tests/ui/span/borrowck-let-suggestion-suffixes.stderr
+++ b/tests/ui/span/borrowck-let-suggestion-suffixes.stderr
@@ -39,7 +39,7 @@ LL | v4.push(&id('y'));
| creates a temporary value which is freed while still in use
...
LL | v4.use_ref();
- | ------------ borrow later used here
+ | -- borrow later used here
|
= note: consider using a `let` binding to create a longer lived value
diff --git a/tests/ui/span/borrowck-object-mutability.stderr b/tests/ui/span/borrowck-object-mutability.stderr
index 805a8034c..e4b5c8ce7 100644
--- a/tests/ui/span/borrowck-object-mutability.stderr
+++ b/tests/ui/span/borrowck-object-mutability.stderr
@@ -2,7 +2,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference
--> $DIR/borrowck-object-mutability.rs:8:5
|
LL | x.borrowed_mut();
- | ^^^^^^^^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
@@ -13,7 +13,7 @@ error[E0596]: cannot borrow `*x` as mutable, as `x` is not declared as mutable
--> $DIR/borrowck-object-mutability.rs:18:5
|
LL | x.borrowed_mut();
- | ^^^^^^^^^^^^^^^^ cannot borrow as mutable
+ | ^ cannot borrow as mutable
|
help: consider changing this to be mutable
|
diff --git a/tests/ui/span/destructor-restrictions.stderr b/tests/ui/span/destructor-restrictions.stderr
index 281248626..b923cee5f 100644
--- a/tests/ui/span/destructor-restrictions.stderr
+++ b/tests/ui/span/destructor-restrictions.stderr
@@ -4,7 +4,7 @@ error[E0597]: `*a` does not live long enough
LL | let a = Box::new(RefCell::new(4));
| - binding `a` declared here
LL | *a.borrow() + 1
- | ^^^^^^^^^^
+ | ^---------
| |
| borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
diff --git a/tests/ui/span/issue-23338-locals-die-before-temps-of-body.stderr b/tests/ui/span/issue-23338-locals-die-before-temps-of-body.stderr
index e1a377203..421c22566 100644
--- a/tests/ui/span/issue-23338-locals-die-before-temps-of-body.stderr
+++ b/tests/ui/span/issue-23338-locals-die-before-temps-of-body.stderr
@@ -4,7 +4,7 @@ error[E0597]: `y` does not live long enough
LL | let y = x;
| - binding `y` declared here
LL | y.borrow().clone()
- | ^^^^^^^^^^
+ | ^---------
| |
| borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
@@ -27,7 +27,7 @@ error[E0597]: `y` does not live long enough
LL | let y = x;
| - binding `y` declared here
LL | y.borrow().clone()
- | ^^^^^^^^^^
+ | ^---------
| |
| borrowed value does not live long enough
| a temporary with access to the borrow is created here ...
diff --git a/tests/ui/span/issue-36537.stderr b/tests/ui/span/issue-36537.stderr
index 6c330c1a0..8dfee8d64 100644
--- a/tests/ui/span/issue-36537.stderr
+++ b/tests/ui/span/issue-36537.stderr
@@ -9,7 +9,7 @@ LL | p = &a;
LL | }
| - `a` dropped here while still borrowed
LL | p.use_ref();
- | ----------- borrow later used here
+ | - borrow later used here
error: aborting due to previous error
diff --git a/tests/ui/span/issue-39698.stderr b/tests/ui/span/issue-39698.stderr
index 25c35fd54..81211b20a 100644
--- a/tests/ui/span/issue-39698.stderr
+++ b/tests/ui/span/issue-39698.stderr
@@ -1,3 +1,13 @@
+error[E0408]: variable `c` is not bound in all patterns
+ --> $DIR/issue-39698.rs:10:9
+ |
+LL | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
+ | ^^^^^^^^^^^ ^^^^^^^^^^^ - ^^^^^^^^ pattern doesn't bind `c`
+ | | | |
+ | | | variable not in all patterns
+ | | pattern doesn't bind `c`
+ | pattern doesn't bind `c`
+
error[E0408]: variable `d` is not bound in all patterns
--> $DIR/issue-39698.rs:10:37
|
@@ -28,16 +38,6 @@ LL | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}
| | variable not in all patterns
| pattern doesn't bind `b`
-error[E0408]: variable `c` is not bound in all patterns
- --> $DIR/issue-39698.rs:10:9
- |
-LL | T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
- | ^^^^^^^^^^^ ^^^^^^^^^^^ - ^^^^^^^^ pattern doesn't bind `c`
- | | | |
- | | | variable not in all patterns
- | | pattern doesn't bind `c`
- | pattern doesn't bind `c`
-
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0408`.
diff --git a/tests/ui/span/issue-40157.stderr b/tests/ui/span/issue-40157.stderr
index a0afd33f7..216876717 100644
--- a/tests/ui/span/issue-40157.stderr
+++ b/tests/ui/span/issue-40157.stderr
@@ -2,7 +2,7 @@ error[E0597]: `foo` does not live long enough
--> $DIR/issue-40157.rs:2:53
|
LL | {println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });}
- | --- ^^^^^^^^^^ - `foo` dropped here while still borrowed
+ | --- ^^^ - `foo` dropped here while still borrowed
| | |
| | borrowed value does not live long enough
| binding `foo` declared here
diff --git a/tests/ui/span/mut-arg-hint.stderr b/tests/ui/span/mut-arg-hint.stderr
index 06011eac6..df782280b 100644
--- a/tests/ui/span/mut-arg-hint.stderr
+++ b/tests/ui/span/mut-arg-hint.stderr
@@ -2,7 +2,7 @@ error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
--> $DIR/mut-arg-hint.rs:3:9
|
LL | a.push_str("bar");
- | ^^^^^^^^^^^^^^^^^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
@@ -13,7 +13,7 @@ error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
--> $DIR/mut-arg-hint.rs:8:5
|
LL | a.push_str("foo");
- | ^^^^^^^^^^^^^^^^^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
@@ -24,7 +24,7 @@ error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
--> $DIR/mut-arg-hint.rs:15:9
|
LL | a.push_str("foo");
- | ^^^^^^^^^^^^^^^^^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+ | ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable
|
help: consider changing this to be a mutable reference
|
diff --git a/tests/ui/span/mut-ptr-cant-outlive-ref.stderr b/tests/ui/span/mut-ptr-cant-outlive-ref.stderr
index be56f9489..395b6ec67 100644
--- a/tests/ui/span/mut-ptr-cant-outlive-ref.stderr
+++ b/tests/ui/span/mut-ptr-cant-outlive-ref.stderr
@@ -9,7 +9,7 @@ LL | }
| - `b` dropped here while still borrowed
LL |
LL | p.use_ref();
- | ----------- borrow later used here
+ | - borrow later used here
error: aborting due to previous error
diff --git a/tests/ui/span/regionck-unboxed-closure-lifetimes.stderr b/tests/ui/span/regionck-unboxed-closure-lifetimes.stderr
index fb3fad6ae..9b5ec8461 100644
--- a/tests/ui/span/regionck-unboxed-closure-lifetimes.stderr
+++ b/tests/ui/span/regionck-unboxed-closure-lifetimes.stderr
@@ -9,7 +9,7 @@ LL | let c_ref = &c;
LL | }
| - `c` dropped here while still borrowed
LL | f.use_mut();
- | ----------- borrow later used here
+ | - borrow later used here
error: aborting due to previous error
diff --git a/tests/ui/span/regions-escape-loop-via-vec.stderr b/tests/ui/span/regions-escape-loop-via-vec.stderr
index 532ac3606..18c6cd480 100644
--- a/tests/ui/span/regions-escape-loop-via-vec.stderr
+++ b/tests/ui/span/regions-escape-loop-via-vec.stderr
@@ -7,7 +7,7 @@ LL | while x < 10 {
| ^ use of borrowed `x`
LL | let mut z = x;
LL | _y.push(&mut z);
- | --------------- borrow later used here
+ | -- borrow later used here
error[E0503]: cannot use `x` because it was mutably borrowed
--> $DIR/regions-escape-loop-via-vec.rs:6:21
@@ -18,7 +18,7 @@ LL | while x < 10 {
LL | let mut z = x;
| ^ use of borrowed `x`
LL | _y.push(&mut z);
- | --------------- borrow later used here
+ | -- borrow later used here
error[E0597]: `z` does not live long enough
--> $DIR/regions-escape-loop-via-vec.rs:7:17
@@ -26,7 +26,9 @@ error[E0597]: `z` does not live long enough
LL | let mut z = x;
| ----- binding `z` declared here
LL | _y.push(&mut z);
- | ^^^^^^ borrowed value does not live long enough
+ | -- ^^^^^^ borrowed value does not live long enough
+ | |
+ | borrow later used here
...
LL | }
| - `z` dropped here while still borrowed
@@ -38,7 +40,7 @@ LL | let mut _y = vec![&mut x];
| ------ `x` is borrowed here
...
LL | _y.push(&mut z);
- | --------------- borrow later used here
+ | -- borrow later used here
LL |
LL | x += 1;
| ^^^^^^ use of borrowed `x`
diff --git a/tests/ui/span/send-is-not-static-std-sync.stderr b/tests/ui/span/send-is-not-static-std-sync.stderr
index 7dfe94bca..eaba415ad 100644
--- a/tests/ui/span/send-is-not-static-std-sync.stderr
+++ b/tests/ui/span/send-is-not-static-std-sync.stderr
@@ -10,7 +10,7 @@ LL | drop(y);
| ^ move out of `y` occurs here
...
LL | *lock.lock().unwrap() = &z;
- | ----------- borrow later used here
+ | ---- borrow later used here
error[E0597]: `z` does not live long enough
--> $DIR/send-is-not-static-std-sync.rs:16:33
@@ -23,7 +23,7 @@ LL | }
| - `z` dropped here while still borrowed
LL |
LL | lock.use_ref(); // (Mutex is #[may_dangle] so its dtor does not use `z` => needs explicit use)
- | -------------- borrow later used here
+ | ---- borrow later used here
error[E0505]: cannot move out of `y` because it is borrowed
--> $DIR/send-is-not-static-std-sync.rs:27:10
@@ -37,7 +37,7 @@ LL | drop(y);
| ^ move out of `y` occurs here
...
LL | *lock.write().unwrap() = &z;
- | ------------ borrow later used here
+ | ---- borrow later used here
error[E0597]: `z` does not live long enough
--> $DIR/send-is-not-static-std-sync.rs:30:34
@@ -50,7 +50,7 @@ LL | }
| - `z` dropped here while still borrowed
LL |
LL | lock.use_ref(); // (RwLock is #[may_dangle] so its dtor does not use `z` => needs explicit use)
- | -------------- borrow later used here
+ | ---- borrow later used here
error[E0505]: cannot move out of `y` because it is borrowed
--> $DIR/send-is-not-static-std-sync.rs:43:10
@@ -64,7 +64,7 @@ LL | drop(y);
| ^ move out of `y` occurs here
...
LL | tx.send(&z).unwrap();
- | ----------- borrow later used here
+ | -- borrow later used here
error[E0597]: `z` does not live long enough
--> $DIR/send-is-not-static-std-sync.rs:46:17
diff --git a/tests/ui/span/slice-borrow.stderr b/tests/ui/span/slice-borrow.stderr
index b70bf69d6..b271c9ae6 100644
--- a/tests/ui/span/slice-borrow.stderr
+++ b/tests/ui/span/slice-borrow.stderr
@@ -7,7 +7,7 @@ LL | let x: &[isize] = &vec![1, 2, 3, 4, 5];
LL | }
| - temporary value is freed at the end of this statement
LL | y.use_ref();
- | ----------- borrow later used here
+ | - borrow later used here
|
= note: consider using a `let` binding to create a longer lived value
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/tests/ui/span/suggestion-non-ascii.stderr b/tests/ui/span/suggestion-non-ascii.stderr
index b14632d4e..21f8bb62a 100644
--- a/tests/ui/span/suggestion-non-ascii.stderr
+++ b/tests/ui/span/suggestion-non-ascii.stderr
@@ -1,8 +1,8 @@
error[E0608]: cannot index into a value of type `({integer},)`
- --> $DIR/suggestion-non-ascii.rs:3:21
+ --> $DIR/suggestion-non-ascii.rs:3:24
|
LL | println!("☃{}", tup[0]);
- | ^^^^^^ help: to access tuple elements, use: `tup.0`
+ | ^^^ help: to access tuple elements, use: `.0`
error: aborting due to previous error
diff --git a/tests/ui/span/visibility-ty-params.rs b/tests/ui/span/visibility-ty-params.rs
index d77febe0a..11c2cf44c 100644
--- a/tests/ui/span/visibility-ty-params.rs
+++ b/tests/ui/span/visibility-ty-params.rs
@@ -4,7 +4,7 @@ macro_rules! m {
struct S<T>(T);
m!{ S<u8> } //~ ERROR unexpected generic arguments in path
- //~| ERROR expected module, found struct `S`
+ //~| ERROR failed to resolve: `S` is a struct, not a module [E0433]
mod m {
m!{ m<> } //~ ERROR unexpected generic arguments in path
diff --git a/tests/ui/span/visibility-ty-params.stderr b/tests/ui/span/visibility-ty-params.stderr
index 067893fd2..97d05c464 100644
--- a/tests/ui/span/visibility-ty-params.stderr
+++ b/tests/ui/span/visibility-ty-params.stderr
@@ -4,11 +4,11 @@ error: unexpected generic arguments in path
LL | m!{ S<u8> }
| ^^^^
-error[E0577]: expected module, found struct `S`
+error[E0433]: failed to resolve: `S` is a struct, not a module
--> $DIR/visibility-ty-params.rs:6:5
|
LL | m!{ S<u8> }
- | ^^^^^ not a module
+ | ^ `S` is a struct, not a module
error: unexpected generic arguments in path
--> $DIR/visibility-ty-params.rs:10:10
@@ -18,4 +18,4 @@ LL | m!{ m<> }
error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0577`.
+For more information about this error, try `rustc --explain E0433`.