update some ui tests and update move ref drop semantics output
This commit is contained in:
parent
c93d25b6af
commit
5dee38d8bb
@ -1,4 +1,4 @@
|
||||
error[E0507]: cannot move out of `f.0` which is behind a shared reference
|
||||
error[E0507]: cannot move out of `f.1` which is behind a shared reference
|
||||
--> $DIR/borrowck-move-error-with-note.rs:11:11
|
||||
|
|
||||
LL | match *f {
|
||||
|
@ -32,23 +32,23 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
|
||||
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:25:23
|
||||
|
|
||||
LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
|
||||
| ------------- immutable borrow occurs here
|
||||
| ------------- immutable borrow occurs here
|
||||
...
|
||||
LL | if let [_, _, ref mut from_begin2, ..] = *s {
|
||||
| ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
|
||||
LL | nop(&[from_begin2, from_end1, from_end3, from_end4]);
|
||||
| --------- immutable borrow later used here
|
||||
| --------- immutable borrow later used here
|
||||
|
||||
error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
|
||||
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:28:26
|
||||
|
|
||||
LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
|
||||
| ------------- immutable borrow occurs here
|
||||
| ------------- immutable borrow occurs here
|
||||
...
|
||||
LL | if let [_, _, _, ref mut from_begin3, ..] = *s {
|
||||
| ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
|
||||
LL | nop(&[from_begin3, from_end1, from_end3, from_end4]);
|
||||
| --------- immutable borrow later used here
|
||||
| --------- immutable borrow later used here
|
||||
|
||||
error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
|
||||
--> $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
|
||||
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:39:21
|
||||
|
|
||||
LL | if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
|
||||
| --------------- immutable borrow occurs here
|
||||
| --------------- immutable borrow occurs here
|
||||
...
|
||||
LL | if let [.., ref mut from_end4, _, _, _] = *s {
|
||||
| ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
|
||||
LL | nop(&[from_begin0, from_begin1, from_begin3, from_end4]);
|
||||
| ----------- immutable borrow later used here
|
||||
| ----------- immutable borrow later used here
|
||||
|
||||
error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
|
||||
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:47:20
|
||||
|
@ -1,17 +1,3 @@
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:2:11
|
||||
|
|
||||
LL | match (l1, l2) {
|
||||
| ^^^^^^^^ cannot move out of here
|
||||
...
|
||||
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
|
||||
| -- data moved here
|
||||
LL | => println!("one empty"),
|
||||
LL | (&[hd1, ..], &[hd2, ..])
|
||||
| --- ...and here
|
||||
|
|
||||
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:2:11
|
||||
|
|
||||
@ -26,6 +12,20 @@ LL | (&[hd1, ..], &[hd2, ..])
|
||||
|
|
||||
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||
|
||||
error[E0508]: cannot move out of type `[T]`, a non-copy slice
|
||||
--> $DIR/issue-12567.rs:2:11
|
||||
|
|
||||
LL | match (l1, l2) {
|
||||
| ^^^^^^^^ cannot move out of here
|
||||
...
|
||||
LL | (&[], &[hd, ..]) | (&[hd, ..], &[])
|
||||
| -- data moved here
|
||||
LL | => println!("one empty"),
|
||||
LL | (&[hd1, ..], &[hd2, ..])
|
||||
| --- ...and here
|
||||
|
|
||||
= note: move occurs because these variables have types that don't implement the `Copy` trait
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0508`.
|
||||
|
@ -97,18 +97,6 @@ LL | B::U(D(s)) => (),
|
||||
| data moved here
|
||||
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
|
||||
--> $DIR/move-errors.rs:92:11
|
||||
|
|
||||
LL | match x {
|
||||
| ^ cannot move out of here
|
||||
...
|
||||
LL | (D(s), &t) => (),
|
||||
| -
|
||||
| |
|
||||
| data moved here
|
||||
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0507]: cannot move out of `*x.1` which is behind a shared reference
|
||||
--> $DIR/move-errors.rs:92:11
|
||||
|
|
||||
@ -121,6 +109,18 @@ LL | (D(s), &t) => (),
|
||||
| data moved here
|
||||
| move occurs because `t` has type `String`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0509]: cannot move out of type `D`, which implements the `Drop` trait
|
||||
--> $DIR/move-errors.rs:92:11
|
||||
|
|
||||
LL | match x {
|
||||
| ^ cannot move out of here
|
||||
...
|
||||
LL | (D(s), &t) => (),
|
||||
| -
|
||||
| |
|
||||
| data moved here
|
||||
| move occurs because `s` has type `String`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0509]: cannot move out of type `F`, which implements the `Drop` trait
|
||||
--> $DIR/move-errors.rs:102:11
|
||||
|
|
||||
|
@ -74,6 +74,6 @@ fn main() {
|
||||
};
|
||||
lam((mk(19), mk(20), mk(21), mk(22)));
|
||||
}
|
||||
let expected = [2, 3, 6, 5, 7, 8, 12, 11, 9, 10, 18, 13, 14, 15, 16, 17, 21, 19, 20, 22, 4, 1];
|
||||
let expected = [2, 3, 6, 5, 7, 8, 12, 11, 9, 10, 13, 18, 14, 15, 16, 17, 19, 21, 20, 22, 4, 1];
|
||||
assert_eq!(&*d.borrow(), &expected);
|
||||
}
|
||||
|
@ -8,9 +8,7 @@ LL | }
|
||||
| -
|
||||
| |
|
||||
| `d2` dropped here while still borrowed
|
||||
| borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
| borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
|
||||
|
||||
error[E0597]: `d1` does not live long enough
|
||||
--> $DIR/dropck_direct_cycle_with_drop.rs:38:19
|
||||
@ -22,7 +20,9 @@ LL | }
|
||||
| -
|
||||
| |
|
||||
| `d1` dropped here while still borrowed
|
||||
| borrow might be used here, when `d1` is dropped and runs the `Drop` code for type `D`
|
||||
| borrow might be used here, when `d2` is dropped and runs the `Drop` code for type `D`
|
||||
|
|
||||
= note: values in a scope are dropped in the opposite order they are defined
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -24,7 +24,7 @@ error[E0597]: `x` does not live long enough
|
||||
--> $DIR/send-is-not-static-std-sync-2.rs:31:25
|
||||
|
|
||||
LL | let (_tx, rx) = {
|
||||
| --- borrow later used here
|
||||
| -- borrow later used here
|
||||
...
|
||||
LL | let _ = tx.send(&x);
|
||||
| ^^ borrowed value does not live long enough
|
||||
|
Loading…
x
Reference in New Issue
Block a user