Skip to content

Commit 5dee38d

Browse files
committed
update some ui tests and update move ref drop semantics output
1 parent c93d25b commit 5dee38d

7 files changed

+27
-27
lines changed

src/test/ui/borrowck/borrowck-move-error-with-note.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0507]: cannot move out of `f.0` which is behind a shared reference
1+
error[E0507]: cannot move out of `f.1` which is behind a shared reference
22
--> $DIR/borrowck-move-error-with-note.rs:11:11
33
|
44
LL | match *f {

src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
3232
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:25:23
3333
|
3434
LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
35-
| ------------- immutable borrow occurs here
35+
| ------------- immutable borrow occurs here
3636
...
3737
LL | if let [_, _, ref mut from_begin2, ..] = *s {
3838
| ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
3939
LL | nop(&[from_begin2, from_end1, from_end3, from_end4]);
40-
| --------- immutable borrow later used here
40+
| --------- immutable borrow later used here
4141

4242
error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
4343
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:28:26
4444
|
4545
LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
46-
| ------------- immutable borrow occurs here
46+
| ------------- immutable borrow occurs here
4747
...
4848
LL | if let [_, _, _, ref mut from_begin3, ..] = *s {
4949
| ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
5050
LL | nop(&[from_begin3, from_end1, from_end3, from_end4]);
51-
| --------- immutable borrow later used here
51+
| --------- immutable borrow later used here
5252

5353
error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
5454
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:33:21
@@ -75,12 +75,12 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
7575
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:39:21
7676
|
7777
LL | if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
78-
| --------------- immutable borrow occurs here
78+
| --------------- immutable borrow occurs here
7979
...
8080
LL | if let [.., ref mut from_end4, _, _, _] = *s {
8181
| ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
8282
LL | nop(&[from_begin0, from_begin1, from_begin3, from_end4]);
83-
| ----------- immutable borrow later used here
83+
| ----------- immutable borrow later used here
8484

8585
error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
8686
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:47:20

src/test/ui/issues/issue-12567.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
88
| -- data moved here
99
LL | => println!("one empty"),
1010
LL | (&[hd1, ..], &[hd2, ..])
11-
| --- ...and here
11+
| --- ...and here
1212
|
1313
= note: move occurs because these variables have types that don't implement the `Copy` trait
1414

@@ -22,7 +22,7 @@ LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
2222
| -- data moved here
2323
LL | => println!("one empty"),
2424
LL | (&[hd1, ..], &[hd2, ..])
25-
| --- ...and here
25+
| --- ...and here
2626
|
2727
= note: move occurs because these variables have types that don't implement the `Copy` trait
2828

src/test/ui/nll/move-errors.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,6 @@ LL | B::U(D(s)) => (),
9797
| data moved here
9898
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
9999

100-
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
101-
--> $DIR/move-errors.rs:92:11
102-
|
103-
LL | match x {
104-
| ^ cannot move out of here
105-
...
106-
LL | (D(s), &t) => (),
107-
| -
108-
| |
109-
| data moved here
110-
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
111-
112100
error[E0507]: cannot move out of `*x.1` which is behind a shared reference
113101
--> $DIR/move-errors.rs:92:11
114102
|
@@ -121,6 +109,18 @@ LL | (D(s), &t) => (),
121109
| data moved here
122110
| move occurs because `t` has type `String`, which does not implement the `Copy` trait
123111

112+
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
113+
--> $DIR/move-errors.rs:92:11
114+
|
115+
LL | match x {
116+
| ^ cannot move out of here
117+
...
118+
LL | (D(s), &t) => (),
119+
| -
120+
| |
121+
| data moved here
122+
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
123+
124124
error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
125125
--> $DIR/move-errors.rs:102:11
126126
|

src/test/ui/pattern/move-ref-patterns/move-ref-patterns-dynamic-semantics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ fn main() {
7474
};
7575
lam((mk(19), mk(20), mk(21), mk(22)));
7676
}
77-
let expected = [2, 3, 6, 5, 7, 8, 12, 11, 9, 10, 18, 13, 14, 15, 16, 17, 21, 19, 20, 22, 4, 1];
77+
let expected = [2, 3, 6, 5, 7, 8, 12, 11, 9, 10, 13, 18, 14, 15, 16, 17, 19, 21, 20, 22, 4, 1];
7878
assert_eq!(&*d.borrow(), &expected);
7979
}

src/test/ui/span/dropck_direct_cycle_with_drop.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ LL | }
88
| -
99
| |
1010
| `d2` dropped here while still borrowed
11-
| borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
12-
|
13-
= note: values in a scope are dropped in the opposite order they are defined
11+
| borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
1412

1513
error[E0597]: `d1` does not live long enough
1614
--> $DIR/dropck_direct_cycle_with_drop.rs:38:19
@@ -22,7 +20,9 @@ LL | }
2220
| -
2321
| |
2422
| `d1` dropped here while still borrowed
25-
| borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
23+
| borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
24+
|
25+
= note: values in a scope are dropped in the opposite order they are defined
2626

2727
error: aborting due to 2 previous errors
2828

src/test/ui/span/send-is-not-static-std-sync-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ error[E0597]: `x` does not live long enough
2424
--> $DIR/send-is-not-static-std-sync-2.rs:31:25
2525
|
2626
LL | let (_tx, rx) = {
27-
| --- borrow later used here
27+
| -- borrow later used here
2828
...
2929
LL | let _ = tx.send(&x);
3030
| ^^ borrowed value does not live long enough

0 commit comments

Comments
 (0)