diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-01-25 22:19:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-25 22:19:52 +0100 |
| commit | 9e3f3306567f62086dcbb7f6a71f0a0c07db0de2 (patch) | |
| tree | a3aec2fc3767c3bea32e56599b6c4922cfa88922 /tests/ui/error-codes | |
| parent | f21728fee4eb11ec7e73801bc60e78dbb08bf71a (diff) | |
| parent | 7b8251e1886924dde68ff9b6a1c02e9973d0bd0a (diff) | |
| download | rust-9e3f3306567f62086dcbb7f6a71f0a0c07db0de2.tar.gz rust-9e3f3306567f62086dcbb7f6a71f0a0c07db0de2.zip | |
Rollup merge of #106897 - estebank:issue-99430, r=davidtwco
Tweak E0597 CC #99430
Diffstat (limited to 'tests/ui/error-codes')
| -rw-r--r-- | tests/ui/error-codes/E0503.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0504.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0505.stderr | 3 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0506.stderr | 4 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0597.stderr | 2 |
5 files changed, 10 insertions, 3 deletions
diff --git a/tests/ui/error-codes/E0503.stderr b/tests/ui/error-codes/E0503.stderr index fafe363eb47..2f02e3b1a61 100644 --- a/tests/ui/error-codes/E0503.stderr +++ b/tests/ui/error-codes/E0503.stderr @@ -2,7 +2,7 @@ error[E0503]: cannot use `value` because it was mutably borrowed --> $DIR/E0503.rs:4:16 | LL | let _borrow = &mut value; - | ---------- borrow of `value` occurs here + | ---------- `value` is borrowed here LL | let _sum = value + 1; | ^^^^^ use of borrowed `value` LL | _borrow.use_mut(); diff --git a/tests/ui/error-codes/E0504.stderr b/tests/ui/error-codes/E0504.stderr index e677e891615..20e16a53810 100644 --- a/tests/ui/error-codes/E0504.stderr +++ b/tests/ui/error-codes/E0504.stderr @@ -1,6 +1,8 @@ error[E0505]: cannot move out of `fancy_num` because it is borrowed --> $DIR/E0504.rs:9:13 | +LL | let fancy_num = FancyNum { num: 5 }; + | --------- binding `fancy_num` declared here LL | let fancy_ref = &fancy_num; | ---------- borrow of `fancy_num` occurs here LL | diff --git a/tests/ui/error-codes/E0505.stderr b/tests/ui/error-codes/E0505.stderr index bd3f37f54e0..2ecb4a75c43 100644 --- a/tests/ui/error-codes/E0505.stderr +++ b/tests/ui/error-codes/E0505.stderr @@ -1,6 +1,9 @@ error[E0505]: cannot move out of `x` because it is borrowed --> $DIR/E0505.rs:9:13 | +LL | let x = Value{}; + | - binding `x` declared here +LL | { LL | let _ref_to_val: &Value = &x; | -- borrow of `x` occurs here LL | eat(x); diff --git a/tests/ui/error-codes/E0506.stderr b/tests/ui/error-codes/E0506.stderr index d70406b750a..17ad7c611f8 100644 --- a/tests/ui/error-codes/E0506.stderr +++ b/tests/ui/error-codes/E0506.stderr @@ -2,9 +2,9 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed --> $DIR/E0506.rs:8:5 | LL | let fancy_ref = &fancy_num; - | ---------- borrow of `fancy_num` occurs here + | ---------- `fancy_num` is borrowed here LL | fancy_num = FancyNum { num: 6 }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fancy_num` is assigned to here but it was already borrowed LL | LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num); | ------------- borrow later used here diff --git a/tests/ui/error-codes/E0597.stderr b/tests/ui/error-codes/E0597.stderr index b4a1180ad54..82e3481b65a 100644 --- a/tests/ui/error-codes/E0597.stderr +++ b/tests/ui/error-codes/E0597.stderr @@ -1,6 +1,8 @@ error[E0597]: `y` does not live long enough --> $DIR/E0597.rs:8:16 | +LL | let y = 0; + | - binding `y` declared here LL | x.x = Some(&y); | ^^ borrowed value does not live long enough LL | |
