diff --git a/src/test/ui/hygiene/fields-move.nll.stderr b/src/test/ui/hygiene/fields-move.nll.stderr index 51f8067b8ce..56b77714991 100644 --- a/src/test/ui/hygiene/fields-move.nll.stderr +++ b/src/test/ui/hygiene/fields-move.nll.stderr @@ -1,14 +1,3 @@ -error[E0382]: use of moved value: `foo.x` - --> $DIR/fields-move.rs:38:42 - | -LL | $foo.x - | ------ value moved here -... -LL | assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x` - | ^^^^^ value used here after move - | - = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait - error[E0382]: use of moved value: `foo.x` --> $DIR/fields-move.rs:28:9 | @@ -25,6 +14,17 @@ LL | assert_two_copies(copy_legacy!(foo), foo.x); //~ ERROR use of moved val | = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait +error[E0382]: use of moved value: `foo.x` + --> $DIR/fields-move.rs:38:42 + | +LL | $foo.x + | ------ value moved here +... +LL | assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x` + | ^^^^^ value used here after move + | + = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait + error[E0382]: use of moved value: `foo.x` --> $DIR/fields-move.rs:39:42 | diff --git a/src/test/ui/issue-27592.nll.stderr b/src/test/ui/issue-27592.nll.stderr index 0b55117cad2..36a15e79ac8 100644 --- a/src/test/ui/issue-27592.nll.stderr +++ b/src/test/ui/issue-27592.nll.stderr @@ -1,11 +1,3 @@ -error[E0597]: borrowed value does not live long enough - --> $DIR/issue-27592.rs:26:33 - | -LL | write(|| format_args!("{}", String::from("Hello world"))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here - | | - | temporary value does not live long enough - error[E0597]: borrowed value does not live long enough --> $DIR/issue-27592.rs:26:27 | @@ -14,6 +6,14 @@ LL | write(|| format_args!("{}", String::from("Hello world"))); | | | temporary value does not live long enough +error[E0597]: borrowed value does not live long enough + --> $DIR/issue-27592.rs:26:33 + | +LL | write(|| format_args!("{}", String::from("Hello world"))); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/span/dropck_arr_cycle_checked.nll.stderr b/src/test/ui/span/dropck_arr_cycle_checked.nll.stderr index 6c0373ce157..76a25fa661e 100644 --- a/src/test/ui/span/dropck_arr_cycle_checked.nll.stderr +++ b/src/test/ui/span/dropck_arr_cycle_checked.nll.stderr @@ -1,15 +1,3 @@ -error[E0597]: `b3` does not live long enough - --> $DIR/dropck_arr_cycle_checked.rs:105:24 - | -LL | b1.a[1].v.set(Some(&b3)); - | ^^^ borrowed value does not live long enough -... -LL | } - | - - | | - | `b3` dropped here while still borrowed - | borrow later used here, when `b1` is dropped - error[E0597]: `b2` does not live long enough --> $DIR/dropck_arr_cycle_checked.rs:103:24 | @@ -22,6 +10,18 @@ LL | } | `b2` dropped here while still borrowed | borrow later used here, when `b1` is dropped +error[E0597]: `b3` does not live long enough + --> $DIR/dropck_arr_cycle_checked.rs:105:24 + | +LL | b1.a[1].v.set(Some(&b3)); + | ^^^ borrowed value does not live long enough +... +LL | } + | - + | | + | `b3` dropped here while still borrowed + | borrow later used here, when `b1` is dropped + error[E0597]: `b1` does not live long enough --> $DIR/dropck_arr_cycle_checked.rs:111:24 | diff --git a/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr b/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr index c0950e79296..e6f43e0a71b 100644 --- a/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr +++ b/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr @@ -1,15 +1,3 @@ -error[E0597]: `c3` does not live long enough - --> $DIR/dropck_vec_cycle_checked.rs:115:24 - | -LL | c1.v[1].v.set(Some(&c3)); - | ^^^ borrowed value does not live long enough -... -LL | } - | - - | | - | `c3` dropped here while still borrowed - | borrow later used here, when `c1` is dropped - error[E0597]: `c2` does not live long enough --> $DIR/dropck_vec_cycle_checked.rs:113:24 | @@ -22,6 +10,18 @@ LL | } | `c2` dropped here while still borrowed | borrow later used here, when `c1` is dropped +error[E0597]: `c3` does not live long enough + --> $DIR/dropck_vec_cycle_checked.rs:115:24 + | +LL | c1.v[1].v.set(Some(&c3)); + | ^^^ borrowed value does not live long enough +... +LL | } + | - + | | + | `c3` dropped here while still borrowed + | borrow later used here, when `c1` is dropped + error[E0597]: `c1` does not live long enough --> $DIR/dropck_vec_cycle_checked.rs:121:24 | diff --git a/src/test/ui/span/range-2.nll.stderr b/src/test/ui/span/range-2.nll.stderr index 049618fe474..2a82e1b8ada 100644 --- a/src/test/ui/span/range-2.nll.stderr +++ b/src/test/ui/span/range-2.nll.stderr @@ -1,14 +1,3 @@ -error[E0597]: `b` does not live long enough - --> $DIR/range-2.rs:17:13 - | -LL | &a..&b - | ^^ borrowed value does not live long enough -LL | }; - | - `b` dropped here while still borrowed -... -LL | r.use_ref(); - | - borrow later used here - error[E0597]: `a` does not live long enough --> $DIR/range-2.rs:17:9 | @@ -20,6 +9,17 @@ LL | }; LL | r.use_ref(); | - borrow later used here +error[E0597]: `b` does not live long enough + --> $DIR/range-2.rs:17:13 + | +LL | &a..&b + | ^^ borrowed value does not live long enough +LL | }; + | - `b` dropped here while still borrowed +... +LL | r.use_ref(); + | - borrow later used here + error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/span/regions-escape-loop-via-vec.nll.stderr b/src/test/ui/span/regions-escape-loop-via-vec.nll.stderr index 33fca7fa703..4d81211673e 100644 --- a/src/test/ui/span/regions-escape-loop-via-vec.nll.stderr +++ b/src/test/ui/span/regions-escape-loop-via-vec.nll.stderr @@ -20,6 +20,17 @@ LL | let mut z = x; //~ ERROR cannot use `x` because it was mutably borr LL | _y.push(&mut z); | -- borrow later used here +error[E0597]: `z` does not live long enough + --> $DIR/regions-escape-loop-via-vec.rs:17:17 + | +LL | _y.push(&mut z); + | -- ^^^^^^ borrowed value does not live long enough + | | + | borrow later used here +... +LL | } + | - `z` dropped here while still borrowed + error[E0503]: cannot use `x` because it was mutably borrowed --> $DIR/regions-escape-loop-via-vec.rs:19:9 | @@ -32,17 +43,6 @@ LL | //~^ ERROR `z` does not live long enough LL | x += 1; //~ ERROR cannot assign | ^^^^^^ use of borrowed `x` -error[E0597]: `z` does not live long enough - --> $DIR/regions-escape-loop-via-vec.rs:17:17 - | -LL | _y.push(&mut z); - | -- ^^^^^^ borrowed value does not live long enough - | | - | borrow later used here -... -LL | } - | - `z` dropped here while still borrowed - error: aborting due to 4 previous errors Some errors occurred: E0503, E0597. diff --git a/src/test/ui/span/send-is-not-static-ensures-scoping.nll.stderr b/src/test/ui/span/send-is-not-static-ensures-scoping.nll.stderr index 7f7217b8004..1753f710b88 100644 --- a/src/test/ui/span/send-is-not-static-ensures-scoping.nll.stderr +++ b/src/test/ui/span/send-is-not-static-ensures-scoping.nll.stderr @@ -1,3 +1,15 @@ +error[E0597]: `x` does not live long enough + --> $DIR/send-is-not-static-ensures-scoping.rs:26:17 + | +LL | let y = &x; + | ^^ borrowed value does not live long enough +... +LL | }; + | - `x` dropped here while still borrowed +LL | +LL | bad.join(); + | --- borrow later used here + error[E0597]: `y` does not live long enough --> $DIR/send-is-not-static-ensures-scoping.rs:29:16 | @@ -13,18 +25,6 @@ LL | LL | bad.join(); | --- borrow later used here -error[E0597]: `x` does not live long enough - --> $DIR/send-is-not-static-ensures-scoping.rs:26:17 - | -LL | let y = &x; - | ^^ borrowed value does not live long enough -... -LL | }; - | - `x` dropped here while still borrowed -LL | -LL | bad.join(); - | --- borrow later used here - error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/span/vec_refs_data_with_early_death.nll.stderr b/src/test/ui/span/vec_refs_data_with_early_death.nll.stderr index 73256b4fb17..60905367063 100644 --- a/src/test/ui/span/vec_refs_data_with_early_death.nll.stderr +++ b/src/test/ui/span/vec_refs_data_with_early_death.nll.stderr @@ -1,17 +1,3 @@ -error[E0597]: `y` does not live long enough - --> $DIR/vec_refs_data_with_early_death.rs:29:12 - | -LL | v.push(&y); - | ^^ borrowed value does not live long enough -... -LL | } - | - - | | - | `y` dropped here while still borrowed - | borrow later used here, when `v` is dropped - | - = note: values in a scope are dropped in the opposite order they are defined - error[E0597]: `x` does not live long enough --> $DIR/vec_refs_data_with_early_death.rs:27:12 | @@ -26,6 +12,20 @@ LL | } | = note: values in a scope are dropped in the opposite order they are defined +error[E0597]: `y` does not live long enough + --> $DIR/vec_refs_data_with_early_death.rs:29:12 + | +LL | v.push(&y); + | ^^ borrowed value does not live long enough +... +LL | } + | - + | | + | `y` dropped here while still borrowed + | borrow later used here, when `v` is dropped + | + = note: values in a scope are dropped in the opposite order they are defined + error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0597`.