From 9eb2de4b75837130eddd825defb4f942c451b991 Mon Sep 17 00:00:00 2001 From: Mathias Blikstad Date: Sat, 16 Mar 2019 09:53:09 +0100 Subject: [PATCH 1/3] compiletest: Filter test annotations from UI test output for revision tests --- src/tools/compiletest/src/runtest.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 84dd671fa7ddb..97bacb6719f7a 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -3110,7 +3110,7 @@ impl<'test> TestCx<'test> { // Remove test annotations like `//~ ERROR text` from the output, // since they duplicate actual errors and make the output hard to read. - normalized = Regex::new("\\s*//~.*").unwrap() + normalized = Regex::new("\\s*//(\\[.*\\])?~.*").unwrap() .replace_all(&normalized, "").into_owned(); for rule in custom_rules { From faed3a2b1932c1bccbf5f2ba2d68c15c21a5b91f Mon Sep 17 00:00:00 2001 From: Mathias Blikstad Date: Sun, 17 Mar 2019 10:52:07 +0100 Subject: [PATCH 2/3] Updated UI test output to remove test annotations for revisions --- src/test/ui/E0501.ast.nll.stderr | 4 +- src/test/ui/E0501.ast.stderr | 4 +- src/test/ui/E0501.mir.stderr | 4 +- src/test/ui/E0506.ast.nll.stderr | 2 +- src/test/ui/E0506.ast.stderr | 2 +- src/test/ui/E0506.mir.stderr | 2 +- src/test/ui/E0508-fail.ast.nll.stderr | 2 +- src/test/ui/E0508-fail.ast.stderr | 2 +- src/test/ui/E0508-fail.mir.stderr | 2 +- src/test/ui/E0508.ast.stderr | 2 +- src/test/ui/E0508.mir.stderr | 2 +- src/test/ui/E0594.ast.nll.stderr | 2 +- src/test/ui/E0594.ast.stderr | 2 +- src/test/ui/E0594.mir.stderr | 2 +- src/test/ui/E0596.ast.nll.stderr | 2 +- src/test/ui/E0596.ast.stderr | 2 +- src/test/ui/E0596.mir.stderr | 2 +- .../ui/assign-imm-local-twice.ast.nll.stderr | 4 +- src/test/ui/assign-imm-local-twice.ast.stderr | 4 +- src/test/ui/assign-imm-local-twice.mir.stderr | 4 +- .../bound-lifetime-in-binding-only.ok.stderr | 2 +- .../bound-lifetime-in-return-only.ok.stderr | 2 +- ...ect-fn-ret-contravariant.krisskross.stderr | 4 +- ...ject-fn-ret-contravariant.transmute.stderr | 6 +-- ...project-fn-ret-invariant.krisskross.stderr | 6 +-- .../project-fn-ret-invariant.oneuse.stderr | 2 +- .../project-fn-ret-invariant.transmute.stderr | 2 +- .../higher-ranked-projection.good.stderr | 4 +- ...borrowck-access-permissions.ast.nll.stderr | 12 ++--- .../borrowck-access-permissions.ast.stderr | 12 ++--- .../borrowck-access-permissions.mir.stderr | 12 ++--- .../ui/borrowck/borrowck-asm.ast.nll.stderr | 14 +++--- src/test/ui/borrowck/borrowck-asm.ast.stderr | 16 +++---- src/test/ui/borrowck/borrowck-asm.mir.stderr | 14 +++--- .../borrowck-assign-comp.ast.nll.stderr | 10 ++-- .../borrowck/borrowck-assign-comp.ast.stderr | 6 +-- .../borrowck/borrowck-assign-comp.mir.stderr | 10 ++-- ...orrowck-assign-to-constants.ast.nll.stderr | 2 +- .../borrowck-assign-to-constants.ast.stderr | 2 +- .../borrowck-assign-to-constants.mir.stderr | 2 +- .../borrowck-box-insensitivity.ast.stderr | 42 ++++++++-------- .../borrowck-box-insensitivity.mir.stderr | 2 +- ...rrowck-closures-mut-and-imm.ast.nll.stderr | 32 ++++++------- .../borrowck-closures-mut-and-imm.ast.stderr | 16 +++---- .../borrowck-closures-mut-and-imm.mir.stderr | 32 ++++++------- .../borrowck-describe-lvalue.ast.nll.stderr | 48 +++++++++---------- .../borrowck-describe-lvalue.ast.stderr | 22 ++++----- .../borrowck-describe-lvalue.mir.stderr | 48 +++++++++---------- .../borrowck-fn-in-const-a.ast.stderr | 2 +- .../borrowck-fn-in-const-a.mir.stderr | 2 +- ...-mut-rec-field-issue-3162-c.ast.nll.stderr | 2 +- ...f-to-mut-rec-field-issue-3162-c.ast.stderr | 2 +- ...f-to-mut-rec-field-issue-3162-c.mir.stderr | 2 +- .../borrowck-issue-14498.ast.nll.stderr | 34 ++++++------- .../borrowck/borrowck-issue-14498.ast.stderr | 18 +++---- .../borrowck/borrowck-issue-14498.mir.stderr | 34 ++++++------- .../borrowck-lend-flow-loop.ast.stderr | 18 +++---- .../borrowck-lend-flow-loop.nll.stderr | 6 +-- .../borrowck-lend-flow-match.ast.nll.stderr | 4 +- .../borrowck-lend-flow-match.ast.stderr | 2 +- .../borrowck-lend-flow-match.mir.stderr | 4 +- ...owck-match-already-borrowed.ast.nll.stderr | 8 ++-- ...borrowck-match-already-borrowed.ast.stderr | 6 +-- ...borrowck-match-already-borrowed.mir.stderr | 8 ++-- ...match-binding-is-assignment.ast.nll.stderr | 10 ++-- ...wck-match-binding-is-assignment.ast.stderr | 10 ++-- ...wck-match-binding-is-assignment.mir.stderr | 10 ++-- ...ve-moved-value-into-closure.ast.nll.stderr | 2 +- ...k-move-moved-value-into-closure.ast.stderr | 2 +- ...k-move-moved-value-into-closure.mir.stderr | 2 +- .../borrowck-move-out-from-array.ast.stderr | 4 +- .../borrowck-move-out-from-array.mir.stderr | 4 +- ...orrowck-move-out-of-static-item.ast.stderr | 2 +- ...orrowck-move-out-of-static-item.mir.stderr | 2 +- ...ove-out-of-struct-with-dtor.ast.nll.stderr | 2 +- ...ck-move-out-of-struct-with-dtor.mir.stderr | 2 +- ...ck-mut-borrow-linear-errors.ast.nll.stderr | 16 +++---- ...rrowck-mut-borrow-linear-errors.ast.stderr | 12 ++--- ...rrowck-mut-borrow-linear-errors.mir.stderr | 16 +++---- ...rrowck-pat-reassign-binding.ast.nll.stderr | 4 +- .../borrowck-pat-reassign-binding.ast.stderr | 2 +- .../borrowck-pat-reassign-binding.mir.stderr | 4 +- ...l-static-borrow-outlives-fn.ast.nll.stderr | 4 +- ...local-static-borrow-outlives-fn.ast.stderr | 2 +- ...local-static-borrow-outlives-fn.mir.stderr | 4 +- .../borrowck-unary-move.ast.nll.stderr | 4 +- .../borrowck/borrowck-unary-move.ast.stderr | 2 +- .../borrowck/borrowck-unary-move.mir.stderr | 4 +- ...orrowck-uninit-field-access.ast.nll.stderr | 6 +-- .../borrowck-uninit-field-access.ast.stderr | 6 +-- .../borrowck-uninit-field-access.mir.stderr | 6 +-- .../borrowck-uninit-ref-chain.ast.nll.stderr | 14 +++--- .../borrowck-uninit-ref-chain.ast.stderr | 14 +++--- .../borrowck-uninit-ref-chain.mir.stderr | 14 +++--- .../borrowck/borrowck-union-borrow.mir.stderr | 46 +++++++++--------- ...orrowck-use-in-index-lvalue.ast.nll.stderr | 4 +- .../borrowck-use-in-index-lvalue.ast.stderr | 4 +- .../borrowck-use-in-index-lvalue.mir.stderr | 4 +- ...uninitialized-in-cast-trait.ast.nll.stderr | 2 +- ...use-uninitialized-in-cast-trait.ast.stderr | 2 +- ...use-uninitialized-in-cast-trait.mir.stderr | 2 +- ...k-use-uninitialized-in-cast.ast.nll.stderr | 2 +- ...rowck-use-uninitialized-in-cast.ast.stderr | 2 +- ...rowck-use-uninitialized-in-cast.mir.stderr | 2 +- ...rowck-vec-pattern-move-tail.ast.nll.stderr | 2 +- .../borrowck-vec-pattern-move-tail.ast.stderr | 2 +- .../borrowck-vec-pattern-move-tail.cmp.stderr | 4 +- ...-static-initializer-issue-38520.ast.stderr | 4 +- ...-static-initializer-issue-38520.mir.stderr | 4 +- ...ion-sharing-interference.nll_target.stderr | 6 +-- ...ccess-during-reservation.nll_target.stderr | 2 +- .../hr-subtype.bound_a_vs_bound_a.stderr | 10 ++-- .../hr-subtype.bound_a_vs_bound_b.stderr | 10 ++-- ...hr-subtype.bound_co_a_vs_bound_co_b.stderr | 10 ++-- ...-subtype.bound_inv_a_vs_bound_inv_b.stderr | 10 ++-- .../hr-subtype.free_x_vs_free_x.stderr | 10 ++-- .../hrtb-identity-fn-borrows.ast.nll.stderr | 2 +- .../hrtb/hrtb-identity-fn-borrows.ast.stderr | 2 +- .../hrtb/hrtb-identity-fn-borrows.mir.stderr | 2 +- .../immut-function-arguments.ast.nll.stderr | 4 +- .../ui/immut-function-arguments.ast.stderr | 4 +- .../ui/immut-function-arguments.mir.stderr | 4 +- src/test/ui/issues/issue-17263.nll.stderr | 4 +- src/test/ui/issues/issue-25579.ast.nll.stderr | 2 +- src/test/ui/issues/issue-25579.ast.stderr | 6 +-- src/test/ui/issues/issue-25579.mir.stderr | 2 +- src/test/ui/issues/issue-45199.ast.nll.stderr | 14 +++--- src/test/ui/issues/issue-45199.ast.stderr | 14 +++--- src/test/ui/issues/issue-45199.mir.stderr | 14 +++--- ...-45696-scribble-on-boxed-borrow.ast.stderr | 4 +- ...96-scribble-on-boxed-borrow.migrate.stderr | 10 ++-- ...-45696-scribble-on-boxed-borrow.nll.stderr | 6 +-- src/test/ui/issues/issue-46604.ast.nll.stderr | 4 +- src/test/ui/issues/issue-46604.ast.stderr | 4 +- src/test/ui/issues/issue-46604.mir.stderr | 4 +- src/test/ui/issues/issue-5500-1.ast.stderr | 4 +- src/test/ui/issues/issue-5500-1.mir.stderr | 4 +- ...ss-assign-imm-local-in-loop.ast.nll.stderr | 2 +- ...veness-assign-imm-local-in-loop.ast.stderr | 2 +- ...veness-assign-imm-local-in-loop.mir.stderr | 2 +- ...s-assign-imm-local-in-op-eq.ast.nll.stderr | 6 +-- ...eness-assign-imm-local-in-op-eq.ast.stderr | 6 +-- ...eness-assign-imm-local-in-op-eq.mir.stderr | 6 +-- ...-assign-imm-local-with-drop.ast.nll.stderr | 4 +- ...ness-assign-imm-local-with-drop.ast.stderr | 4 +- ...ness-assign-imm-local-with-drop.mir.stderr | 4 +- ...-assign-imm-local-with-init.ast.nll.stderr | 4 +- ...ness-assign-imm-local-with-init.ast.stderr | 4 +- ...ness-assign-imm-local-with-init.mir.stderr | 4 +- .../meta-expected-error-correct-rev.a.stderr | 2 +- ...pattern-internal-mutability.ast.nll.stderr | 6 +-- ...mut-pattern-internal-mutability.ast.stderr | 4 +- ...mut-pattern-internal-mutability.mir.stderr | 6 +-- .../mut/mutable-class-fields.ast.nll.stderr | 2 +- .../ui/mut/mutable-class-fields.ast.stderr | 2 +- .../ui/mut/mutable-class-fields.mir.stderr | 2 +- .../match-guards-always-borrow.ast.nll.stderr | 2 +- .../nll/match-guards-always-borrow.ast.stderr | 2 +- ...arried-through-struct-field.ast.nll.stderr | 4 +- ...ce-carried-through-struct-field.ast.stderr | 2 +- ...ce-carried-through-struct-field.mir.stderr | 4 +- src/test/ui/obsolete-in-place/bad.bad.stderr | 4 +- ...ons-free-region-ordering-caller.ast.stderr | 6 +-- ...ons-free-region-ordering-caller.mir.stderr | 6 +-- ...-pattern-typing-issue-19997.ast.nll.stderr | 4 +- ...ions-pattern-typing-issue-19997.ast.stderr | 2 +- ...ions-pattern-typing-issue-19997.mir.stderr | 4 +- .../ui/regions/regions-static-bound.ll.stderr | 6 +-- .../regions/regions-static-bound.nll.stderr | 6 +-- .../ui/rfc1445/feature-gate.no_gate.stderr | 2 +- .../ui/rfc1445/feature-gate.with_gate.stderr | 2 +- ...tated-upvar-from-fn-closure.ast.nll.stderr | 4 +- ...s-mutated-upvar-from-fn-closure.ast.stderr | 4 +- ...s-mutated-upvar-from-fn-closure.mir.stderr | 4 +- 174 files changed, 585 insertions(+), 585 deletions(-) diff --git a/src/test/ui/E0501.ast.nll.stderr b/src/test/ui/E0501.ast.nll.stderr index 1d0102d100e4d..74f14bebcc905 100644 --- a/src/test/ui/E0501.ast.nll.stderr +++ b/src/test/ui/E0501.ast.nll.stderr @@ -6,7 +6,7 @@ LL | let bar = || { LL | inside_closure(a) | - first borrow occurs due to use of `a` in closure LL | }; -LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access +LL | outside_closure_1(a); | ^ second borrow occurs here ... LL | drop(bar); @@ -20,7 +20,7 @@ LL | let bar = || { LL | inside_closure(a) | - first borrow occurs due to use of `a` in closure ... -LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access +LL | outside_closure_2(a); | ^ second borrow occurs here ... LL | drop(bar); diff --git a/src/test/ui/E0501.ast.stderr b/src/test/ui/E0501.ast.stderr index e0bd7a08d7f5b..e2f54c6553f05 100644 --- a/src/test/ui/E0501.ast.stderr +++ b/src/test/ui/E0501.ast.stderr @@ -6,7 +6,7 @@ LL | let bar = || { LL | inside_closure(a) | - previous borrow occurs due to use of `a` in closure LL | }; -LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access +LL | outside_closure_1(a); | ^ borrow occurs here ... LL | } @@ -20,7 +20,7 @@ LL | let bar = || { LL | inside_closure(a) | - previous borrow occurs due to use of `a` in closure ... -LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access +LL | outside_closure_2(a); | ^ borrow occurs here ... LL | } diff --git a/src/test/ui/E0501.mir.stderr b/src/test/ui/E0501.mir.stderr index 1d0102d100e4d..74f14bebcc905 100644 --- a/src/test/ui/E0501.mir.stderr +++ b/src/test/ui/E0501.mir.stderr @@ -6,7 +6,7 @@ LL | let bar = || { LL | inside_closure(a) | - first borrow occurs due to use of `a` in closure LL | }; -LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access +LL | outside_closure_1(a); | ^ second borrow occurs here ... LL | drop(bar); @@ -20,7 +20,7 @@ LL | let bar = || { LL | inside_closure(a) | - first borrow occurs due to use of `a` in closure ... -LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access +LL | outside_closure_2(a); | ^ second borrow occurs here ... LL | drop(bar); diff --git a/src/test/ui/E0506.ast.nll.stderr b/src/test/ui/E0506.ast.nll.stderr index b66c1d129a79a..6e2d63441e25a 100644 --- a/src/test/ui/E0506.ast.nll.stderr +++ b/src/test/ui/E0506.ast.nll.stderr @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed | LL | let fancy_ref = &fancy_num; | ---------- borrow of `fancy_num` occurs here -LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506 +LL | fancy_num = FancyNum { num: 6 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here ... LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num); diff --git a/src/test/ui/E0506.ast.stderr b/src/test/ui/E0506.ast.stderr index d459dcdc21994..3e3001f232c89 100644 --- a/src/test/ui/E0506.ast.stderr +++ b/src/test/ui/E0506.ast.stderr @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed | LL | let fancy_ref = &fancy_num; | --------- borrow of `fancy_num` occurs here -LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506 +LL | fancy_num = FancyNum { num: 6 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here error: aborting due to previous error diff --git a/src/test/ui/E0506.mir.stderr b/src/test/ui/E0506.mir.stderr index b66c1d129a79a..6e2d63441e25a 100644 --- a/src/test/ui/E0506.mir.stderr +++ b/src/test/ui/E0506.mir.stderr @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `fancy_num` because it is borrowed | LL | let fancy_ref = &fancy_num; | ---------- borrow of `fancy_num` occurs here -LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506 +LL | fancy_num = FancyNum { num: 6 }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here ... LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num); diff --git a/src/test/ui/E0508-fail.ast.nll.stderr b/src/test/ui/E0508-fail.ast.nll.stderr index 4cc1cf89d6cb9..972b84e37beba 100644 --- a/src/test/ui/E0508-fail.ast.nll.stderr +++ b/src/test/ui/E0508-fail.ast.nll.stderr @@ -1,7 +1,7 @@ error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array --> $DIR/E0508-fail.rs:8:18 | -LL | let _value = array[0]; //[ast]~ ERROR [E0508] +LL | let _value = array[0]; | ^^^^^^^^ | | | cannot move out of here diff --git a/src/test/ui/E0508-fail.ast.stderr b/src/test/ui/E0508-fail.ast.stderr index 57959c96f63ec..8b249839f01ef 100644 --- a/src/test/ui/E0508-fail.ast.stderr +++ b/src/test/ui/E0508-fail.ast.stderr @@ -1,7 +1,7 @@ error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array --> $DIR/E0508-fail.rs:8:18 | -LL | let _value = array[0]; //[ast]~ ERROR [E0508] +LL | let _value = array[0]; | ^^^^^^^^ | | | cannot move out of here diff --git a/src/test/ui/E0508-fail.mir.stderr b/src/test/ui/E0508-fail.mir.stderr index 4cc1cf89d6cb9..972b84e37beba 100644 --- a/src/test/ui/E0508-fail.mir.stderr +++ b/src/test/ui/E0508-fail.mir.stderr @@ -1,7 +1,7 @@ error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array --> $DIR/E0508-fail.rs:8:18 | -LL | let _value = array[0]; //[ast]~ ERROR [E0508] +LL | let _value = array[0]; | ^^^^^^^^ | | | cannot move out of here diff --git a/src/test/ui/E0508.ast.stderr b/src/test/ui/E0508.ast.stderr index 5878b795b771c..88401d0d88f1d 100644 --- a/src/test/ui/E0508.ast.stderr +++ b/src/test/ui/E0508.ast.stderr @@ -1,7 +1,7 @@ error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array --> $DIR/E0508.rs:18:18 | -LL | let _value = array[0]; //[ast]~ ERROR [E0508] +LL | let _value = array[0]; | ^^^^^^^^ | | | cannot move out of here diff --git a/src/test/ui/E0508.mir.stderr b/src/test/ui/E0508.mir.stderr index 5878b795b771c..88401d0d88f1d 100644 --- a/src/test/ui/E0508.mir.stderr +++ b/src/test/ui/E0508.mir.stderr @@ -1,7 +1,7 @@ error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array --> $DIR/E0508.rs:18:18 | -LL | let _value = array[0]; //[ast]~ ERROR [E0508] +LL | let _value = array[0]; | ^^^^^^^^ | | | cannot move out of here diff --git a/src/test/ui/E0594.ast.nll.stderr b/src/test/ui/E0594.ast.nll.stderr index 54681a29b81bc..cc1c968474170 100644 --- a/src/test/ui/E0594.ast.nll.stderr +++ b/src/test/ui/E0594.ast.nll.stderr @@ -1,7 +1,7 @@ error[E0594]: cannot assign to immutable static item `NUM` --> $DIR/E0594.rs:7:5 | -LL | NUM = 20; //[ast]~ ERROR E0594 +LL | NUM = 20; | ^^^^^^^^ cannot assign error: aborting due to previous error diff --git a/src/test/ui/E0594.ast.stderr b/src/test/ui/E0594.ast.stderr index 4eb9ba133ae55..0c5316da75821 100644 --- a/src/test/ui/E0594.ast.stderr +++ b/src/test/ui/E0594.ast.stderr @@ -1,7 +1,7 @@ error[E0594]: cannot assign to immutable static item --> $DIR/E0594.rs:7:5 | -LL | NUM = 20; //[ast]~ ERROR E0594 +LL | NUM = 20; | ^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/E0594.mir.stderr b/src/test/ui/E0594.mir.stderr index 54681a29b81bc..cc1c968474170 100644 --- a/src/test/ui/E0594.mir.stderr +++ b/src/test/ui/E0594.mir.stderr @@ -1,7 +1,7 @@ error[E0594]: cannot assign to immutable static item `NUM` --> $DIR/E0594.rs:7:5 | -LL | NUM = 20; //[ast]~ ERROR E0594 +LL | NUM = 20; | ^^^^^^^^ cannot assign error: aborting due to previous error diff --git a/src/test/ui/E0596.ast.nll.stderr b/src/test/ui/E0596.ast.nll.stderr index e5da6649f5aaf..c89a915cfbd23 100644 --- a/src/test/ui/E0596.ast.nll.stderr +++ b/src/test/ui/E0596.ast.nll.stderr @@ -3,7 +3,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable | LL | let x = 1; | - help: consider changing this to be mutable: `mut x` -LL | let y = &mut x; //[ast]~ ERROR [E0596] +LL | let y = &mut x; | ^^^^^^ cannot borrow as mutable error: aborting due to previous error diff --git a/src/test/ui/E0596.ast.stderr b/src/test/ui/E0596.ast.stderr index 6e65cc855e7f1..4b66e49ba85b7 100644 --- a/src/test/ui/E0596.ast.stderr +++ b/src/test/ui/E0596.ast.stderr @@ -3,7 +3,7 @@ error[E0596]: cannot borrow immutable local variable `x` as mutable | LL | let x = 1; | - help: make this binding mutable: `mut x` -LL | let y = &mut x; //[ast]~ ERROR [E0596] +LL | let y = &mut x; | ^ cannot borrow mutably error: aborting due to previous error diff --git a/src/test/ui/E0596.mir.stderr b/src/test/ui/E0596.mir.stderr index e5da6649f5aaf..c89a915cfbd23 100644 --- a/src/test/ui/E0596.mir.stderr +++ b/src/test/ui/E0596.mir.stderr @@ -3,7 +3,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable | LL | let x = 1; | - help: consider changing this to be mutable: `mut x` -LL | let y = &mut x; //[ast]~ ERROR [E0596] +LL | let y = &mut x; | ^^^^^^ cannot borrow as mutable error: aborting due to previous error diff --git a/src/test/ui/assign-imm-local-twice.ast.nll.stderr b/src/test/ui/assign-imm-local-twice.ast.nll.stderr index 311a83a76f933..2995a139ae4b0 100644 --- a/src/test/ui/assign-imm-local-twice.ast.nll.stderr +++ b/src/test/ui/assign-imm-local-twice.ast.nll.stderr @@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v` LL | let v: isize; | - help: make this binding mutable: `mut v` ... -LL | v = 1; //[ast]~ NOTE first assignment +LL | v = 1; | ----- first assignment to `v` ... -LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 2; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/assign-imm-local-twice.ast.stderr b/src/test/ui/assign-imm-local-twice.ast.stderr index d57acb2c62154..f16b8e2ebd7cc 100644 --- a/src/test/ui/assign-imm-local-twice.ast.stderr +++ b/src/test/ui/assign-imm-local-twice.ast.stderr @@ -1,10 +1,10 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/assign-imm-local-twice.rs:11:5 | -LL | v = 1; //[ast]~ NOTE first assignment +LL | v = 1; | ----- first assignment to `v` ... -LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 2; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/assign-imm-local-twice.mir.stderr b/src/test/ui/assign-imm-local-twice.mir.stderr index 311a83a76f933..2995a139ae4b0 100644 --- a/src/test/ui/assign-imm-local-twice.mir.stderr +++ b/src/test/ui/assign-imm-local-twice.mir.stderr @@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v` LL | let v: isize; | - help: make this binding mutable: `mut v` ... -LL | v = 1; //[ast]~ NOTE first assignment +LL | v = 1; | ----- first assignment to `v` ... -LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 2; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/associated-types/bound-lifetime-in-binding-only.ok.stderr b/src/test/ui/associated-types/bound-lifetime-in-binding-only.ok.stderr index 3a5ff9d795631..fcdb371a6e599 100644 --- a/src/test/ui/associated-types/bound-lifetime-in-binding-only.ok.stderr +++ b/src/test/ui/associated-types/bound-lifetime-in-binding-only.ok.stderr @@ -1,7 +1,7 @@ error: compilation successful --> $DIR/bound-lifetime-in-binding-only.rs:71:1 | -LL | fn main() { } //[ok]~ ERROR compilation successful +LL | fn main() { } | ^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/associated-types/bound-lifetime-in-return-only.ok.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.ok.stderr index 650383b531cfa..504d68e66e23e 100644 --- a/src/test/ui/associated-types/bound-lifetime-in-return-only.ok.stderr +++ b/src/test/ui/associated-types/bound-lifetime-in-return-only.ok.stderr @@ -1,7 +1,7 @@ error: compilation successful --> $DIR/bound-lifetime-in-return-only.rs:49:1 | -LL | fn main() { } //[ok]~ ERROR compilation successful +LL | fn main() { } | ^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr index 0fed413f14418..fa4c6adb5fff7 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr @@ -6,7 +6,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { | | | this parameter and the return type are declared with different lifetimes... ... -LL | (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623] +LL | (a, b) | ^ ...but data from `y` is returned here error[E0623]: lifetime mismatch @@ -17,7 +17,7 @@ LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { | | | this parameter and the return type are declared with different lifetimes... ... -LL | (a, b) //[krisskross]~ ERROR lifetime mismatch [E0623] +LL | (a, b) | ^ ...but data from `x` is returned here error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr index ab148365c9199..4309373f123f9 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr @@ -1,7 +1,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/project-fn-ret-contravariant.rs:38:8 | -LL | bar(foo, x) //[transmute]~ ERROR E0495 +LL | bar(foo, x) | ^^^ | note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 37:8... @@ -12,13 +12,13 @@ LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { note: ...so that reference does not outlive borrowed content --> $DIR/project-fn-ret-contravariant.rs:38:13 | -LL | bar(foo, x) //[transmute]~ ERROR E0495 +LL | bar(foo, x) | ^ = note: but, the lifetime must be valid for the static lifetime... note: ...so that reference does not outlive borrowed content --> $DIR/project-fn-ret-contravariant.rs:38:4 | -LL | bar(foo, x) //[transmute]~ ERROR E0495 +LL | bar(foo, x) | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr index fa831ea81dcfb..5009e0868a7d4 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr @@ -5,7 +5,7 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { | -------- -------------------- | | | this parameter and the return type are declared with different lifetimes... -LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623 +LL | let a = bar(foo, y); | ^ ...but data from `x` is returned here error[E0623]: lifetime mismatch @@ -15,8 +15,8 @@ LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { | -------- -------------------- | | | this parameter and the return type are declared with different lifetimes... -LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623 -LL | let b = bar(foo, x); //[krisskross]~ ERROR E0623 +LL | let a = bar(foo, y); +LL | let b = bar(foo, x); | ^ ...but data from `y` is returned here error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr index 6b78d66a2d484..65d16440ac9b0 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr @@ -6,7 +6,7 @@ LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { | | | this parameter and the return type are declared with different lifetimes... ... -LL | let b = bar(f, y); //[oneuse]~ ERROR lifetime mismatch [E0623] +LL | let b = bar(f, y); | ^ ...but data from `x` is returned here error: aborting due to previous error diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr index dd1212eaac91d..b8b1a979c363a 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr @@ -1,7 +1,7 @@ error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/project-fn-ret-invariant.rs:48:8 | -LL | bar(foo, x) //[transmute]~ ERROR E0495 +LL | bar(foo, x) | ^^^ | note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 44:8... diff --git a/src/test/ui/associated-types/higher-ranked-projection.good.stderr b/src/test/ui/associated-types/higher-ranked-projection.good.stderr index 165e5213e0d34..16fef0510f871 100644 --- a/src/test/ui/associated-types/higher-ranked-projection.good.stderr +++ b/src/test/ui/associated-types/higher-ranked-projection.good.stderr @@ -1,9 +1,9 @@ error: compilation successful --> $DIR/higher-ranked-projection.rs:24:1 | -LL | / fn main() { //[good]~ ERROR compilation successful +LL | / fn main() { LL | | foo(()); -LL | | //[bad]~^ ERROR type mismatch +LL | | LL | | } | |_^ diff --git a/src/test/ui/borrowck/borrowck-access-permissions.ast.nll.stderr b/src/test/ui/borrowck/borrowck-access-permissions.ast.nll.stderr index 0d771a55d5995..12f9ad8276fa4 100644 --- a/src/test/ui/borrowck/borrowck-access-permissions.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-access-permissions.ast.nll.stderr @@ -4,13 +4,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable LL | let x = 1; | - help: consider changing this to be mutable: `mut x` ... -LL | let _y1 = &mut x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut x; | ^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow immutable static item `static_x` as mutable --> $DIR/borrowck-access-permissions.rs:18:19 | -LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut static_x; | ^^^^^^^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable @@ -19,7 +19,7 @@ error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as m LL | let box_x = Box::new(1); | ----- help: consider changing this to be mutable: `mut box_x` ... -LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *box_x; | ^^^^^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference @@ -28,7 +28,7 @@ error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference LL | let ref_x = &x; | -- help: consider changing this to be a mutable reference: `&mut x` ... -LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *ref_x; | ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer @@ -37,7 +37,7 @@ error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` poin LL | let ptr_x : *const _ = &x; | -- help: consider changing this to be a mutable pointer: `&mut x` ... -LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *ptr_x; | ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference @@ -45,7 +45,7 @@ error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` refer | LL | let foo_ref = &foo; | ---- help: consider changing this to be a mutable reference: `&mut foo` -LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389] +LL | let _y = &mut *foo_ref.f; | ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable error: aborting due to 6 previous errors diff --git a/src/test/ui/borrowck/borrowck-access-permissions.ast.stderr b/src/test/ui/borrowck/borrowck-access-permissions.ast.stderr index 4b0e261b17461..a1cc0638af36e 100644 --- a/src/test/ui/borrowck/borrowck-access-permissions.ast.stderr +++ b/src/test/ui/borrowck/borrowck-access-permissions.ast.stderr @@ -4,13 +4,13 @@ error[E0596]: cannot borrow immutable local variable `x` as mutable LL | let x = 1; | - help: make this binding mutable: `mut x` ... -LL | let _y1 = &mut x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut x; | ^ cannot borrow mutably error[E0596]: cannot borrow immutable static item as mutable --> $DIR/borrowck-access-permissions.rs:18:24 | -LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut static_x; | ^^^^^^^^ error[E0596]: cannot borrow immutable `Box` content `*box_x` as mutable @@ -19,25 +19,25 @@ error[E0596]: cannot borrow immutable `Box` content `*box_x` as mutable LL | let box_x = Box::new(1); | ----- help: make this binding mutable: `mut box_x` ... -LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *box_x; | ^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow immutable borrowed content `*ref_x` as mutable --> $DIR/borrowck-access-permissions.rs:36:24 | -LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *ref_x; | ^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow immutable dereference of raw pointer `*ptr_x` as mutable --> $DIR/borrowck-access-permissions.rs:46:28 | -LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *ptr_x; | ^^^^^^ cannot borrow as mutable error[E0389]: cannot borrow data mutably in a `&` reference --> $DIR/borrowck-access-permissions.rs:56:23 | -LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389] +LL | let _y = &mut *foo_ref.f; | ^^^^^^^^^^ assignment into an immutable reference error: aborting due to 6 previous errors diff --git a/src/test/ui/borrowck/borrowck-access-permissions.mir.stderr b/src/test/ui/borrowck/borrowck-access-permissions.mir.stderr index 0d771a55d5995..12f9ad8276fa4 100644 --- a/src/test/ui/borrowck/borrowck-access-permissions.mir.stderr +++ b/src/test/ui/borrowck/borrowck-access-permissions.mir.stderr @@ -4,13 +4,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable LL | let x = 1; | - help: consider changing this to be mutable: `mut x` ... -LL | let _y1 = &mut x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut x; | ^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow immutable static item `static_x` as mutable --> $DIR/borrowck-access-permissions.rs:18:19 | -LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut static_x; | ^^^^^^^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable @@ -19,7 +19,7 @@ error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as m LL | let box_x = Box::new(1); | ----- help: consider changing this to be mutable: `mut box_x` ... -LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *box_x; | ^^^^^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference @@ -28,7 +28,7 @@ error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference LL | let ref_x = &x; | -- help: consider changing this to be a mutable reference: `&mut x` ... -LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *ref_x; | ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer @@ -37,7 +37,7 @@ error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` poin LL | let ptr_x : *const _ = &x; | -- help: consider changing this to be a mutable pointer: `&mut x` ... -LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596] +LL | let _y1 = &mut *ptr_x; | ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference @@ -45,7 +45,7 @@ error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` refer | LL | let foo_ref = &foo; | ---- help: consider changing this to be a mutable reference: `&mut foo` -LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389] +LL | let _y = &mut *foo_ref.f; | ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable error: aborting due to 6 previous errors diff --git a/src/test/ui/borrowck/borrowck-asm.ast.nll.stderr b/src/test/ui/borrowck/borrowck-asm.ast.nll.stderr index 86e4832b3873c..dd6e5ebe0ed3d 100644 --- a/src/test/ui/borrowck/borrowck-asm.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-asm.ast.nll.stderr @@ -7,7 +7,7 @@ LL | unsafe { LL | asm!("nop" : : "r"(x)); | - value moved here LL | } -LL | let z = x; //[ast]~ ERROR use of moved value: `x` +LL | let z = x; | ^ value used here after move error[E0503]: cannot use `x` because it was mutably borrowed @@ -16,7 +16,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let y = &mut x; | ------ borrow of `x` occurs here LL | unsafe { -LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use +LL | asm!("nop" : : "r"(x)); | ^ use of borrowed `x` ... LL | let z = y; @@ -31,7 +31,7 @@ LL | let x = 3; | first assignment to `x` | help: make this binding mutable: `mut x` LL | unsafe { -LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice +LL | asm!("nop" : "=r"(x)); | ^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -43,13 +43,13 @@ LL | let x = 3; | first assignment to `x` | help: make this binding mutable: `mut x` LL | unsafe { -LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice +LL | asm!("nop" : "+r"(x)); | ^ cannot assign twice to immutable variable error[E0381]: use of possibly uninitialized variable: `x` --> $DIR/borrowck-asm.rs:68:32 | -LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable +LL | asm!("nop" : "=*r"(x)); | ^ use of possibly uninitialized `x` error[E0506]: cannot assign to `x` because it is borrowed @@ -58,7 +58,7 @@ error[E0506]: cannot assign to `x` because it is borrowed LL | let y = &*x; | --- borrow of `x` occurs here LL | unsafe { -LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed +LL | asm!("nop" : "+r"(x)); | ^ assignment to borrowed `x` occurs here ... LL | let z = y; @@ -70,7 +70,7 @@ error[E0382]: use of moved value: `x` LL | let x = &mut 2; | - move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait LL | unsafe { -LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value +LL | asm!("nop" : : "r"(x), "r"(x) ); | - ^ value used here after move | | | value moved here diff --git a/src/test/ui/borrowck/borrowck-asm.ast.stderr b/src/test/ui/borrowck/borrowck-asm.ast.stderr index 73eb08b59b069..8418bb7c5afb6 100644 --- a/src/test/ui/borrowck/borrowck-asm.ast.stderr +++ b/src/test/ui/borrowck/borrowck-asm.ast.stderr @@ -4,7 +4,7 @@ error[E0382]: use of moved value: `x` LL | asm!("nop" : : "r"(x)); | - value moved here LL | } -LL | let z = x; //[ast]~ ERROR use of moved value: `x` +LL | let z = x; | ^ value used here after move | = note: move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait @@ -15,7 +15,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let y = &mut x; | - borrow of `x` occurs here LL | unsafe { -LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use +LL | asm!("nop" : : "r"(x)); | ^ use of borrowed `x` error[E0384]: cannot assign twice to immutable variable `x` @@ -24,7 +24,7 @@ error[E0384]: cannot assign twice to immutable variable `x` LL | let x = 3; | - first assignment to `x` LL | unsafe { -LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice +LL | asm!("nop" : "=r"(x)); | ^ cannot assign twice to immutable variable error[E0506]: cannot assign to `a` because it is borrowed @@ -33,7 +33,7 @@ error[E0506]: cannot assign to `a` because it is borrowed LL | let b = &*a; | -- borrow of `a` occurs here LL | unsafe { -LL | asm!("nop" : "=r"(a)); //[ast]~ ERROR cannot assign to `a` because it is borrowed +LL | asm!("nop" : "=r"(a)); | ^ assignment to borrowed `a` occurs here error[E0384]: cannot assign twice to immutable variable `x` @@ -42,13 +42,13 @@ error[E0384]: cannot assign twice to immutable variable `x` LL | let x = 3; | - first assignment to `x` LL | unsafe { -LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice +LL | asm!("nop" : "+r"(x)); | ^ cannot assign twice to immutable variable error[E0381]: use of possibly uninitialized variable: `x` --> $DIR/borrowck-asm.rs:68:32 | -LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable +LL | asm!("nop" : "=*r"(x)); | ^ use of possibly uninitialized `x` error[E0506]: cannot assign to `x` because it is borrowed @@ -57,13 +57,13 @@ error[E0506]: cannot assign to `x` because it is borrowed LL | let y = &*x; | -- borrow of `x` occurs here LL | unsafe { -LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed +LL | asm!("nop" : "+r"(x)); | ^ assignment to borrowed `x` occurs here error[E0382]: use of moved value: `x` --> $DIR/borrowck-asm.rs:86:40 | -LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value +LL | asm!("nop" : : "r"(x), "r"(x) ); | - ^ value used here after move | | | value moved here diff --git a/src/test/ui/borrowck/borrowck-asm.mir.stderr b/src/test/ui/borrowck/borrowck-asm.mir.stderr index 86e4832b3873c..dd6e5ebe0ed3d 100644 --- a/src/test/ui/borrowck/borrowck-asm.mir.stderr +++ b/src/test/ui/borrowck/borrowck-asm.mir.stderr @@ -7,7 +7,7 @@ LL | unsafe { LL | asm!("nop" : : "r"(x)); | - value moved here LL | } -LL | let z = x; //[ast]~ ERROR use of moved value: `x` +LL | let z = x; | ^ value used here after move error[E0503]: cannot use `x` because it was mutably borrowed @@ -16,7 +16,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let y = &mut x; | ------ borrow of `x` occurs here LL | unsafe { -LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use +LL | asm!("nop" : : "r"(x)); | ^ use of borrowed `x` ... LL | let z = y; @@ -31,7 +31,7 @@ LL | let x = 3; | first assignment to `x` | help: make this binding mutable: `mut x` LL | unsafe { -LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice +LL | asm!("nop" : "=r"(x)); | ^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -43,13 +43,13 @@ LL | let x = 3; | first assignment to `x` | help: make this binding mutable: `mut x` LL | unsafe { -LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice +LL | asm!("nop" : "+r"(x)); | ^ cannot assign twice to immutable variable error[E0381]: use of possibly uninitialized variable: `x` --> $DIR/borrowck-asm.rs:68:32 | -LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable +LL | asm!("nop" : "=*r"(x)); | ^ use of possibly uninitialized `x` error[E0506]: cannot assign to `x` because it is borrowed @@ -58,7 +58,7 @@ error[E0506]: cannot assign to `x` because it is borrowed LL | let y = &*x; | --- borrow of `x` occurs here LL | unsafe { -LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed +LL | asm!("nop" : "+r"(x)); | ^ assignment to borrowed `x` occurs here ... LL | let z = y; @@ -70,7 +70,7 @@ error[E0382]: use of moved value: `x` LL | let x = &mut 2; | - move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait LL | unsafe { -LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value +LL | asm!("nop" : : "r"(x), "r"(x) ); | - ^ value used here after move | | | value moved here diff --git a/src/test/ui/borrowck/borrowck-assign-comp.ast.nll.stderr b/src/test/ui/borrowck/borrowck-assign-comp.ast.nll.stderr index c204248d81a27..53af41cfe3103 100644 --- a/src/test/ui/borrowck/borrowck-assign-comp.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-assign-comp.ast.nll.stderr @@ -4,9 +4,9 @@ error[E0506]: cannot assign to `p.x` because it is borrowed LL | let q = &p; | -- borrow of `p.x` occurs here ... -LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x` +LL | p.x = 5; | ^^^^^^^ assignment to borrowed `p.x` occurs here -LL | //[mir]~^ ERROR cannot assign to `p.x` because it is borrowed +LL | LL | q.x; | --- borrow later used here @@ -15,7 +15,7 @@ error[E0506]: cannot assign to `p` because it is borrowed | LL | let q = &p.y; | ---- borrow of `p` occurs here -LL | p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p` +LL | p = Point {x: 5, y: 7}; | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here ... LL | *q; // stretch loan @@ -26,9 +26,9 @@ error[E0506]: cannot assign to `p.y` because it is borrowed | LL | let q = &p.y; | ---- borrow of `p.y` occurs here -LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y` +LL | p.y = 5; | ^^^^^^^ assignment to borrowed `p.y` occurs here -LL | //[mir]~^ ERROR cannot assign to `p.y` because it is borrowed +LL | LL | *q; | -- borrow later used here diff --git a/src/test/ui/borrowck/borrowck-assign-comp.ast.stderr b/src/test/ui/borrowck/borrowck-assign-comp.ast.stderr index 735c168d7df10..4adb19c4c3f0e 100644 --- a/src/test/ui/borrowck/borrowck-assign-comp.ast.stderr +++ b/src/test/ui/borrowck/borrowck-assign-comp.ast.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `p.x` because it is borrowed LL | let q = &p; | - borrow of `p.x` occurs here ... -LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x` +LL | p.x = 5; | ^^^^^^^ assignment to borrowed `p.x` occurs here error[E0506]: cannot assign to `p` because it is borrowed @@ -12,7 +12,7 @@ error[E0506]: cannot assign to `p` because it is borrowed | LL | let q = &p.y; | --- borrow of `p` occurs here -LL | p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p` +LL | p = Point {x: 5, y: 7}; | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here error[E0506]: cannot assign to `p.y` because it is borrowed @@ -20,7 +20,7 @@ error[E0506]: cannot assign to `p.y` because it is borrowed | LL | let q = &p.y; | --- borrow of `p.y` occurs here -LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y` +LL | p.y = 5; | ^^^^^^^ assignment to borrowed `p.y` occurs here error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/borrowck-assign-comp.mir.stderr b/src/test/ui/borrowck/borrowck-assign-comp.mir.stderr index c204248d81a27..53af41cfe3103 100644 --- a/src/test/ui/borrowck/borrowck-assign-comp.mir.stderr +++ b/src/test/ui/borrowck/borrowck-assign-comp.mir.stderr @@ -4,9 +4,9 @@ error[E0506]: cannot assign to `p.x` because it is borrowed LL | let q = &p; | -- borrow of `p.x` occurs here ... -LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x` +LL | p.x = 5; | ^^^^^^^ assignment to borrowed `p.x` occurs here -LL | //[mir]~^ ERROR cannot assign to `p.x` because it is borrowed +LL | LL | q.x; | --- borrow later used here @@ -15,7 +15,7 @@ error[E0506]: cannot assign to `p` because it is borrowed | LL | let q = &p.y; | ---- borrow of `p` occurs here -LL | p = Point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p` +LL | p = Point {x: 5, y: 7}; | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here ... LL | *q; // stretch loan @@ -26,9 +26,9 @@ error[E0506]: cannot assign to `p.y` because it is borrowed | LL | let q = &p.y; | ---- borrow of `p.y` occurs here -LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y` +LL | p.y = 5; | ^^^^^^^ assignment to borrowed `p.y` occurs here -LL | //[mir]~^ ERROR cannot assign to `p.y` because it is borrowed +LL | LL | *q; | -- borrow later used here diff --git a/src/test/ui/borrowck/borrowck-assign-to-constants.ast.nll.stderr b/src/test/ui/borrowck/borrowck-assign-to-constants.ast.nll.stderr index 0a30a490a643b..626e1ef8ad872 100644 --- a/src/test/ui/borrowck/borrowck-assign-to-constants.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-assign-to-constants.ast.nll.stderr @@ -1,7 +1,7 @@ error[E0594]: cannot assign to immutable static item `foo` --> $DIR/borrowck-assign-to-constants.rs:8:5 | -LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item +LL | foo = 6; | ^^^^^^^ cannot assign error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-assign-to-constants.ast.stderr b/src/test/ui/borrowck/borrowck-assign-to-constants.ast.stderr index 4111f55d9f2b2..e755785ef51b3 100644 --- a/src/test/ui/borrowck/borrowck-assign-to-constants.ast.stderr +++ b/src/test/ui/borrowck/borrowck-assign-to-constants.ast.stderr @@ -1,7 +1,7 @@ error[E0594]: cannot assign to immutable static item --> $DIR/borrowck-assign-to-constants.rs:8:5 | -LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item +LL | foo = 6; | ^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-assign-to-constants.mir.stderr b/src/test/ui/borrowck/borrowck-assign-to-constants.mir.stderr index 0a30a490a643b..626e1ef8ad872 100644 --- a/src/test/ui/borrowck/borrowck-assign-to-constants.mir.stderr +++ b/src/test/ui/borrowck/borrowck-assign-to-constants.mir.stderr @@ -1,7 +1,7 @@ error[E0594]: cannot assign to immutable static item `foo` --> $DIR/borrowck-assign-to-constants.rs:8:5 | -LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item +LL | foo = 6; | ^^^^^^^ cannot assign error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr b/src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr index 236064da3e8b6..60c8b33ba15d3 100644 --- a/src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr +++ b/src/test/ui/borrowck/borrowck-box-insensitivity.ast.stderr @@ -3,8 +3,8 @@ error[E0382]: use of moved value: `a` | LL | let _x = a.x; | -- value moved here -LL | //[ast]~^ value moved here -LL | let _y = a.y; //[ast]~ ERROR use of moved +LL | +LL | let _y = a.y; | ^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -14,8 +14,8 @@ error[E0382]: use of moved value: `a` | LL | let _x = a.x; | -- value moved here -LL | //[ast]~^ value moved here -LL | let _y = a.y; //[ast]~ ERROR use of moved +LL | +LL | let _y = a.y; | ^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -25,8 +25,8 @@ error[E0382]: use of moved value: `a` | LL | let _x = a.x; | -- value moved here -LL | //[ast]~^ value moved here -LL | let _y = &a.y; //[ast]~ ERROR use of moved +LL | +LL | let _y = &a.y; | ^^^ value used here after move | = note: move occurs because `a.x` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -44,7 +44,7 @@ error[E0503]: cannot use `a.y` because it was mutably borrowed | LL | let _x = &mut a.x; | --- borrow of `a.x` occurs here -LL | let _y = a.y; //[ast]~ ERROR cannot use +LL | let _y = a.y; | ^^ use of borrowed `a.x` error[E0505]: cannot move out of `a.y` because it is borrowed @@ -60,7 +60,7 @@ error[E0502]: cannot borrow `a` (via `a.y`) as immutable because `a` is also bor | LL | let _x = &mut a.x; | --- mutable borrow occurs here (via `a.x`) -LL | let _y = &a.y; //[ast]~ ERROR cannot borrow +LL | let _y = &a.y; | ^^^ immutable borrow of `a.y` -- which overlaps with `a.x` -- occurs here ... LL | } @@ -71,7 +71,7 @@ error[E0502]: cannot borrow `a` (via `a.y`) as mutable because `a` is also borro | LL | let _x = &a.x; | --- immutable borrow occurs here (via `a.x`) -LL | let _y = &mut a.y; //[ast]~ ERROR cannot borrow +LL | let _y = &mut a.y; | ^^^ mutable borrow of `a.y` -- which overlaps with `a.x` -- occurs here ... LL | } @@ -82,8 +82,8 @@ error[E0382]: use of collaterally moved value: `a.y` | LL | let _x = a.x.x; | -- value moved here -LL | //[ast]~^ value moved here -LL | let _y = a.y; //[ast]~ ERROR use of collaterally moved +LL | +LL | let _y = a.y; | ^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -93,8 +93,8 @@ error[E0382]: use of collaterally moved value: `a.y` | LL | let _x = a.x.x; | -- value moved here -LL | //[ast]~^ value moved here -LL | let _y = a.y; //[ast]~ ERROR use of collaterally moved +LL | +LL | let _y = a.y; | ^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -104,8 +104,8 @@ error[E0382]: use of collaterally moved value: `a.y` | LL | let _x = a.x.x; | -- value moved here -LL | //[ast]~^ value moved here -LL | let _y = &a.y; //[ast]~ ERROR use of collaterally moved +LL | +LL | let _y = &a.y; | ^^^ value used here after move | = note: move occurs because `a.x.x` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -115,7 +115,7 @@ error[E0505]: cannot move out of `a.y` because it is borrowed | LL | let _x = &a.x.x; | ----- borrow of `a.x.x` occurs here -LL | //[ast]~^ borrow of `a.x.x` occurs here +LL | LL | let _y = a.y; | ^^ move out of `a.y` occurs here @@ -124,7 +124,7 @@ error[E0503]: cannot use `a.y` because it was mutably borrowed | LL | let _x = &mut a.x.x; | ----- borrow of `a.x.x` occurs here -LL | let _y = a.y; //[ast]~ ERROR cannot use +LL | let _y = a.y; | ^^ use of borrowed `a.x.x` error[E0505]: cannot move out of `a.y` because it is borrowed @@ -140,8 +140,8 @@ error[E0502]: cannot borrow `a.y` as immutable because `a.x.x` is also borrowed | LL | let _x = &mut a.x.x; | ----- mutable borrow occurs here -LL | //[ast]~^ mutable borrow occurs here -LL | let _y = &a.y; //[ast]~ ERROR cannot borrow +LL | +LL | let _y = &a.y; | ^^^ immutable borrow occurs here ... LL | } @@ -152,8 +152,8 @@ error[E0502]: cannot borrow `a.y` as mutable because `a.x.x` is also borrowed as | LL | let _x = &a.x.x; | ----- immutable borrow occurs here -LL | //[ast]~^ immutable borrow occurs here -LL | let _y = &mut a.y; //[ast]~ ERROR cannot borrow +LL | +LL | let _y = &mut a.y; | ^^^ mutable borrow occurs here ... LL | } diff --git a/src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr b/src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr index 171e992e8a628..0e380e90e7591 100644 --- a/src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr +++ b/src/test/ui/borrowck/borrowck-box-insensitivity.mir.stderr @@ -1,7 +1,7 @@ error: compilation successful --> $DIR/borrowck-box-insensitivity.rs:160:1 | -LL | / fn main() { //[mir]~ ERROR compilation successful +LL | / fn main() { LL | | copy_after_move(); LL | | move_after_move(); LL | | borrow_after_move(); diff --git a/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr index ed3d1ff38ec77..aac5fdf62aaa4 100644 --- a/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr @@ -5,11 +5,11 @@ LL | let c1 = || x = 4; | -- - first borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || x * 5; | ^^ - second borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | drop(c1); | -- mutable borrow later used here @@ -20,11 +20,11 @@ LL | let c1 = || set(&mut x); | -- - first borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || get(&x); | ^^ - second borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | drop(c1); | -- mutable borrow later used here @@ -35,11 +35,11 @@ LL | let c1 = || set(&mut x); | -- - first borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || x * 5; | ^^ - second borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | drop(c1); | -- mutable borrow later used here @@ -50,9 +50,9 @@ LL | let c2 = || x * 5; | -- - borrow occurs due to use in closure | | | borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here -LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | LL | drop(c2); | -- borrow later used here @@ -63,9 +63,9 @@ LL | let c1 = || get(&x); | -- - borrow occurs due to use in closure | | | borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here -LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | LL | drop(c1); | -- borrow later used here @@ -76,9 +76,9 @@ LL | let c1 = || get(&*x); | -- - borrow occurs due to use in closure | | | borrow of `*x` occurs here -LL | *x = 5; //[ast]~ ERROR cannot assign to `*x` +LL | *x = 5; | ^^^^^^ assignment to borrowed `*x` occurs here -LL | //[mir]~^ ERROR cannot assign to `*x` because it is borrowed +LL | LL | drop(c1); | -- borrow later used here @@ -89,9 +89,9 @@ LL | let c1 = || get(&*x.f); | -- - borrow occurs due to use in closure | | | borrow of `*x.f` occurs here -LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f` +LL | *x.f = 5; | ^^^^^^^^ assignment to borrowed `*x.f` occurs here -LL | //[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed +LL | LL | drop(c1); | -- borrow later used here @@ -102,11 +102,11 @@ LL | let c1 = || get(&*x.f); | -- - first borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable +LL | let c2 = || *x.f = 5; | ^^ - second borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable +LL | LL | drop(c1); | -- immutable borrow later used here diff --git a/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.stderr b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.stderr index 363889c684626..d672d0ce0502c 100644 --- a/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.stderr +++ b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.stderr @@ -5,7 +5,7 @@ LL | let c1 = || x = 4; | -- - previous borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || x * 5; | ^^ - borrow occurs due to use of `x` in closure | | | immutable borrow occurs here @@ -20,7 +20,7 @@ LL | let c1 = || set(&mut x); | -- - previous borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || get(&x); | ^^ - borrow occurs due to use of `x` in closure | | | immutable borrow occurs here @@ -35,7 +35,7 @@ LL | let c1 = || set(&mut x); | -- - previous borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || x * 5; | ^^ - borrow occurs due to use of `x` in closure | | | immutable borrow occurs here @@ -48,7 +48,7 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | let c2 = || x * 5; | -- borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here error[E0506]: cannot assign to `x` because it is borrowed @@ -56,7 +56,7 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | let c1 = || get(&x); | -- borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here error[E0506]: cannot assign to `*x` because it is borrowed @@ -64,7 +64,7 @@ error[E0506]: cannot assign to `*x` because it is borrowed | LL | let c1 = || get(&*x); | -- borrow of `*x` occurs here -LL | *x = 5; //[ast]~ ERROR cannot assign to `*x` +LL | *x = 5; | ^^^^^^ assignment to borrowed `*x` occurs here error[E0506]: cannot assign to `*x.f` because it is borrowed @@ -72,7 +72,7 @@ error[E0506]: cannot assign to `*x.f` because it is borrowed | LL | let c1 = || get(&*x.f); | -- borrow of `*x.f` occurs here -LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f` +LL | *x.f = 5; | ^^^^^^^^ assignment to borrowed `*x.f` occurs here error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable @@ -82,7 +82,7 @@ LL | let c1 = || get(&*x.f); | -- - previous borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable +LL | let c2 = || *x.f = 5; | ^^ - borrow occurs due to use of `x` in closure | | | mutable borrow occurs here diff --git a/src/test/ui/borrowck/borrowck-closures-mut-and-imm.mir.stderr b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.mir.stderr index ed3d1ff38ec77..aac5fdf62aaa4 100644 --- a/src/test/ui/borrowck/borrowck-closures-mut-and-imm.mir.stderr +++ b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.mir.stderr @@ -5,11 +5,11 @@ LL | let c1 = || x = 4; | -- - first borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || x * 5; | ^^ - second borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | drop(c1); | -- mutable borrow later used here @@ -20,11 +20,11 @@ LL | let c1 = || set(&mut x); | -- - first borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || get(&x); | ^^ - second borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | drop(c1); | -- mutable borrow later used here @@ -35,11 +35,11 @@ LL | let c1 = || set(&mut x); | -- - first borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` +LL | let c2 = || x * 5; | ^^ - second borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | drop(c1); | -- mutable borrow later used here @@ -50,9 +50,9 @@ LL | let c2 = || x * 5; | -- - borrow occurs due to use in closure | | | borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here -LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | LL | drop(c2); | -- borrow later used here @@ -63,9 +63,9 @@ LL | let c1 = || get(&x); | -- - borrow occurs due to use in closure | | | borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here -LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | LL | drop(c1); | -- borrow later used here @@ -76,9 +76,9 @@ LL | let c1 = || get(&*x); | -- - borrow occurs due to use in closure | | | borrow of `*x` occurs here -LL | *x = 5; //[ast]~ ERROR cannot assign to `*x` +LL | *x = 5; | ^^^^^^ assignment to borrowed `*x` occurs here -LL | //[mir]~^ ERROR cannot assign to `*x` because it is borrowed +LL | LL | drop(c1); | -- borrow later used here @@ -89,9 +89,9 @@ LL | let c1 = || get(&*x.f); | -- - borrow occurs due to use in closure | | | borrow of `*x.f` occurs here -LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f` +LL | *x.f = 5; | ^^^^^^^^ assignment to borrowed `*x.f` occurs here -LL | //[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed +LL | LL | drop(c1); | -- borrow later used here @@ -102,11 +102,11 @@ LL | let c1 = || get(&*x.f); | -- - first borrow occurs due to use of `x` in closure | | | immutable borrow occurs here -LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable +LL | let c2 = || *x.f = 5; | ^^ - second borrow occurs due to use of `x` in closure | | | mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable +LL | LL | drop(c1); | -- immutable borrow later used here diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr index 24467faa90ca9..c6144695f7ae2 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr @@ -3,9 +3,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time | LL | let y = &mut x; | ------ first mutable borrow occurs here -LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time +LL | &mut x; | ^^^^^^ second mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | LL | *y = 1; | ------ first borrow later used here @@ -14,9 +14,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time | LL | let y = &mut x; | ------ first mutable borrow occurs here -LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time +LL | &mut x; | ^^^^^^ second mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | LL | *y = 1; | ------ first borrow later used here @@ -25,10 +25,10 @@ error: captured variable cannot escape `FnMut` closure body | LL | || { | - inferred to be a `FnMut` closure -LL | / || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body +LL | / || { LL | | let y = &mut x; -LL | | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time -LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | | &mut x; +LL | | LL | | *y = 1; LL | | drop(y); LL | | } @@ -42,9 +42,9 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed | LL | let x = f.x(); | - borrow of `f` occurs here -LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed +LL | f.x; | ^^^ use of borrowed `f` -LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -53,9 +53,9 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed | LL | let x = g.x(); | - borrow of `g` occurs here -LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed +LL | g.0; | ^^^ use of borrowed `g` -LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -64,9 +64,9 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed | LL | let x = &mut h.0; | -------- borrow of `h.0` occurs here -LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed +LL | h.0; | ^^^ use of borrowed `h.0` -LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -87,9 +87,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed | LL | let x = &mut u.a; | -------- borrow of `u.a` occurs here -LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed +LL | u.a; | ^^^ use of borrowed `u.a` -LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -98,9 +98,9 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed | LL | let x = f.x(); | - borrow of `*f` occurs here -LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed +LL | f.x; | ^^^ use of borrowed `*f` -LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -109,9 +109,9 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed | LL | let x = g.x(); | - borrow of `*g` occurs here -LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed +LL | g.0; | ^^^ use of borrowed `*g` -LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -120,9 +120,9 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed | LL | let x = &mut h.0; | -------- borrow of `h.0` occurs here -LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed +LL | h.0; | ^^^ use of borrowed `h.0` -LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -143,9 +143,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed | LL | let x = &mut u.a; | -------- borrow of `u.a` occurs here -LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed +LL | u.a; | ^^^ use of borrowed `u.a` -LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -372,7 +372,7 @@ error[E0382]: use of moved value: `x` | LL | drop(x); | - value moved here -LL | drop(x); //[ast]~ ERROR use of moved value: `x` +LL | drop(x); | ^ value used here after move | = note: move occurs because `x` has type `std::vec::Vec`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr index 278929eedb008..d892db8811ee2 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr @@ -3,7 +3,7 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed | LL | let x = f.x(); | - borrow of `f` occurs here -LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed +LL | f.x; | ^^^ use of borrowed `f` error[E0503]: cannot use `g.0` because it was mutably borrowed @@ -11,7 +11,7 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed | LL | let x = g.x(); | - borrow of `g` occurs here -LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed +LL | g.0; | ^^^ use of borrowed `g` error[E0503]: cannot use `h.0` because it was mutably borrowed @@ -19,7 +19,7 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed | LL | let x = &mut h.0; | --- borrow of `h.0` occurs here -LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed +LL | h.0; | ^^^ use of borrowed `h.0` error[E0503]: cannot use `e.0` because it was mutably borrowed @@ -36,7 +36,7 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed | LL | let x = &mut u.a; | --- borrow of `u.a` occurs here -LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed +LL | u.a; | ^^^ use of borrowed `u.a` error[E0503]: cannot use `f.x` because it was mutably borrowed @@ -44,7 +44,7 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed | LL | let x = f.x(); | - borrow of `*f` occurs here -LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed +LL | f.x; | ^^^ use of borrowed `*f` error[E0503]: cannot use `g.0` because it was mutably borrowed @@ -52,7 +52,7 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed | LL | let x = g.x(); | - borrow of `*g` occurs here -LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed +LL | g.0; | ^^^ use of borrowed `*g` error[E0503]: cannot use `h.0` because it was mutably borrowed @@ -60,7 +60,7 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed | LL | let x = &mut h.0; | --- borrow of `h.0` occurs here -LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed +LL | h.0; | ^^^ use of borrowed `h.0` error[E0503]: cannot use `e.0` because it was mutably borrowed @@ -77,7 +77,7 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed | LL | let x = &mut u.a; | --- borrow of `u.a` occurs here -LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed +LL | u.a; | ^^^ use of borrowed `u.a` error[E0503]: cannot use `v[..]` because it was mutably borrowed @@ -213,7 +213,7 @@ error[E0499]: cannot borrow `**x` as mutable more than once at a time | LL | let y = &mut x; | - first mutable borrow occurs here -LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time +LL | &mut x; | ^ second mutable borrow occurs here ... LL | }; @@ -224,7 +224,7 @@ error[E0499]: cannot borrow `**x` as mutable more than once at a time | LL | let y = &mut x; | - first mutable borrow occurs here -LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time +LL | &mut x; | ^ second mutable borrow occurs here ... LL | } @@ -235,7 +235,7 @@ error[E0382]: use of moved value: `x` | LL | drop(x); | - value moved here -LL | drop(x); //[ast]~ ERROR use of moved value: `x` +LL | drop(x); | ^ value used here after move | = note: move occurs because `x` has type `std::vec::Vec`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr index 279548f870fd0..af78340ffdf37 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr @@ -3,9 +3,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time | LL | let y = &mut x; | ------ first mutable borrow occurs here -LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time +LL | &mut x; | ^^^^^^ second mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | LL | *y = 1; | ------ first borrow later used here @@ -14,9 +14,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time | LL | let y = &mut x; | ------ first mutable borrow occurs here -LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time +LL | &mut x; | ^^^^^^ second mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | LL | *y = 1; | ------ first borrow later used here @@ -25,10 +25,10 @@ error: captured variable cannot escape `FnMut` closure body | LL | || { | - inferred to be a `FnMut` closure -LL | / || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body +LL | / || { LL | | let y = &mut x; -LL | | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time -LL | | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | | &mut x; +LL | | LL | | *y = 1; LL | | drop(y); LL | | } @@ -42,9 +42,9 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed | LL | let x = f.x(); | - borrow of `f` occurs here -LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed +LL | f.x; | ^^^ use of borrowed `f` -LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -53,9 +53,9 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed | LL | let x = g.x(); | - borrow of `g` occurs here -LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed +LL | g.0; | ^^^ use of borrowed `g` -LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -64,9 +64,9 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed | LL | let x = &mut h.0; | -------- borrow of `h.0` occurs here -LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed +LL | h.0; | ^^^ use of borrowed `h.0` -LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -87,9 +87,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed | LL | let x = &mut u.a; | -------- borrow of `u.a` occurs here -LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed +LL | u.a; | ^^^ use of borrowed `u.a` -LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -98,9 +98,9 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed | LL | let x = f.x(); | - borrow of `*f` occurs here -LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed +LL | f.x; | ^^^ use of borrowed `*f` -LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -109,9 +109,9 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed | LL | let x = g.x(); | - borrow of `*g` occurs here -LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed +LL | g.0; | ^^^ use of borrowed `*g` -LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -120,9 +120,9 @@ error[E0503]: cannot use `h.0` because it was mutably borrowed | LL | let x = &mut h.0; | -------- borrow of `h.0` occurs here -LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed +LL | h.0; | ^^^ use of borrowed `h.0` -LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -143,9 +143,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed | LL | let x = &mut u.a; | -------- borrow of `u.a` occurs here -LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed +LL | u.a; | ^^^ use of borrowed `u.a` -LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | LL | drop(x); | - borrow later used here @@ -366,7 +366,7 @@ error[E0382]: use of moved value: `x` | LL | drop(x); | - value moved here -LL | drop(x); //[ast]~ ERROR use of moved value: `x` +LL | drop(x); | ^ value used here after move | = note: move occurs because `x` has type `std::vec::Vec`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-fn-in-const-a.ast.stderr b/src/test/ui/borrowck/borrowck-fn-in-const-a.ast.stderr index 6a5c5047fb237..16c62fc1c7ef3 100644 --- a/src/test/ui/borrowck/borrowck-fn-in-const-a.ast.stderr +++ b/src/test/ui/borrowck/borrowck-fn-in-const-a.ast.stderr @@ -1,7 +1,7 @@ error[E0507]: cannot move out of borrowed content --> $DIR/borrowck-fn-in-const-a.rs:9:16 | -LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507] +LL | return *x | ^^ cannot move out of borrowed content error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-fn-in-const-a.mir.stderr b/src/test/ui/borrowck/borrowck-fn-in-const-a.mir.stderr index 6a5c5047fb237..16c62fc1c7ef3 100644 --- a/src/test/ui/borrowck/borrowck-fn-in-const-a.mir.stderr +++ b/src/test/ui/borrowck/borrowck-fn-in-const-a.mir.stderr @@ -1,7 +1,7 @@ error[E0507]: cannot move out of borrowed content --> $DIR/borrowck-fn-in-const-a.rs:9:16 | -LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507] +LL | return *x | ^^ cannot move out of borrowed content error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr index d3708b5cf2bbb..88b43c1350b47 100644 --- a/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `_a` because it is borrowed LL | let b = &mut _a; | ------- borrow of `_a` occurs here ... -LL | _a = 4; //[ast]~ ERROR cannot assign to `_a` +LL | _a = 4; | ^^^^^^ assignment to borrowed `_a` occurs here ... LL | drop(b); diff --git a/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr index 618edf57bb26e..43c3c3371ff9a 100644 --- a/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr +++ b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `_a` because it is borrowed LL | let b = &mut _a; | -- borrow of `_a` occurs here ... -LL | _a = 4; //[ast]~ ERROR cannot assign to `_a` +LL | _a = 4; | ^^^^^^ assignment to borrowed `_a` occurs here error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr index d3708b5cf2bbb..88b43c1350b47 100644 --- a/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr +++ b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `_a` because it is borrowed LL | let b = &mut _a; | ------- borrow of `_a` occurs here ... -LL | _a = 4; //[ast]~ ERROR cannot assign to `_a` +LL | _a = 4; | ^^^^^^ assignment to borrowed `_a` occurs here ... LL | drop(b); diff --git a/src/test/ui/borrowck/borrowck-issue-14498.ast.nll.stderr b/src/test/ui/borrowck/borrowck-issue-14498.ast.nll.stderr index 81610536c52b8..b53cfddbe9386 100644 --- a/src/test/ui/borrowck/borrowck-issue-14498.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-issue-14498.ast.nll.stderr @@ -3,7 +3,7 @@ error[E0594]: cannot assign to `***p` which is behind a `&` reference | LL | let p = &y; | -- help: consider changing this to be a mutable reference: `&mut y` -LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference +LL | ***p = 2; | ^^^^^^^^ `p` is a `&` reference, so the data it refers to cannot be written error[E0506]: cannot assign to `**y` because it is borrowed @@ -12,9 +12,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | -- borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -24,9 +24,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | -- borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -36,9 +36,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | -- borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -48,9 +48,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | -- borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -60,9 +60,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | ---- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -72,9 +72,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | ---- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -84,9 +84,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | ---- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -96,9 +96,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | ---- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | LL | drop(p); | - borrow later used here diff --git a/src/test/ui/borrowck/borrowck-issue-14498.ast.stderr b/src/test/ui/borrowck/borrowck-issue-14498.ast.stderr index 59249dadcb0a6..b002ee79083df 100644 --- a/src/test/ui/borrowck/borrowck-issue-14498.ast.stderr +++ b/src/test/ui/borrowck/borrowck-issue-14498.ast.stderr @@ -1,7 +1,7 @@ error[E0389]: cannot assign to data in a `&` reference --> $DIR/borrowck-issue-14498.rs:19:5 | -LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference +LL | ***p = 2; | ^^^^^^^^ assignment into an immutable reference error[E0506]: cannot assign to `**y` because it is borrowed @@ -10,7 +10,7 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | - borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here error[E0506]: cannot assign to `**y` because it is borrowed @@ -19,7 +19,7 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | - borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here error[E0506]: cannot assign to `**y` because it is borrowed @@ -28,7 +28,7 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | - borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here error[E0506]: cannot assign to `**y` because it is borrowed @@ -37,7 +37,7 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | - borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here error[E0506]: cannot assign to `**y.a` because it is borrowed @@ -46,7 +46,7 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | --- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here error[E0506]: cannot assign to `**y.a` because it is borrowed @@ -55,7 +55,7 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | --- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here error[E0506]: cannot assign to `**y.a` because it is borrowed @@ -64,7 +64,7 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | --- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here error[E0506]: cannot assign to `**y.a` because it is borrowed @@ -73,7 +73,7 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | --- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here error: aborting due to 9 previous errors diff --git a/src/test/ui/borrowck/borrowck-issue-14498.mir.stderr b/src/test/ui/borrowck/borrowck-issue-14498.mir.stderr index 81610536c52b8..b53cfddbe9386 100644 --- a/src/test/ui/borrowck/borrowck-issue-14498.mir.stderr +++ b/src/test/ui/borrowck/borrowck-issue-14498.mir.stderr @@ -3,7 +3,7 @@ error[E0594]: cannot assign to `***p` which is behind a `&` reference | LL | let p = &y; | -- help: consider changing this to be a mutable reference: `&mut y` -LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference +LL | ***p = 2; | ^^^^^^^^ `p` is a `&` reference, so the data it refers to cannot be written error[E0506]: cannot assign to `**y` because it is borrowed @@ -12,9 +12,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | -- borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -24,9 +24,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | -- borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -36,9 +36,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | -- borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -48,9 +48,9 @@ error[E0506]: cannot assign to `**y` because it is borrowed LL | let p = &y; | -- borrow of `**y` occurs here LL | let q = &***p; -LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed +LL | **y = 2; | ^^^^^^^ assignment to borrowed `**y` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -60,9 +60,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | ---- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -72,9 +72,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | ---- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -84,9 +84,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | ---- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | LL | drop(p); | - borrow later used here @@ -96,9 +96,9 @@ error[E0506]: cannot assign to `**y.a` because it is borrowed LL | let p = &y.a; | ---- borrow of `**y.a` occurs here LL | let q = &***p; -LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed +LL | **y.a = 2; | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | LL | drop(p); | - borrow later used here diff --git a/src/test/ui/borrowck/borrowck-lend-flow-loop.ast.stderr b/src/test/ui/borrowck/borrowck-lend-flow-loop.ast.stderr index 1844d8275999d..ab10caa8e31b4 100644 --- a/src/test/ui/borrowck/borrowck-lend-flow-loop.ast.stderr +++ b/src/test/ui/borrowck/borrowck-lend-flow-loop.ast.stderr @@ -4,7 +4,7 @@ error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mu LL | let mut x = &mut v; | - mutable borrow occurs here ... -LL | borrow(&*v); //[ast]~ ERROR cannot borrow +LL | borrow(&*v); | ^^ immutable borrow occurs here LL | } LL | } @@ -16,7 +16,7 @@ error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mu LL | let mut x = &mut v; | - mutable borrow occurs here LL | for _ in 0..3 { -LL | borrow(&*v); //[ast]~ ERROR cannot borrow +LL | borrow(&*v); | ^^ immutable borrow occurs here ... LL | } @@ -25,7 +25,7 @@ LL | } error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable --> $DIR/borrowck-lend-flow-loop.rs:57:25 | -LL | borrow_mut(&mut *v); //[ast]~ ERROR cannot borrow +LL | borrow_mut(&mut *v); | ^^ mutable borrow occurs here LL | _x = &v; | - immutable borrow occurs here @@ -36,7 +36,7 @@ LL | } error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable --> $DIR/borrowck-lend-flow-loop.rs:69:25 | -LL | borrow_mut(&mut *v); //[ast]~ ERROR cannot borrow +LL | borrow_mut(&mut *v); | ^^ mutable borrow occurs here LL | _x = &v; | - immutable borrow occurs here @@ -50,7 +50,7 @@ error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immu LL | _x = &v; | - immutable borrow occurs here ... -LL | borrow_mut(&mut *v); //[ast]~ ERROR cannot borrow +LL | borrow_mut(&mut *v); | ^^ mutable borrow occurs here LL | } | - immutable borrow ends here @@ -61,7 +61,7 @@ error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immu LL | _x = &v; | - immutable borrow occurs here ... -LL | borrow_mut(&mut *v); //[ast]~ ERROR cannot borrow +LL | borrow_mut(&mut *v); | ^^ mutable borrow occurs here LL | } | - immutable borrow ends here @@ -69,10 +69,10 @@ LL | } error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable --> $DIR/borrowck-lend-flow-loop.rs:109:17 | -LL | borrow(&*v); //[ast]~ ERROR cannot borrow +LL | borrow(&*v); | ^^ immutable borrow occurs here ... -LL | x = &mut v; //[ast]~ ERROR cannot borrow +LL | x = &mut v; | - mutable borrow occurs here ... LL | } @@ -81,7 +81,7 @@ LL | } error[E0499]: cannot borrow `v` as mutable more than once at a time --> $DIR/borrowck-lend-flow-loop.rs:112:22 | -LL | x = &mut v; //[ast]~ ERROR cannot borrow +LL | x = &mut v; | ^ mutable borrow starts here in previous iteration of loop ... LL | } diff --git a/src/test/ui/borrowck/borrowck-lend-flow-loop.nll.stderr b/src/test/ui/borrowck/borrowck-lend-flow-loop.nll.stderr index 396fd6ffa0c6b..6dd6c1fc26ad0 100644 --- a/src/test/ui/borrowck/borrowck-lend-flow-loop.nll.stderr +++ b/src/test/ui/borrowck/borrowck-lend-flow-loop.nll.stderr @@ -4,7 +4,7 @@ error[E0502]: cannot borrow `*v` as immutable because it is also borrowed as mut LL | let mut x = &mut v; | ------ mutable borrow occurs here LL | for _ in 0..3 { -LL | borrow(&*v); //[ast]~ ERROR cannot borrow +LL | borrow(&*v); | ^^^ immutable borrow occurs here ... LL | *x = box 5; @@ -15,10 +15,10 @@ error[E0502]: cannot borrow `*v` as immutable because it is also borrowed as mut | LL | **x += 1; | -------- mutable borrow later used here -LL | borrow(&*v); //[ast]~ ERROR cannot borrow +LL | borrow(&*v); | ^^^ immutable borrow occurs here ... -LL | x = &mut v; //[ast]~ ERROR cannot borrow +LL | x = &mut v; | ------ mutable borrow occurs here error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/borrowck-lend-flow-match.ast.nll.stderr b/src/test/ui/borrowck/borrowck-lend-flow-match.ast.nll.stderr index 02289e0f4ec98..734f965195c27 100644 --- a/src/test/ui/borrowck/borrowck-lend-flow-match.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-lend-flow-match.ast.nll.stderr @@ -3,9 +3,9 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | Some(ref r) => { | ----- borrow of `x` occurs here -LL | x = Some(1); //[ast]~ ERROR cannot assign +LL | x = Some(1); | ^^^^^^^^^^^ assignment to borrowed `x` occurs here -LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | LL | drop(r); | - borrow later used here diff --git a/src/test/ui/borrowck/borrowck-lend-flow-match.ast.stderr b/src/test/ui/borrowck/borrowck-lend-flow-match.ast.stderr index 23eb814788f65..236bc11f2bb37 100644 --- a/src/test/ui/borrowck/borrowck-lend-flow-match.ast.stderr +++ b/src/test/ui/borrowck/borrowck-lend-flow-match.ast.stderr @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | Some(ref r) => { | ----- borrow of `x` occurs here -LL | x = Some(1); //[ast]~ ERROR cannot assign +LL | x = Some(1); | ^^^^^^^^^^^ assignment to borrowed `x` occurs here error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-lend-flow-match.mir.stderr b/src/test/ui/borrowck/borrowck-lend-flow-match.mir.stderr index 02289e0f4ec98..734f965195c27 100644 --- a/src/test/ui/borrowck/borrowck-lend-flow-match.mir.stderr +++ b/src/test/ui/borrowck/borrowck-lend-flow-match.mir.stderr @@ -3,9 +3,9 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | Some(ref r) => { | ----- borrow of `x` occurs here -LL | x = Some(1); //[ast]~ ERROR cannot assign +LL | x = Some(1); | ^^^^^^^^^^^ assignment to borrowed `x` occurs here -LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | LL | drop(r); | - borrow later used here diff --git a/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.nll.stderr b/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.nll.stderr index b2b82fba5b064..ecbfeec822cc7 100644 --- a/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.nll.stderr @@ -4,7 +4,7 @@ error[E0503]: cannot use `foo` because it was mutably borrowed LL | let p = &mut foo; | -------- borrow of `foo` occurs here LL | let _ = match foo { -LL | Foo::B => 1, //[mir]~ ERROR [E0503] +LL | Foo::B => 1, | ^^^^^^ use of borrowed `foo` ... LL | drop(p); @@ -16,7 +16,7 @@ error[E0503]: cannot use `foo.0` because it was mutably borrowed LL | let p = &mut foo; | -------- borrow of `foo` occurs here ... -LL | Foo::A(x) => x //[ast]~ ERROR [E0503] +LL | Foo::A(x) => x | ^ use of borrowed `foo` ... LL | drop(p); @@ -28,7 +28,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let r = &mut x; | ------ borrow of `x` occurs here LL | let _ = match x { -LL | x => x + 1, //[ast]~ ERROR [E0503] +LL | x => x + 1, | ^ use of borrowed `x` ... LL | drop(r); @@ -40,7 +40,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let r = &mut x; | ------ borrow of `x` occurs here ... -LL | y => y + 2, //[ast]~ ERROR [E0503] +LL | y => y + 2, | ^ use of borrowed `x` ... LL | drop(r); diff --git a/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.stderr b/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.stderr index cfbbef93f1f99..a5da1fc5b2067 100644 --- a/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.stderr +++ b/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.stderr @@ -4,7 +4,7 @@ error[E0503]: cannot use `(foo as Foo::A).0` because it was mutably borrowed LL | let p = &mut foo; | --- borrow of `foo` occurs here ... -LL | Foo::A(x) => x //[ast]~ ERROR [E0503] +LL | Foo::A(x) => x | ^ use of borrowed `foo` error[E0503]: cannot use `x` because it was mutably borrowed @@ -13,7 +13,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let r = &mut x; | - borrow of `x` occurs here LL | let _ = match x { -LL | x => x + 1, //[ast]~ ERROR [E0503] +LL | x => x + 1, | ^ use of borrowed `x` error[E0503]: cannot use `x` because it was mutably borrowed @@ -22,7 +22,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let r = &mut x; | - borrow of `x` occurs here ... -LL | y => y + 2, //[ast]~ ERROR [E0503] +LL | y => y + 2, | ^ use of borrowed `x` error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/borrowck-match-already-borrowed.mir.stderr b/src/test/ui/borrowck/borrowck-match-already-borrowed.mir.stderr index b2b82fba5b064..ecbfeec822cc7 100644 --- a/src/test/ui/borrowck/borrowck-match-already-borrowed.mir.stderr +++ b/src/test/ui/borrowck/borrowck-match-already-borrowed.mir.stderr @@ -4,7 +4,7 @@ error[E0503]: cannot use `foo` because it was mutably borrowed LL | let p = &mut foo; | -------- borrow of `foo` occurs here LL | let _ = match foo { -LL | Foo::B => 1, //[mir]~ ERROR [E0503] +LL | Foo::B => 1, | ^^^^^^ use of borrowed `foo` ... LL | drop(p); @@ -16,7 +16,7 @@ error[E0503]: cannot use `foo.0` because it was mutably borrowed LL | let p = &mut foo; | -------- borrow of `foo` occurs here ... -LL | Foo::A(x) => x //[ast]~ ERROR [E0503] +LL | Foo::A(x) => x | ^ use of borrowed `foo` ... LL | drop(p); @@ -28,7 +28,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let r = &mut x; | ------ borrow of `x` occurs here LL | let _ = match x { -LL | x => x + 1, //[ast]~ ERROR [E0503] +LL | x => x + 1, | ^ use of borrowed `x` ... LL | drop(r); @@ -40,7 +40,7 @@ error[E0503]: cannot use `x` because it was mutably borrowed LL | let r = &mut x; | ------ borrow of `x` occurs here ... -LL | y => y + 2, //[ast]~ ERROR [E0503] +LL | y => y + 2, | ^ use of borrowed `x` ... LL | drop(r); diff --git a/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr index cd88d69323895..2ac05393e02cb 100644 --- a/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr @@ -6,7 +6,7 @@ LL | x => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -17,7 +17,7 @@ LL | E::Foo(x) => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -28,7 +28,7 @@ LL | S { bar: x } => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -39,7 +39,7 @@ LL | (x,) => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -50,7 +50,7 @@ LL | [x,_,_] => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error: aborting due to 5 previous errors diff --git a/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.stderr b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.stderr index e7bd9dfee12f4..5f43302e0ef2a 100644 --- a/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.stderr +++ b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.stderr @@ -3,7 +3,7 @@ error[E0384]: cannot assign twice to immutable variable `x` | LL | x => { | - first assignment to `x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -11,7 +11,7 @@ error[E0384]: cannot assign twice to immutable variable `x` | LL | E::Foo(x) => { | - first assignment to `x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -19,7 +19,7 @@ error[E0384]: cannot assign twice to immutable variable `x` | LL | S { bar: x } => { | - first assignment to `x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -27,7 +27,7 @@ error[E0384]: cannot assign twice to immutable variable `x` | LL | (x,) => { | - first assignment to `x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -35,7 +35,7 @@ error[E0384]: cannot assign twice to immutable variable `x` | LL | [x,_,_] => { | - first assignment to `x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error: aborting due to 5 previous errors diff --git a/src/test/ui/borrowck/borrowck-match-binding-is-assignment.mir.stderr b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.mir.stderr index cd88d69323895..2ac05393e02cb 100644 --- a/src/test/ui/borrowck/borrowck-match-binding-is-assignment.mir.stderr +++ b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.mir.stderr @@ -6,7 +6,7 @@ LL | x => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -17,7 +17,7 @@ LL | E::Foo(x) => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -28,7 +28,7 @@ LL | S { bar: x } => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -39,7 +39,7 @@ LL | (x,) => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `x` @@ -50,7 +50,7 @@ LL | [x,_,_] => { | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error: aborting due to 5 previous errors diff --git a/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr index 0789926563ce7..874c38cb789b3 100644 --- a/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr @@ -8,7 +8,7 @@ LL | call_f(move|| { *t + 1 }); | ------ - variable moved due to use in closure | | | value moved into closure here -LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value +LL | call_f(move|| { *t + 1 }); | ^^^^^^ - use occurs due to use in closure | | | value used here after move diff --git a/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.stderr b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.stderr index 308dac8329294..48651eeae208e 100644 --- a/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.stderr +++ b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.stderr @@ -3,7 +3,7 @@ error[E0382]: capture of moved value: `t` | LL | call_f(move|| { *t + 1 }); | ------ value moved (into closure) here -LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value +LL | call_f(move|| { *t + 1 }); | ^ value captured here after move | = note: move occurs because `t` has type `std::boxed::Box`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.mir.stderr b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.mir.stderr index 0789926563ce7..874c38cb789b3 100644 --- a/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.mir.stderr +++ b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.mir.stderr @@ -8,7 +8,7 @@ LL | call_f(move|| { *t + 1 }); | ------ - variable moved due to use in closure | | | value moved into closure here -LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value +LL | call_f(move|| { *t + 1 }); | ^^^^^^ - use occurs due to use in closure | | | value used here after move diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array.ast.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array.ast.stderr index f866ff9e9bae1..88a1ab2f90651 100644 --- a/src/test/ui/borrowck/borrowck-move-out-from-array.ast.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-from-array.ast.stderr @@ -3,7 +3,7 @@ error[E0382]: use of moved value: `a[..]` | LL | let [_, _x] = a; | -- value moved here -LL | let [.., _y] = a; //[ast]~ ERROR [E0382] +LL | let [.., _y] = a; | ^^ value used here after move | = note: move occurs because `a[..]` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -13,7 +13,7 @@ error[E0382]: use of moved value: `a[..]` | LL | let [_x, _] = a; | -- value moved here -LL | let [_y..] = a; //[ast]~ ERROR [E0382] +LL | let [_y..] = a; | ^^ value used here after move | = note: move occurs because `a[..]` has type `std::boxed::Box`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array.mir.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array.mir.stderr index f866ff9e9bae1..88a1ab2f90651 100644 --- a/src/test/ui/borrowck/borrowck-move-out-from-array.mir.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-from-array.mir.stderr @@ -3,7 +3,7 @@ error[E0382]: use of moved value: `a[..]` | LL | let [_, _x] = a; | -- value moved here -LL | let [.., _y] = a; //[ast]~ ERROR [E0382] +LL | let [.., _y] = a; | ^^ value used here after move | = note: move occurs because `a[..]` has type `std::boxed::Box`, which does not implement the `Copy` trait @@ -13,7 +13,7 @@ error[E0382]: use of moved value: `a[..]` | LL | let [_x, _] = a; | -- value moved here -LL | let [_y..] = a; //[ast]~ ERROR [E0382] +LL | let [_y..] = a; | ^^ value used here after move | = note: move occurs because `a[..]` has type `std::boxed::Box`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-move-out-of-static-item.ast.stderr b/src/test/ui/borrowck/borrowck-move-out-of-static-item.ast.stderr index 752d5330e0279..26d06c081dc02 100644 --- a/src/test/ui/borrowck/borrowck-move-out-of-static-item.ast.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-of-static-item.ast.stderr @@ -1,7 +1,7 @@ error[E0507]: cannot move out of static item --> $DIR/borrowck-move-out-of-static-item.rs:18:10 | -LL | test(BAR); //[ast]~ ERROR cannot move out of static item [E0507] +LL | test(BAR); | ^^^ cannot move out of static item error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-move-out-of-static-item.mir.stderr b/src/test/ui/borrowck/borrowck-move-out-of-static-item.mir.stderr index 752d5330e0279..26d06c081dc02 100644 --- a/src/test/ui/borrowck/borrowck-move-out-of-static-item.mir.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-of-static-item.mir.stderr @@ -1,7 +1,7 @@ error[E0507]: cannot move out of static item --> $DIR/borrowck-move-out-of-static-item.rs:18:10 | -LL | test(BAR); //[ast]~ ERROR cannot move out of static item [E0507] +LL | test(BAR); | ^^^ cannot move out of static item error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr b/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr index 7025ce08fedf6..c1c04ca91422e 100644 --- a/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr @@ -3,7 +3,7 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait | LL | match (S {f:"foo".to_string()}) { | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here -LL | //[mir]~^ ERROR [E0509] +LL | LL | S {f:_s} => {} | -- data moved here | diff --git a/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr b/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr index 7025ce08fedf6..c1c04ca91422e 100644 --- a/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr +++ b/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr @@ -3,7 +3,7 @@ error[E0509]: cannot move out of type `S`, which implements the `Drop` trait | LL | match (S {f:"foo".to_string()}) { | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here -LL | //[mir]~^ ERROR [E0509] +LL | LL | S {f:_s} => {} | -- data moved here | diff --git a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr index 0f07776533608..a6e7d74af1d4e 100644 --- a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr @@ -1,30 +1,30 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:13:30 | -LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | 1 => { addr.push(&mut x); } | ---- ^^^^^^ second mutable borrow occurs here | | | first borrow later used here ... -LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | _ => { addr.push(&mut x); } | ------ first mutable borrow occurs here error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:15:30 | -LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | 1 => { addr.push(&mut x); } | ---- first borrow later used here -LL | //[mir]~^ ERROR [E0499] -LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | +LL | 2 => { addr.push(&mut x); } | ^^^^^^ second mutable borrow occurs here -LL | //[mir]~^ ERROR [E0499] -LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | +LL | _ => { addr.push(&mut x); } | ------ first mutable borrow occurs here error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:17:30 | -LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | _ => { addr.push(&mut x); } | ^^^^^^ mutable borrow starts here in previous iteration of loop error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr index dafb60c959afd..cee61db38f306 100644 --- a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr +++ b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr @@ -1,7 +1,7 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:13:35 | -LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | 1 => { addr.push(&mut x); } | ^ mutable borrow starts here in previous iteration of loop ... LL | } @@ -10,10 +10,10 @@ LL | } error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:15:35 | -LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | 1 => { addr.push(&mut x); } | - first mutable borrow occurs here -LL | //[mir]~^ ERROR [E0499] -LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | +LL | 2 => { addr.push(&mut x); } | ^ second mutable borrow occurs here ... LL | } @@ -22,10 +22,10 @@ LL | } error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:17:35 | -LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | 1 => { addr.push(&mut x); } | - first mutable borrow occurs here ... -LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | _ => { addr.push(&mut x); } | ^ second mutable borrow occurs here ... LL | } diff --git a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr index 0f07776533608..a6e7d74af1d4e 100644 --- a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr +++ b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr @@ -1,30 +1,30 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:13:30 | -LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | 1 => { addr.push(&mut x); } | ---- ^^^^^^ second mutable borrow occurs here | | | first borrow later used here ... -LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | _ => { addr.push(&mut x); } | ------ first mutable borrow occurs here error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:15:30 | -LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | 1 => { addr.push(&mut x); } | ---- first borrow later used here -LL | //[mir]~^ ERROR [E0499] -LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | +LL | 2 => { addr.push(&mut x); } | ^^^^^^ second mutable borrow occurs here -LL | //[mir]~^ ERROR [E0499] -LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | +LL | _ => { addr.push(&mut x); } | ------ first mutable borrow occurs here error[E0499]: cannot borrow `x` as mutable more than once at a time --> $DIR/borrowck-mut-borrow-linear-errors.rs:17:30 | -LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] +LL | _ => { addr.push(&mut x); } | ^^^^^^ mutable borrow starts here in previous iteration of loop error: aborting due to 3 previous errors diff --git a/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr b/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr index d65ba12295d5d..f0e16838c8aa8 100644 --- a/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr @@ -4,9 +4,9 @@ error[E0506]: cannot assign to `x` because it is borrowed LL | Some(ref i) => { | ----- borrow of `x` occurs here LL | // But on this branch, `i` is an outstanding borrow -LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x` +LL | x = Some(*i+1); | ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here -LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | LL | drop(i); | - borrow later used here diff --git a/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.stderr b/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.stderr index 207f971acff7d..d7bce40edcf0c 100644 --- a/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.stderr +++ b/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `x` because it is borrowed LL | Some(ref i) => { | ----- borrow of `x` occurs here LL | // But on this branch, `i` is an outstanding borrow -LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x` +LL | x = Some(*i+1); | ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-pat-reassign-binding.mir.stderr b/src/test/ui/borrowck/borrowck-pat-reassign-binding.mir.stderr index d65ba12295d5d..f0e16838c8aa8 100644 --- a/src/test/ui/borrowck/borrowck-pat-reassign-binding.mir.stderr +++ b/src/test/ui/borrowck/borrowck-pat-reassign-binding.mir.stderr @@ -4,9 +4,9 @@ error[E0506]: cannot assign to `x` because it is borrowed LL | Some(ref i) => { | ----- borrow of `x` occurs here LL | // But on this branch, `i` is an outstanding borrow -LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x` +LL | x = Some(*i+1); | ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here -LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | LL | drop(i); | - borrow later used here diff --git a/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr index 34d08a026dd35..d2b6e06056917 100644 --- a/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr @@ -1,9 +1,9 @@ error[E0712]: thread-local variable borrowed past end of function --> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:11:20 | -LL | assert_static(&FOO); //[ast]~ ERROR [E0597] +LL | assert_static(&FOO); | ^^^^ thread-local variables cannot be borrowed beyond the end of the function -LL | //[mir]~^ ERROR [E0712] +LL | LL | } | - end of enclosing function is here diff --git a/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr index 4724f1772bafd..ce7b5e681c69d 100644 --- a/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr +++ b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr @@ -1,7 +1,7 @@ error[E0597]: borrowed value does not live long enough --> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:11:21 | -LL | assert_static(&FOO); //[ast]~ ERROR [E0597] +LL | assert_static(&FOO); | ^^^ - borrowed value only lives until here | | | borrowed value does not live long enough diff --git a/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr index 34d08a026dd35..d2b6e06056917 100644 --- a/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr +++ b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr @@ -1,9 +1,9 @@ error[E0712]: thread-local variable borrowed past end of function --> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:11:20 | -LL | assert_static(&FOO); //[ast]~ ERROR [E0597] +LL | assert_static(&FOO); | ^^^^ thread-local variables cannot be borrowed beyond the end of the function -LL | //[mir]~^ ERROR [E0712] +LL | LL | } | - end of enclosing function is here diff --git a/src/test/ui/borrowck/borrowck-unary-move.ast.nll.stderr b/src/test/ui/borrowck/borrowck-unary-move.ast.nll.stderr index 53dc6a77887d4..c29ff5383043c 100644 --- a/src/test/ui/borrowck/borrowck-unary-move.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-unary-move.ast.nll.stderr @@ -3,9 +3,9 @@ error[E0505]: cannot move out of `x` because it is borrowed | LL | let y = &*x; | --- borrow of `*x` occurs here -LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed +LL | free(x); | ^ move out of `x` occurs here -LL | //[mir]~^ ERROR cannot move out of `x` because it is borrowed +LL | LL | *y | -- borrow later used here diff --git a/src/test/ui/borrowck/borrowck-unary-move.ast.stderr b/src/test/ui/borrowck/borrowck-unary-move.ast.stderr index 9383298af9bfe..e05b110a2c011 100644 --- a/src/test/ui/borrowck/borrowck-unary-move.ast.stderr +++ b/src/test/ui/borrowck/borrowck-unary-move.ast.stderr @@ -3,7 +3,7 @@ error[E0505]: cannot move out of `x` because it is borrowed | LL | let y = &*x; | -- borrow of `*x` occurs here -LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed +LL | free(x); | ^ move out of `x` occurs here error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-unary-move.mir.stderr b/src/test/ui/borrowck/borrowck-unary-move.mir.stderr index 53dc6a77887d4..c29ff5383043c 100644 --- a/src/test/ui/borrowck/borrowck-unary-move.mir.stderr +++ b/src/test/ui/borrowck/borrowck-unary-move.mir.stderr @@ -3,9 +3,9 @@ error[E0505]: cannot move out of `x` because it is borrowed | LL | let y = &*x; | --- borrow of `*x` occurs here -LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed +LL | free(x); | ^ move out of `x` occurs here -LL | //[mir]~^ ERROR cannot move out of `x` because it is borrowed +LL | LL | *y | -- borrow later used here diff --git a/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr index 99cbf64fd5d46..a6e5f0b0e9db7 100644 --- a/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr @@ -1,7 +1,7 @@ error[E0381]: use of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-field-access.rs:24:13 | -LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` +LL | let _ = a.x + 1; | ^^^ use of possibly uninitialized `a.x` error[E0382]: use of moved value: `line1.origin` @@ -9,7 +9,7 @@ error[E0382]: use of moved value: `line1.origin` | LL | let _moved = line1.origin; | ------------ value moved here -LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x` +LL | let _ = line1.origin.x + 1; | ^^^^^^^^^^^^^^ value used here after move | = note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait @@ -19,7 +19,7 @@ error[E0382]: use of moved value: `line2` | LL | let _moved = (line2.origin, line2.middle); | ------------ value moved here -LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382] +LL | line2.consume(); | ^^^^^ value used here after partial move | = note: move occurs because `line2.middle` has type `Point`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-uninit-field-access.ast.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.ast.stderr index 8c05272e5fbae..58fc1d4b62149 100644 --- a/src/test/ui/borrowck/borrowck-uninit-field-access.ast.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-field-access.ast.stderr @@ -1,7 +1,7 @@ error[E0381]: use of possibly uninitialized variable: `a.x` --> $DIR/borrowck-uninit-field-access.rs:24:13 | -LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` +LL | let _ = a.x + 1; | ^^^ use of possibly uninitialized `a.x` error[E0382]: use of moved value: `line1.origin.x` @@ -9,7 +9,7 @@ error[E0382]: use of moved value: `line1.origin.x` | LL | let _moved = line1.origin; | ------ value moved here -LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x` +LL | let _ = line1.origin.x + 1; | ^^^^^^^^^^^^^^ value used here after move | = note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait @@ -19,7 +19,7 @@ error[E0382]: use of partially moved value: `line2` | LL | let _moved = (line2.origin, line2.middle); | ------------ value moved here -LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382] +LL | line2.consume(); | ^^^^^ value used here after move | = note: move occurs because `line2.origin` has type `Point`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr index 99cbf64fd5d46..a6e5f0b0e9db7 100644 --- a/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr @@ -1,7 +1,7 @@ error[E0381]: use of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-field-access.rs:24:13 | -LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` +LL | let _ = a.x + 1; | ^^^ use of possibly uninitialized `a.x` error[E0382]: use of moved value: `line1.origin` @@ -9,7 +9,7 @@ error[E0382]: use of moved value: `line1.origin` | LL | let _moved = line1.origin; | ------------ value moved here -LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x` +LL | let _ = line1.origin.x + 1; | ^^^^^^^^^^^^^^ value used here after move | = note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait @@ -19,7 +19,7 @@ error[E0382]: use of moved value: `line2` | LL | let _moved = (line2.origin, line2.middle); | ------------ value moved here -LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382] +LL | line2.consume(); | ^^^^^ value used here after partial move | = note: move occurs because `line2.middle` has type `Point`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr index 7687176947a73..a5cf59c945a20 100644 --- a/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr @@ -1,43 +1,43 @@ error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-uninit-ref-chain.rs:11:14 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^^ use of possibly uninitialized `**x` error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-uninit-ref-chain.rs:15:14 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^^ use of possibly uninitialized `**x` error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-uninit-ref-chain.rs:19:14 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^^ use of possibly uninitialized `**x` error[E0381]: assign to part of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-ref-chain.rs:24:5 | -LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381] +LL | a.x = 0; | ^^^^^^^ use of possibly uninitialized `a` error[E0381]: assign to part of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-ref-chain.rs:29:5 | -LL | a.x = &&0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381] +LL | a.x = &&0; | ^^^^^^^^^ use of possibly uninitialized `a` error[E0381]: assign to part of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-ref-chain.rs:35:5 | -LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381] +LL | a.x = 0; | ^^^^^^^ use of possibly uninitialized `a` error[E0381]: assign to part of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-ref-chain.rs:40:5 | -LL | a.x = &&0; //[mir]~ assign to part of possibly uninitialized variable: `a` [E0381] +LL | a.x = &&0; | ^^^^^^^^^ use of possibly uninitialized `a` error: aborting due to 7 previous errors diff --git a/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.stderr index e8ebf8c2dd048..8cb3f3bf89f36 100644 --- a/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.stderr @@ -1,43 +1,43 @@ error[E0381]: use of possibly uninitialized variable: `**x` --> $DIR/borrowck-uninit-ref-chain.rs:11:15 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^ use of possibly uninitialized `**x` error[E0381]: use of possibly uninitialized variable: `**x` --> $DIR/borrowck-uninit-ref-chain.rs:15:15 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^ use of possibly uninitialized `**x` error[E0381]: use of possibly uninitialized variable: `**x` --> $DIR/borrowck-uninit-ref-chain.rs:19:15 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^ use of possibly uninitialized `**x` error[E0381]: use of possibly uninitialized variable: `a.x` --> $DIR/borrowck-uninit-ref-chain.rs:25:15 | -LL | let _b = &a.x; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` [E0381] +LL | let _b = &a.x; | ^^^ use of possibly uninitialized `a.x` error[E0381]: use of possibly uninitialized variable: `**a.x` --> $DIR/borrowck-uninit-ref-chain.rs:30:15 | -LL | let _b = &**a.x; //[ast]~ ERROR use of possibly uninitialized variable: `**a.x` [E0381] +LL | let _b = &**a.x; | ^^^^^ use of possibly uninitialized `**a.x` error[E0381]: use of possibly uninitialized variable: `a.y` --> $DIR/borrowck-uninit-ref-chain.rs:36:15 | -LL | let _b = &a.y; //[ast]~ ERROR use of possibly uninitialized variable: `a.y` [E0381] +LL | let _b = &a.y; | ^^^ use of possibly uninitialized `a.y` error[E0381]: use of possibly uninitialized variable: `**a.y` --> $DIR/borrowck-uninit-ref-chain.rs:41:15 | -LL | let _b = &**a.y; //[ast]~ ERROR use of possibly uninitialized variable: `**a.y` [E0381] +LL | let _b = &**a.y; | ^^^^^ use of possibly uninitialized `**a.y` error: aborting due to 7 previous errors diff --git a/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr index 7687176947a73..a5cf59c945a20 100644 --- a/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr @@ -1,43 +1,43 @@ error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-uninit-ref-chain.rs:11:14 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^^ use of possibly uninitialized `**x` error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-uninit-ref-chain.rs:15:14 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^^ use of possibly uninitialized `**x` error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-uninit-ref-chain.rs:19:14 | -LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] +LL | let _y = &**x; | ^^^^ use of possibly uninitialized `**x` error[E0381]: assign to part of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-ref-chain.rs:24:5 | -LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381] +LL | a.x = 0; | ^^^^^^^ use of possibly uninitialized `a` error[E0381]: assign to part of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-ref-chain.rs:29:5 | -LL | a.x = &&0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381] +LL | a.x = &&0; | ^^^^^^^^^ use of possibly uninitialized `a` error[E0381]: assign to part of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-ref-chain.rs:35:5 | -LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381] +LL | a.x = 0; | ^^^^^^^ use of possibly uninitialized `a` error[E0381]: assign to part of possibly uninitialized variable: `a` --> $DIR/borrowck-uninit-ref-chain.rs:40:5 | -LL | a.x = &&0; //[mir]~ assign to part of possibly uninitialized variable: `a` [E0381] +LL | a.x = &&0; | ^^^^^^^^^ use of possibly uninitialized `a` error: aborting due to 7 previous errors diff --git a/src/test/ui/borrowck/borrowck-union-borrow.mir.stderr b/src/test/ui/borrowck/borrowck-union-borrow.mir.stderr index 1a2433c8f6afd..6855437d4c2f5 100644 --- a/src/test/ui/borrowck/borrowck-union-borrow.mir.stderr +++ b/src/test/ui/borrowck/borrowck-union-borrow.mir.stderr @@ -3,9 +3,9 @@ error[E0502]: cannot borrow `u.a` as mutable because it is also borrowed as immu | LL | let ra = &u.a; | ---- immutable borrow occurs here -LL | let rma = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable +LL | let rma = &mut u.a; | ^^^^^^^^ mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable +LL | LL | drop(ra); | -- immutable borrow later used here @@ -14,9 +14,9 @@ error[E0506]: cannot assign to `u.a` because it is borrowed | LL | let ra = &u.a; | ---- borrow of `u.a` occurs here -LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed +LL | u.a = 1; | ^^^^^^^ assignment to borrowed `u.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed +LL | LL | drop(ra); | -- borrow later used here @@ -25,9 +25,9 @@ error[E0502]: cannot borrow `u.b` as mutable because it is also borrowed as immu | LL | let ra = &u.a; | ---- immutable borrow occurs here -LL | let rmb = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable because `u` is also borrowed as immutable (via `u.a`) +LL | let rmb = &mut u.b; | ^^^^^^^^ mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable because it is also borrowed as immutable +LL | LL | drop(ra); | -- immutable borrow later used here @@ -36,9 +36,9 @@ error[E0506]: cannot assign to `u.b` because it is borrowed | LL | let ra = &u.a; | ---- borrow of `u.b` occurs here -LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed +LL | u.b = 1; | ^^^^^^^ assignment to borrowed `u.b` occurs here -LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed +LL | LL | drop(ra); | -- borrow later used here @@ -47,9 +47,9 @@ error[E0502]: cannot borrow `u.a` as immutable because it is also borrowed as mu | LL | let rma = &mut u.a; | -------- mutable borrow occurs here -LL | let ra = &u.a; //[ast]~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable +LL | let ra = &u.a; | ^^^^ immutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable +LL | LL | drop(rma); | --- mutable borrow later used here @@ -58,9 +58,9 @@ error[E0503]: cannot use `u.a` because it was mutably borrowed | LL | let ra = &mut u.a; | -------- borrow of `u.a` occurs here -LL | let a = u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed +LL | let a = u.a; | ^^^ use of borrowed `u.a` -LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | LL | drop(ra); | -- borrow later used here @@ -69,9 +69,9 @@ error[E0499]: cannot borrow `u.a` as mutable more than once at a time | LL | let rma = &mut u.a; | -------- first mutable borrow occurs here -LL | let rma2 = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable more than once at a time +LL | let rma2 = &mut u.a; | ^^^^^^^^ second mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable more than once at a time +LL | LL | drop(rma); | --- first borrow later used here @@ -80,9 +80,9 @@ error[E0506]: cannot assign to `u.a` because it is borrowed | LL | let rma = &mut u.a; | -------- borrow of `u.a` occurs here -LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed +LL | u.a = 1; | ^^^^^^^ assignment to borrowed `u.a` occurs here -LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed +LL | LL | drop(rma); | --- borrow later used here @@ -91,9 +91,9 @@ error[E0502]: cannot borrow `u.b` as immutable because it is also borrowed as mu | LL | let rma = &mut u.a; | -------- mutable borrow occurs here -LL | let rb = &u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as immutable because `u` is also borrowed as mutable (via `u.a`) +LL | let rb = &u.b; | ^^^^ immutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `u.b` as immutable because it is also borrowed as mutable +LL | LL | drop(rma); | --- mutable borrow later used here @@ -102,7 +102,7 @@ error[E0503]: cannot use `u.b` because it was mutably borrowed | LL | let ra = &mut u.a; | -------- borrow of `u.a` occurs here -LL | let b = u.b; //[ast]~ ERROR cannot use `u.b` because it was mutably borrowed +LL | let b = u.b; | ^^^ use of borrowed `u.a` ... LL | drop(ra); @@ -113,9 +113,9 @@ error[E0499]: cannot borrow `u.b` as mutable more than once at a time | LL | let rma = &mut u.a; | -------- first mutable borrow occurs here -LL | let rmb2 = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable more than once at a time +LL | let rmb2 = &mut u.b; | ^^^^^^^^ second mutable borrow occurs here -LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable more than once at a time +LL | LL | drop(rma); | --- first borrow later used here @@ -124,9 +124,9 @@ error[E0506]: cannot assign to `u.b` because it is borrowed | LL | let rma = &mut u.a; | -------- borrow of `u.b` occurs here -LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed +LL | u.b = 1; | ^^^^^^^ assignment to borrowed `u.b` occurs here -LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed +LL | LL | drop(rma); | --- borrow later used here diff --git a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr index 181912320e57b..c5e4f89f7779a 100644 --- a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr @@ -1,13 +1,13 @@ error[E0381]: use of possibly uninitialized variable: `w` --> $DIR/borrowck-use-in-index-lvalue.rs:6:5 | -LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] +LL | w[5] = 0; | ^^^^ use of possibly uninitialized `*w` error[E0381]: use of possibly uninitialized variable: `w` --> $DIR/borrowck-use-in-index-lvalue.rs:10:5 | -LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] +LL | w[5] = 0; | ^^^^ use of possibly uninitialized `*w` error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.stderr index abe515788292b..e235bdfa8a969 100644 --- a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.stderr +++ b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.stderr @@ -1,13 +1,13 @@ error[E0381]: use of possibly uninitialized variable: `*w` --> $DIR/borrowck-use-in-index-lvalue.rs:6:5 | -LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] +LL | w[5] = 0; | ^^^^^^^^ use of possibly uninitialized `*w` error[E0381]: use of possibly uninitialized variable: `*w` --> $DIR/borrowck-use-in-index-lvalue.rs:10:5 | -LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] +LL | w[5] = 0; | ^^^^^^^^ use of possibly uninitialized `*w` error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr index 181912320e57b..c5e4f89f7779a 100644 --- a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr +++ b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr @@ -1,13 +1,13 @@ error[E0381]: use of possibly uninitialized variable: `w` --> $DIR/borrowck-use-in-index-lvalue.rs:6:5 | -LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] +LL | w[5] = 0; | ^^^^ use of possibly uninitialized `*w` error[E0381]: use of possibly uninitialized variable: `w` --> $DIR/borrowck-use-in-index-lvalue.rs:10:5 | -LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] +LL | w[5] = 0; | ^^^^ use of possibly uninitialized `*w` error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr index 8f4b02a1df3a4..a208dc486ecb2 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr @@ -1,7 +1,7 @@ error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:12:13 | -LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x` +LL | let y = x as *const Foo; | ^ use of possibly uninitialized `*x` error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr index ecb8922ff8df8..49a43003f60e4 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr @@ -1,7 +1,7 @@ error[E0381]: use of possibly uninitialized variable: `*x` --> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:12:13 | -LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x` +LL | let y = x as *const Foo; | ^ use of possibly uninitialized `*x` error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr index 8f4b02a1df3a4..a208dc486ecb2 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr @@ -1,7 +1,7 @@ error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:12:13 | -LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x` +LL | let y = x as *const Foo; | ^ use of possibly uninitialized `*x` error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr index dd0a7509a2b06..0f62c3ae2c7fd 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr @@ -1,7 +1,7 @@ error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-use-uninitialized-in-cast.rs:10:13 | -LL | let y = x as *const i32; //[ast]~ ERROR use of possibly uninitialized variable: `*x` [E0381] +LL | let y = x as *const i32; | ^ use of possibly uninitialized `*x` error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr index d3ddf24d22dd1..d8137387862a4 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr @@ -1,7 +1,7 @@ error[E0381]: use of possibly uninitialized variable: `*x` --> $DIR/borrowck-use-uninitialized-in-cast.rs:10:13 | -LL | let y = x as *const i32; //[ast]~ ERROR use of possibly uninitialized variable: `*x` [E0381] +LL | let y = x as *const i32; | ^ use of possibly uninitialized `*x` error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr index dd0a7509a2b06..0f62c3ae2c7fd 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr @@ -1,7 +1,7 @@ error[E0381]: borrow of possibly uninitialized variable: `x` --> $DIR/borrowck-use-uninitialized-in-cast.rs:10:13 | -LL | let y = x as *const i32; //[ast]~ ERROR use of possibly uninitialized variable: `*x` [E0381] +LL | let y = x as *const i32; | ^ use of possibly uninitialized `*x` error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr index 6dc2778892d2e..7d0d8882ded70 100644 --- a/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `a[_]` because it is borrowed LL | [1, 2, ref tail..] => tail, | -------- borrow of `a[_]` occurs here ... -LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed +LL | a[2] = 0; | ^^^^^^^^ assignment to borrowed `a[_]` occurs here ... LL | println!("t[0]: {}", t[0]); diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.stderr index c456dac316db8..1207d4a1095dc 100644 --- a/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.stderr +++ b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `a[..]` because it is borrowed LL | [1, 2, ref tail..] => tail, | -------- borrow of `a[..]` occurs here ... -LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed +LL | a[2] = 0; | ^^^^^^^^ assignment to borrowed `a[..]` occurs here error: aborting due to previous error diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr index 6eb9eac760f00..f764d5fb5283f 100644 --- a/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr +++ b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `a[..]` because it is borrowed (Ast) LL | [1, 2, ref tail..] => tail, | -------- borrow of `a[..]` occurs here ... -LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed +LL | a[2] = 0; | ^^^^^^^^ assignment to borrowed `a[..]` occurs here error[E0506]: cannot assign to `a[_]` because it is borrowed (Mir) @@ -13,7 +13,7 @@ error[E0506]: cannot assign to `a[_]` because it is borrowed (Mir) LL | [1, 2, ref tail..] => tail, | -------- borrow of `a[_]` occurs here ... -LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed +LL | a[2] = 0; | ^^^^^^^^ assignment to borrowed `a[_]` occurs here ... LL | println!("t[0]: {}", t[0]); diff --git a/src/test/ui/borrowck/move-in-static-initializer-issue-38520.ast.stderr b/src/test/ui/borrowck/move-in-static-initializer-issue-38520.ast.stderr index 6793e1a1312da..14078b76897c9 100644 --- a/src/test/ui/borrowck/move-in-static-initializer-issue-38520.ast.stderr +++ b/src/test/ui/borrowck/move-in-static-initializer-issue-38520.ast.stderr @@ -1,13 +1,13 @@ error[E0507]: cannot move out of borrowed content --> $DIR/move-in-static-initializer-issue-38520.rs:15:23 | -LL | static Y: usize = get(*&X); //[ast]~ ERROR E0507 +LL | static Y: usize = get(*&X); | ^^^ cannot move out of borrowed content error[E0507]: cannot move out of borrowed content --> $DIR/move-in-static-initializer-issue-38520.rs:17:22 | -LL | const Z: usize = get(*&X); //[ast]~ ERROR E0507 +LL | const Z: usize = get(*&X); | ^^^ cannot move out of borrowed content error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/move-in-static-initializer-issue-38520.mir.stderr b/src/test/ui/borrowck/move-in-static-initializer-issue-38520.mir.stderr index 6793e1a1312da..14078b76897c9 100644 --- a/src/test/ui/borrowck/move-in-static-initializer-issue-38520.mir.stderr +++ b/src/test/ui/borrowck/move-in-static-initializer-issue-38520.mir.stderr @@ -1,13 +1,13 @@ error[E0507]: cannot move out of borrowed content --> $DIR/move-in-static-initializer-issue-38520.rs:15:23 | -LL | static Y: usize = get(*&X); //[ast]~ ERROR E0507 +LL | static Y: usize = get(*&X); | ^^^ cannot move out of borrowed content error[E0507]: cannot move out of borrowed content --> $DIR/move-in-static-initializer-issue-38520.rs:17:22 | -LL | const Z: usize = get(*&X); //[ast]~ ERROR E0507 +LL | const Z: usize = get(*&X); | ^^^ cannot move out of borrowed content error: aborting due to 2 previous errors diff --git a/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr index 7bae14382d048..8370aad6f3046 100644 --- a/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr +++ b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr @@ -5,7 +5,7 @@ LL | let y = &mut x; | ------ mutable borrow occurs here LL | { let z = &x; read(z); } | ^^ immutable borrow occurs here -LL | //[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | *y += 1; | ------- mutable borrow later used here @@ -16,7 +16,7 @@ LL | let y = &mut x; | ------ mutable borrow occurs here LL | let z = &x; | ^^ immutable borrow occurs here -LL | //[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | *y += 1; | ------- mutable borrow later used here @@ -38,7 +38,7 @@ LL | let y = &mut x; | ------ mutable borrow occurs here LL | let _z = &x; | ^^ immutable borrow occurs here -LL | //[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | LL | *y += 1; | ------- mutable borrow later used here diff --git a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr index 232876e6f0b74..9f31c3f87c37d 100644 --- a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr +++ b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr @@ -16,7 +16,7 @@ error[E0503]: cannot use `i` because it was mutably borrowed LL | /*1*/ let p = &mut i; // (reservation of `i` starts here) | ------ borrow of `i` occurs here ... -LL | /*4*/ let k = i; //[nll_beyond]~ ERROR cannot use `i` because it was mutably borrowed [E0503] +LL | /*4*/ let k = i; | ^ use of borrowed `i` ... LL | /*5*/ *p += 1; diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr index 5fcb63e17bf31..9ec36f4c142e9 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr @@ -2,11 +2,11 @@ error: compilation successful --> $DIR/hr-subtype.rs:100:1 | LL | / fn main() { -LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful -LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful -LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful -LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful -LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | +LL | | +LL | | +LL | | +LL | | LL | | } | |_^ diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr index 5fcb63e17bf31..9ec36f4c142e9 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr @@ -2,11 +2,11 @@ error: compilation successful --> $DIR/hr-subtype.rs:100:1 | LL | / fn main() { -LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful -LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful -LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful -LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful -LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | +LL | | +LL | | +LL | | +LL | | LL | | } | |_^ diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr index 5fcb63e17bf31..9ec36f4c142e9 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr @@ -2,11 +2,11 @@ error: compilation successful --> $DIR/hr-subtype.rs:100:1 | LL | / fn main() { -LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful -LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful -LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful -LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful -LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | +LL | | +LL | | +LL | | +LL | | LL | | } | |_^ diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr index 5fcb63e17bf31..9ec36f4c142e9 100644 --- a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr @@ -2,11 +2,11 @@ error: compilation successful --> $DIR/hr-subtype.rs:100:1 | LL | / fn main() { -LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful -LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful -LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful -LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful -LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | +LL | | +LL | | +LL | | +LL | | LL | | } | |_^ diff --git a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr index 5fcb63e17bf31..9ec36f4c142e9 100644 --- a/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr +++ b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr @@ -2,11 +2,11 @@ error: compilation successful --> $DIR/hr-subtype.rs:100:1 | LL | / fn main() { -LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful -LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful -LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful -LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful -LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | +LL | | +LL | | +LL | | +LL | | LL | | } | |_^ diff --git a/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.nll.stderr b/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.nll.stderr index bbb95e8c8d440..2b69b3f6228ba 100644 --- a/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.nll.stderr +++ b/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.nll.stderr @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | let y = f.call(&x); | -- borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here ... LL | drop(y); diff --git a/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.stderr b/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.stderr index f6f9200a354d5..6f055aaf5ae40 100644 --- a/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.stderr +++ b/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.stderr @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | let y = f.call(&x); | - borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here error: aborting due to previous error diff --git a/src/test/ui/hrtb/hrtb-identity-fn-borrows.mir.stderr b/src/test/ui/hrtb/hrtb-identity-fn-borrows.mir.stderr index bbb95e8c8d440..2b69b3f6228ba 100644 --- a/src/test/ui/hrtb/hrtb-identity-fn-borrows.mir.stderr +++ b/src/test/ui/hrtb/hrtb-identity-fn-borrows.mir.stderr @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | let y = f.call(&x); | -- borrow of `x` occurs here -LL | x = 5; //[ast]~ ERROR cannot assign +LL | x = 5; | ^^^^^ assignment to borrowed `x` occurs here ... LL | drop(y); diff --git a/src/test/ui/immut-function-arguments.ast.nll.stderr b/src/test/ui/immut-function-arguments.ast.nll.stderr index f0163390ae000..5085f3697184e 100644 --- a/src/test/ui/immut-function-arguments.ast.nll.stderr +++ b/src/test/ui/immut-function-arguments.ast.nll.stderr @@ -3,13 +3,13 @@ error[E0594]: cannot assign to `*y`, as `y` is not declared as mutable | LL | fn f(y: Box) { | - help: consider changing this to be mutable: `mut y` -LL | *y = 5; //[ast]~ ERROR cannot assign +LL | *y = 5; | ^^^^^^ cannot assign error[E0594]: cannot assign to `*q`, as `q` is not declared as mutable --> $DIR/immut-function-arguments.rs:10:35 | -LL | let _frob = |q: Box| { *q = 2; }; //[ast]~ ERROR cannot assign +LL | let _frob = |q: Box| { *q = 2; }; | - ^^^^^^ cannot assign | | | help: consider changing this to be mutable: `mut q` diff --git a/src/test/ui/immut-function-arguments.ast.stderr b/src/test/ui/immut-function-arguments.ast.stderr index 1ffe569d8281a..f371a13cd4d25 100644 --- a/src/test/ui/immut-function-arguments.ast.stderr +++ b/src/test/ui/immut-function-arguments.ast.stderr @@ -3,13 +3,13 @@ error[E0594]: cannot assign to immutable `Box` content `*y` | LL | fn f(y: Box) { | - help: make this binding mutable: `mut y` -LL | *y = 5; //[ast]~ ERROR cannot assign +LL | *y = 5; | ^^^^^^ cannot borrow as mutable error[E0594]: cannot assign to immutable `Box` content `*q` --> $DIR/immut-function-arguments.rs:10:35 | -LL | let _frob = |q: Box| { *q = 2; }; //[ast]~ ERROR cannot assign +LL | let _frob = |q: Box| { *q = 2; }; | - ^^^^^^ cannot borrow as mutable | | | help: make this binding mutable: `mut q` diff --git a/src/test/ui/immut-function-arguments.mir.stderr b/src/test/ui/immut-function-arguments.mir.stderr index f0163390ae000..5085f3697184e 100644 --- a/src/test/ui/immut-function-arguments.mir.stderr +++ b/src/test/ui/immut-function-arguments.mir.stderr @@ -3,13 +3,13 @@ error[E0594]: cannot assign to `*y`, as `y` is not declared as mutable | LL | fn f(y: Box) { | - help: consider changing this to be mutable: `mut y` -LL | *y = 5; //[ast]~ ERROR cannot assign +LL | *y = 5; | ^^^^^^ cannot assign error[E0594]: cannot assign to `*q`, as `q` is not declared as mutable --> $DIR/immut-function-arguments.rs:10:35 | -LL | let _frob = |q: Box| { *q = 2; }; //[ast]~ ERROR cannot assign +LL | let _frob = |q: Box| { *q = 2; }; | - ^^^^^^ cannot assign | | | help: consider changing this to be mutable: `mut q` diff --git a/src/test/ui/issues/issue-17263.nll.stderr b/src/test/ui/issues/issue-17263.nll.stderr index cdb574b8b9f94..5604037a38d28 100644 --- a/src/test/ui/issues/issue-17263.nll.stderr +++ b/src/test/ui/issues/issue-17263.nll.stderr @@ -1,10 +1,10 @@ error: compilation successful --> $DIR/issue-17263.rs:15:1 | -LL | / fn main() { //[nll]~ ERROR compilation successful +LL | / fn main() { LL | | let mut x: Box<_> = box Foo { a: 1, b: 2 }; LL | | let (a, b) = (&mut x.a, &mut x.b); -LL | | //[ast]~^ ERROR cannot borrow `x` (via `x.b`) as mutable more than once at a time +LL | | ... | LL | | use_mut(a); LL | | } diff --git a/src/test/ui/issues/issue-25579.ast.nll.stderr b/src/test/ui/issues/issue-25579.ast.nll.stderr index b791f600f50cb..107f88b413b8c 100644 --- a/src/test/ui/issues/issue-25579.ast.nll.stderr +++ b/src/test/ui/issues/issue-25579.ast.nll.stderr @@ -1,7 +1,7 @@ error: compilation successful --> $DIR/issue-25579.rs:21:1 | -LL | / fn main() { //[mir]~ ERROR compilation successful +LL | / fn main() { LL | | } | |_^ diff --git a/src/test/ui/issues/issue-25579.ast.stderr b/src/test/ui/issues/issue-25579.ast.stderr index 3de7f565b7b8a..a44cc9568742f 100644 --- a/src/test/ui/issues/issue-25579.ast.stderr +++ b/src/test/ui/issues/issue-25579.ast.stderr @@ -1,7 +1,7 @@ error[E0499]: cannot borrow `l.0` as mutable more than once at a time --> $DIR/issue-25579.rs:14:32 | -LL | &mut Sexpression::Cons(ref mut expr) => { //[ast]~ ERROR [E0499] +LL | &mut Sexpression::Cons(ref mut expr) => { | ^^^^^^^^^^^^ mutable borrow starts here in previous iteration of loop ... LL | } @@ -10,9 +10,9 @@ LL | } error[E0506]: cannot assign to `l` because it is borrowed --> $DIR/issue-25579.rs:15:13 | -LL | &mut Sexpression::Cons(ref mut expr) => { //[ast]~ ERROR [E0499] +LL | &mut Sexpression::Cons(ref mut expr) => { | ------------ borrow of `l` occurs here -LL | l = &mut **expr; //[ast]~ ERROR [E0506] +LL | l = &mut **expr; | ^^^^^^^^^^^^^^^ assignment to borrowed `l` occurs here error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-25579.mir.stderr b/src/test/ui/issues/issue-25579.mir.stderr index b791f600f50cb..107f88b413b8c 100644 --- a/src/test/ui/issues/issue-25579.mir.stderr +++ b/src/test/ui/issues/issue-25579.mir.stderr @@ -1,7 +1,7 @@ error: compilation successful --> $DIR/issue-25579.rs:21:1 | -LL | / fn main() { //[mir]~ ERROR compilation successful +LL | / fn main() { LL | | } | |_^ diff --git a/src/test/ui/issues/issue-45199.ast.nll.stderr b/src/test/ui/issues/issue-45199.ast.nll.stderr index 6d6af83598226..c6ae7c9514d1f 100644 --- a/src/test/ui/issues/issue-45199.ast.nll.stderr +++ b/src/test/ui/issues/issue-45199.ast.nll.stderr @@ -4,31 +4,31 @@ error[E0384]: cannot assign twice to immutable variable `b` LL | let b: Box; | - help: make this binding mutable: `mut b` ... -LL | b = Box::new(1); //[ast]~ NOTE first assignment +LL | b = Box::new(1); | - first assignment to `b` -LL | //[mir]~^ NOTE first assignment -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | +LL | b = Box::new(2); | ^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/issue-45199.rs:21:5 | -LL | let b = Box::new(1); //[ast]~ NOTE first assignment +LL | let b = Box::new(1); | - | | | first assignment to `b` | help: make this binding mutable: `mut b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^ cannot assign twice to immutable variable error[E0384]: cannot assign to immutable argument `b` --> $DIR/issue-45199.rs:30:5 | -LL | fn test_args(b: Box) { //[ast]~ NOTE first assignment +LL | fn test_args(b: Box) { | - help: make this binding mutable: `mut b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^ cannot assign to immutable argument error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-45199.ast.stderr b/src/test/ui/issues/issue-45199.ast.stderr index fa9d8e09af5a1..9dfd8e8213399 100644 --- a/src/test/ui/issues/issue-45199.ast.stderr +++ b/src/test/ui/issues/issue-45199.ast.stderr @@ -1,28 +1,28 @@ error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/issue-45199.rs:10:5 | -LL | b = Box::new(1); //[ast]~ NOTE first assignment +LL | b = Box::new(1); | --------------- first assignment to `b` -LL | //[mir]~^ NOTE first assignment -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | +LL | b = Box::new(2); | ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/issue-45199.rs:21:5 | -LL | let b = Box::new(1); //[ast]~ NOTE first assignment +LL | let b = Box::new(1); | - first assignment to `b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/issue-45199.rs:30:5 | -LL | fn test_args(b: Box) { //[ast]~ NOTE first assignment +LL | fn test_args(b: Box) { | - first assignment to `b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-45199.mir.stderr b/src/test/ui/issues/issue-45199.mir.stderr index 6d6af83598226..c6ae7c9514d1f 100644 --- a/src/test/ui/issues/issue-45199.mir.stderr +++ b/src/test/ui/issues/issue-45199.mir.stderr @@ -4,31 +4,31 @@ error[E0384]: cannot assign twice to immutable variable `b` LL | let b: Box; | - help: make this binding mutable: `mut b` ... -LL | b = Box::new(1); //[ast]~ NOTE first assignment +LL | b = Box::new(1); | - first assignment to `b` -LL | //[mir]~^ NOTE first assignment -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | +LL | b = Box::new(2); | ^ cannot assign twice to immutable variable error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/issue-45199.rs:21:5 | -LL | let b = Box::new(1); //[ast]~ NOTE first assignment +LL | let b = Box::new(1); | - | | | first assignment to `b` | help: make this binding mutable: `mut b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^ cannot assign twice to immutable variable error[E0384]: cannot assign to immutable argument `b` --> $DIR/issue-45199.rs:30:5 | -LL | fn test_args(b: Box) { //[ast]~ NOTE first assignment +LL | fn test_args(b: Box) { | - help: make this binding mutable: `mut b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^ cannot assign to immutable argument error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.ast.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.ast.stderr index 1992e32bf8406..0aaba52d29f4d 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.ast.stderr +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.ast.stderr @@ -1,8 +1,8 @@ error: compilation successful --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:82:1 | -LL | / fn main() { //[ast]~ ERROR compilation successful -LL | | //[migrate]~^ ERROR compilation successful +LL | / fn main() { +LL | | LL | | let mut x = 1; LL | | { ... | diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr index 129c6292b15a1..f8aab239de4c9 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr @@ -3,7 +3,7 @@ warning[E0713]: borrow may still be in use when destructor runs | LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { | -- lifetime `'a` defined here -LL | &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] +LL | &mut *s.0 | ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` ... LL | } @@ -17,7 +17,7 @@ warning[E0713]: borrow may still be in use when destructor runs | LL | fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { | -- lifetime `'a` defined here -LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] +LL | &mut *(*s).0 | ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` ... LL | } @@ -31,7 +31,7 @@ warning[E0713]: borrow may still be in use when destructor runs | LL | fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { | -- lifetime `'a` defined here -LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] +LL | &mut *(**s).0 | ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` ... LL | } @@ -43,8 +43,8 @@ LL | } error: compilation successful --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:82:1 | -LL | / fn main() { //[ast]~ ERROR compilation successful -LL | | //[migrate]~^ ERROR compilation successful +LL | / fn main() { +LL | | LL | | let mut x = 1; LL | | { ... | diff --git a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr index 2cb07f0ad0013..bfb58325ece38 100644 --- a/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr +++ b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr @@ -3,7 +3,7 @@ error[E0713]: borrow may still be in use when destructor runs | LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 { | -- lifetime `'a` defined here -LL | &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] +LL | &mut *s.0 | ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` ... LL | } @@ -14,7 +14,7 @@ error[E0713]: borrow may still be in use when destructor runs | LL | fn boxed_scribbled<'a>(s: Box>) -> &'a mut u32 { | -- lifetime `'a` defined here -LL | &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] +LL | &mut *(*s).0 | ^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` ... LL | } @@ -25,7 +25,7 @@ error[E0713]: borrow may still be in use when destructor runs | LL | fn boxed_boxed_scribbled<'a>(s: Box>>) -> &'a mut u32 { | -- lifetime `'a` defined here -LL | &mut *(**s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713] +LL | &mut *(**s).0 | ^^^^^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a` ... LL | } diff --git a/src/test/ui/issues/issue-46604.ast.nll.stderr b/src/test/ui/issues/issue-46604.ast.nll.stderr index 4f73a0f9d541d..f43588c3bb40d 100644 --- a/src/test/ui/issues/issue-46604.ast.nll.stderr +++ b/src/test/ui/issues/issue-46604.ast.nll.stderr @@ -1,13 +1,13 @@ error[E0017]: references in statics may only refer to immutable values --> $DIR/issue-46604.rs:4:25 | -LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //[ast]~ ERROR E0017 +LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; | ^^^^^^^^^^^^^^^^^^^^ statics require immutable values error[E0594]: cannot assign to `buf[_]`, as `buf` is an immutable static item --> $DIR/issue-46604.rs:10:5 | -LL | buf[0]=2; //[ast]~ ERROR E0389 +LL | buf[0]=2; | ^^^^^^^^ cannot assign error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-46604.ast.stderr b/src/test/ui/issues/issue-46604.ast.stderr index 14b9242ba0c3d..2ee1ac2d4d07b 100644 --- a/src/test/ui/issues/issue-46604.ast.stderr +++ b/src/test/ui/issues/issue-46604.ast.stderr @@ -1,13 +1,13 @@ error[E0017]: references in statics may only refer to immutable values --> $DIR/issue-46604.rs:4:25 | -LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //[ast]~ ERROR E0017 +LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; | ^^^^^^^^^^^^^^^^^^^^ statics require immutable values error[E0389]: cannot assign to data in a `&` reference --> $DIR/issue-46604.rs:10:5 | -LL | buf[0]=2; //[ast]~ ERROR E0389 +LL | buf[0]=2; | ^^^^^^^^ assignment into an immutable reference error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-46604.mir.stderr b/src/test/ui/issues/issue-46604.mir.stderr index 4f73a0f9d541d..f43588c3bb40d 100644 --- a/src/test/ui/issues/issue-46604.mir.stderr +++ b/src/test/ui/issues/issue-46604.mir.stderr @@ -1,13 +1,13 @@ error[E0017]: references in statics may only refer to immutable values --> $DIR/issue-46604.rs:4:25 | -LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; //[ast]~ ERROR E0017 +LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7]; | ^^^^^^^^^^^^^^^^^^^^ statics require immutable values error[E0594]: cannot assign to `buf[_]`, as `buf` is an immutable static item --> $DIR/issue-46604.rs:10:5 | -LL | buf[0]=2; //[ast]~ ERROR E0389 +LL | buf[0]=2; | ^^^^^^^^ cannot assign error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-5500-1.ast.stderr b/src/test/ui/issues/issue-5500-1.ast.stderr index 681ccbc4276a1..558e7b7824937 100644 --- a/src/test/ui/issues/issue-5500-1.ast.stderr +++ b/src/test/ui/issues/issue-5500-1.ast.stderr @@ -3,8 +3,8 @@ error[E0594]: cannot assign to field `_iter.node` of immutable binding | LL | let _iter = TrieMapIterator{node: &a}; | ----- help: make this binding mutable: `mut _iter` -LL | / _iter.node = & //[ast]~ ERROR cannot assign to field `_iter.node` of immutable binding -LL | | //[mir]~^ ERROR cannot assign to field `_iter.node` of immutable binding (Ast) +LL | / _iter.node = & +LL | | LL | | // MIR doesn't generate an error because the code isn't reachable. This is OK LL | | // because the test is here to check that the compiler doesn't ICE (cf. #5500). LL | | panic!() diff --git a/src/test/ui/issues/issue-5500-1.mir.stderr b/src/test/ui/issues/issue-5500-1.mir.stderr index 67ca23ca2974b..92f803e2819d2 100644 --- a/src/test/ui/issues/issue-5500-1.mir.stderr +++ b/src/test/ui/issues/issue-5500-1.mir.stderr @@ -3,8 +3,8 @@ error[E0594]: cannot assign to field `_iter.node` of immutable binding (Ast) | LL | let _iter = TrieMapIterator{node: &a}; | ----- help: make this binding mutable: `mut _iter` -LL | / _iter.node = & //[ast]~ ERROR cannot assign to field `_iter.node` of immutable binding -LL | | //[mir]~^ ERROR cannot assign to field `_iter.node` of immutable binding (Ast) +LL | / _iter.node = & +LL | | LL | | // MIR doesn't generate an error because the code isn't reachable. This is OK LL | | // because the test is here to check that the compiler doesn't ICE (cf. #5500). LL | | panic!() diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.nll.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.nll.stderr index 9d24570057375..8376ee88d9a10 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.nll.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.nll.stderr @@ -4,7 +4,7 @@ error[E0384]: cannot assign twice to immutable variable `v` LL | let v: isize; | - help: make this binding mutable: `mut v` ... -LL | v = 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 1; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.stderr index 20003b73d3999..db2a482be729c 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.stderr @@ -1,7 +1,7 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/liveness-assign-imm-local-in-loop.rs:9:9 | -LL | v = 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 1; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.mir.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.mir.stderr index 9d24570057375..8376ee88d9a10 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.mir.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.mir.stderr @@ -4,7 +4,7 @@ error[E0384]: cannot assign twice to immutable variable `v` LL | let v: isize; | - help: make this binding mutable: `mut v` ... -LL | v = 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 1; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.nll.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.nll.stderr index 47b9b029d3171..a6a1c73a78681 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.nll.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.nll.stderr @@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v` LL | let v: isize; | - help: make this binding mutable: `mut v` ... -LL | v = 2; //[ast]~ NOTE first assignment +LL | v = 2; | ----- first assignment to `v` -LL | //[mir]~^ NOTE first assignment -LL | v += 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | +LL | v += 1; | ^^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.stderr index 4ab254beb2d86..b287edf2fda95 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.stderr @@ -1,10 +1,10 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/liveness-assign-imm-local-in-op-eq.rs:10:5 | -LL | v = 2; //[ast]~ NOTE first assignment +LL | v = 2; | ----- first assignment to `v` -LL | //[mir]~^ NOTE first assignment -LL | v += 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | +LL | v += 1; | ^^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.mir.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.mir.stderr index 47b9b029d3171..a6a1c73a78681 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.mir.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.mir.stderr @@ -4,10 +4,10 @@ error[E0384]: cannot assign twice to immutable variable `v` LL | let v: isize; | - help: make this binding mutable: `mut v` ... -LL | v = 2; //[ast]~ NOTE first assignment +LL | v = 2; | ----- first assignment to `v` -LL | //[mir]~^ NOTE first assignment -LL | v += 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | +LL | v += 1; | ^^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.nll.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.nll.stderr index 08a1e9d2bb4ca..8316ffd7f5102 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.nll.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.nll.stderr @@ -1,13 +1,13 @@ error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/liveness-assign-imm-local-with-drop.rs:10:5 | -LL | let b = Box::new(1); //[ast]~ NOTE first assignment +LL | let b = Box::new(1); | - | | | first assignment to `b` | help: make this binding mutable: `mut b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.stderr index d543fb9ac6bd7..108ca48f2fcb8 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.stderr @@ -1,10 +1,10 @@ error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/liveness-assign-imm-local-with-drop.rs:10:5 | -LL | let b = Box::new(1); //[ast]~ NOTE first assignment +LL | let b = Box::new(1); | - first assignment to `b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.mir.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.mir.stderr index 08a1e9d2bb4ca..8316ffd7f5102 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.mir.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.mir.stderr @@ -1,13 +1,13 @@ error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/liveness-assign-imm-local-with-drop.rs:10:5 | -LL | let b = Box::new(1); //[ast]~ NOTE first assignment +LL | let b = Box::new(1); | - | | | first assignment to `b` | help: make this binding mutable: `mut b` ... -LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable +LL | b = Box::new(2); | ^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.nll.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.nll.stderr index 3c1a5692fece7..5fa06f93c1c4b 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.nll.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.nll.stderr @@ -1,13 +1,13 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/liveness-assign-imm-local-with-init.rs:10:5 | -LL | let v: isize = 1; //[ast]~ NOTE first assignment +LL | let v: isize = 1; | - | | | first assignment to `v` | help: make this binding mutable: `mut v` ... -LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 2; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.stderr index cf293ae9f2f70..34fb160bba6c8 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.stderr @@ -1,10 +1,10 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/liveness-assign-imm-local-with-init.rs:10:5 | -LL | let v: isize = 1; //[ast]~ NOTE first assignment +LL | let v: isize = 1; | - first assignment to `v` ... -LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 2; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.mir.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.mir.stderr index 3c1a5692fece7..5fa06f93c1c4b 100644 --- a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.mir.stderr +++ b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.mir.stderr @@ -1,13 +1,13 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/liveness-assign-imm-local-with-init.rs:10:5 | -LL | let v: isize = 1; //[ast]~ NOTE first assignment +LL | let v: isize = 1; | - | | | first assignment to `v` | help: make this binding mutable: `mut v` ... -LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable +LL | v = 2; | ^^^^^ cannot assign twice to immutable variable error: aborting due to previous error diff --git a/src/test/ui/meta-expected-error-correct-rev.a.stderr b/src/test/ui/meta-expected-error-correct-rev.a.stderr index b561a9e5b3afc..901bdcd8e4a7e 100644 --- a/src/test/ui/meta-expected-error-correct-rev.a.stderr +++ b/src/test/ui/meta-expected-error-correct-rev.a.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types --> $DIR/meta-expected-error-correct-rev.rs:7:18 | -LL | let x: u32 = 22_usize; //[a]~ ERROR mismatched types +LL | let x: u32 = 22_usize; | ^^^^^^^^ expected u32, found usize error: aborting due to previous error diff --git a/src/test/ui/mut/mut-pattern-internal-mutability.ast.nll.stderr b/src/test/ui/mut/mut-pattern-internal-mutability.ast.nll.stderr index 82a4628a0e6b7..0db32017b395c 100644 --- a/src/test/ui/mut/mut-pattern-internal-mutability.ast.nll.stderr +++ b/src/test/ui/mut/mut-pattern-internal-mutability.ast.nll.stderr @@ -6,7 +6,7 @@ LL | let &mut x = foo; | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0506]: cannot assign to `*foo` because it is borrowed @@ -14,9 +14,9 @@ error[E0506]: cannot assign to `*foo` because it is borrowed | LL | let &mut ref x = foo; | ----- borrow of `*foo` occurs here -LL | *foo += 1; //[ast]~ ERROR cannot assign to `*foo` because it is borrowed +LL | *foo += 1; | ^^^^^^^^^ assignment to borrowed `*foo` occurs here -LL | //[mir]~^ ERROR cannot assign to `*foo` because it is borrowed +LL | LL | drop(x); | - borrow later used here diff --git a/src/test/ui/mut/mut-pattern-internal-mutability.ast.stderr b/src/test/ui/mut/mut-pattern-internal-mutability.ast.stderr index e3423d5388e43..da33cdf779c27 100644 --- a/src/test/ui/mut/mut-pattern-internal-mutability.ast.stderr +++ b/src/test/ui/mut/mut-pattern-internal-mutability.ast.stderr @@ -3,7 +3,7 @@ error[E0384]: cannot assign twice to immutable variable `x` | LL | let &mut x = foo; | - first assignment to `x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0506]: cannot assign to `*foo` because it is borrowed @@ -11,7 +11,7 @@ error[E0506]: cannot assign to `*foo` because it is borrowed | LL | let &mut ref x = foo; | ----- borrow of `*foo` occurs here -LL | *foo += 1; //[ast]~ ERROR cannot assign to `*foo` because it is borrowed +LL | *foo += 1; | ^^^^^^^^^ assignment to borrowed `*foo` occurs here error: aborting due to 2 previous errors diff --git a/src/test/ui/mut/mut-pattern-internal-mutability.mir.stderr b/src/test/ui/mut/mut-pattern-internal-mutability.mir.stderr index 82a4628a0e6b7..0db32017b395c 100644 --- a/src/test/ui/mut/mut-pattern-internal-mutability.mir.stderr +++ b/src/test/ui/mut/mut-pattern-internal-mutability.mir.stderr @@ -6,7 +6,7 @@ LL | let &mut x = foo; | | | first assignment to `x` | help: make this binding mutable: `mut x` -LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable +LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable error[E0506]: cannot assign to `*foo` because it is borrowed @@ -14,9 +14,9 @@ error[E0506]: cannot assign to `*foo` because it is borrowed | LL | let &mut ref x = foo; | ----- borrow of `*foo` occurs here -LL | *foo += 1; //[ast]~ ERROR cannot assign to `*foo` because it is borrowed +LL | *foo += 1; | ^^^^^^^^^ assignment to borrowed `*foo` occurs here -LL | //[mir]~^ ERROR cannot assign to `*foo` because it is borrowed +LL | LL | drop(x); | - borrow later used here diff --git a/src/test/ui/mut/mutable-class-fields.ast.nll.stderr b/src/test/ui/mut/mutable-class-fields.ast.nll.stderr index 6b36b29d46028..e243fb74dc25a 100644 --- a/src/test/ui/mut/mutable-class-fields.ast.nll.stderr +++ b/src/test/ui/mut/mutable-class-fields.ast.nll.stderr @@ -3,7 +3,7 @@ error[E0594]: cannot assign to `nyan.how_hungry`, as `nyan` is not declared as m | LL | let nyan : Cat = cat(52, 99); | ---- help: consider changing this to be mutable: `mut nyan` -LL | nyan.how_hungry = 0; //[ast]~ ERROR cannot assign +LL | nyan.how_hungry = 0; | ^^^^^^^^^^^^^^^^^^^ cannot assign error: aborting due to previous error diff --git a/src/test/ui/mut/mutable-class-fields.ast.stderr b/src/test/ui/mut/mutable-class-fields.ast.stderr index 80185703a9e02..95a928437df2f 100644 --- a/src/test/ui/mut/mutable-class-fields.ast.stderr +++ b/src/test/ui/mut/mutable-class-fields.ast.stderr @@ -3,7 +3,7 @@ error[E0594]: cannot assign to field `nyan.how_hungry` of immutable binding | LL | let nyan : Cat = cat(52, 99); | ---- help: make this binding mutable: `mut nyan` -LL | nyan.how_hungry = 0; //[ast]~ ERROR cannot assign +LL | nyan.how_hungry = 0; | ^^^^^^^^^^^^^^^^^^^ cannot mutably borrow field of immutable binding error: aborting due to previous error diff --git a/src/test/ui/mut/mutable-class-fields.mir.stderr b/src/test/ui/mut/mutable-class-fields.mir.stderr index 6b36b29d46028..e243fb74dc25a 100644 --- a/src/test/ui/mut/mutable-class-fields.mir.stderr +++ b/src/test/ui/mut/mutable-class-fields.mir.stderr @@ -3,7 +3,7 @@ error[E0594]: cannot assign to `nyan.how_hungry`, as `nyan` is not declared as m | LL | let nyan : Cat = cat(52, 99); | ---- help: consider changing this to be mutable: `mut nyan` -LL | nyan.how_hungry = 0; //[ast]~ ERROR cannot assign +LL | nyan.how_hungry = 0; | ^^^^^^^^^^^^^^^^^^^ cannot assign error: aborting due to previous error diff --git a/src/test/ui/nll/match-guards-always-borrow.ast.nll.stderr b/src/test/ui/nll/match-guards-always-borrow.ast.nll.stderr index 4d647949038ac..82a30db1530c6 100644 --- a/src/test/ui/nll/match-guards-always-borrow.ast.nll.stderr +++ b/src/test/ui/nll/match-guards-always-borrow.ast.nll.stderr @@ -10,7 +10,7 @@ LL | (|| { let bar = foo; bar.take() })(); error: compilation successful --> $DIR/match-guards-always-borrow.rs:47:1 | -LL | / fn main() { //[ast]~ ERROR compilation successful +LL | / fn main() { LL | | should_reject_destructive_mutate_in_guard(); LL | | allow_mutate_in_arm_body(); LL | | allow_move_into_arm_body(); diff --git a/src/test/ui/nll/match-guards-always-borrow.ast.stderr b/src/test/ui/nll/match-guards-always-borrow.ast.stderr index 92d76d577d55f..0c08f20602125 100644 --- a/src/test/ui/nll/match-guards-always-borrow.ast.stderr +++ b/src/test/ui/nll/match-guards-always-borrow.ast.stderr @@ -1,7 +1,7 @@ error: compilation successful --> $DIR/match-guards-always-borrow.rs:47:1 | -LL | / fn main() { //[ast]~ ERROR compilation successful +LL | / fn main() { LL | | should_reject_destructive_mutate_in_guard(); LL | | allow_mutate_in_arm_body(); LL | | allow_move_into_arm_body(); diff --git a/src/test/ui/nll/reference-carried-through-struct-field.ast.nll.stderr b/src/test/ui/nll/reference-carried-through-struct-field.ast.nll.stderr index f28e552901530..1f6eb9a06ba37 100644 --- a/src/test/ui/nll/reference-carried-through-struct-field.ast.nll.stderr +++ b/src/test/ui/nll/reference-carried-through-struct-field.ast.nll.stderr @@ -3,9 +3,9 @@ error[E0503]: cannot use `x` because it was mutably borrowed | LL | let wrapper = Wrap { w: &mut x }; | ------ borrow of `x` occurs here -LL | x += 1; //[ast]~ ERROR cannot assign to `x` because it is borrowed [E0506] +LL | x += 1; | ^^^^^^ use of borrowed `x` -LL | //[mir]~^ ERROR cannot use `x` because it was mutably borrowed [E0503] +LL | LL | *wrapper.w += 1; | --------------- borrow later used here diff --git a/src/test/ui/nll/reference-carried-through-struct-field.ast.stderr b/src/test/ui/nll/reference-carried-through-struct-field.ast.stderr index b19d0b5277cea..3104944339ca8 100644 --- a/src/test/ui/nll/reference-carried-through-struct-field.ast.stderr +++ b/src/test/ui/nll/reference-carried-through-struct-field.ast.stderr @@ -3,7 +3,7 @@ error[E0506]: cannot assign to `x` because it is borrowed | LL | let wrapper = Wrap { w: &mut x }; | - borrow of `x` occurs here -LL | x += 1; //[ast]~ ERROR cannot assign to `x` because it is borrowed [E0506] +LL | x += 1; | ^^^^^^ assignment to borrowed `x` occurs here error: aborting due to previous error diff --git a/src/test/ui/nll/reference-carried-through-struct-field.mir.stderr b/src/test/ui/nll/reference-carried-through-struct-field.mir.stderr index f28e552901530..1f6eb9a06ba37 100644 --- a/src/test/ui/nll/reference-carried-through-struct-field.mir.stderr +++ b/src/test/ui/nll/reference-carried-through-struct-field.mir.stderr @@ -3,9 +3,9 @@ error[E0503]: cannot use `x` because it was mutably borrowed | LL | let wrapper = Wrap { w: &mut x }; | ------ borrow of `x` occurs here -LL | x += 1; //[ast]~ ERROR cannot assign to `x` because it is borrowed [E0506] +LL | x += 1; | ^^^^^^ use of borrowed `x` -LL | //[mir]~^ ERROR cannot use `x` because it was mutably borrowed [E0503] +LL | LL | *wrapper.w += 1; | --------------- borrow later used here diff --git a/src/test/ui/obsolete-in-place/bad.bad.stderr b/src/test/ui/obsolete-in-place/bad.bad.stderr index 245ecb4ed1cb4..468577ab168c7 100644 --- a/src/test/ui/obsolete-in-place/bad.bad.stderr +++ b/src/test/ui/obsolete-in-place/bad.bad.stderr @@ -1,7 +1,7 @@ error: emplacement syntax is obsolete (for now, anyway) --> $DIR/bad.rs:9:5 | -LL | x <- y; //[bad]~ ERROR emplacement syntax is obsolete +LL | x <- y; | ^^^^^^ | = note: for more information, see @@ -9,7 +9,7 @@ LL | x <- y; //[bad]~ ERROR emplacement syntax is obsolete error: emplacement syntax is obsolete (for now, anyway) --> $DIR/bad.rs:10:5 | -LL | in(foo) { bar }; //[bad]~ ERROR emplacement syntax is obsolete +LL | in(foo) { bar }; | ^^^^^^^^^^^^^^^ | = note: for more information, see diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.ast.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.ast.stderr index 73266ab50fad0..a33d3583552dc 100644 --- a/src/test/ui/regions/regions-free-region-ordering-caller.ast.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-caller.ast.stderr @@ -5,7 +5,7 @@ LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { | --------- --------- | | | these two types are declared with different lifetimes... -LL | let z: Option<&'b &'a usize> = None;//[ast]~ ERROR E0623 +LL | let z: Option<&'b &'a usize> = None; | ^^^^^^^^^^^^^^^^^^^^^ ...but data from `a` flows into `b` here error[E0623]: lifetime mismatch @@ -16,7 +16,7 @@ LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { | | | these two types are declared with different lifetimes... LL | let y: Paramd<'a> = Paramd { x: a }; -LL | let z: Option<&'b Paramd<'a>> = None;//[ast]~ ERROR E0623 +LL | let z: Option<&'b Paramd<'a>> = None; | ^^^^^^^^^^^^^^^^^^^^^^ ...but data from `a` flows into `b` here error[E0623]: lifetime mismatch @@ -24,7 +24,7 @@ error[E0623]: lifetime mismatch | LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { | --------- --------- these two types are declared with different lifetimes... -LL | let z: Option<&'a &'b usize> = None;//[ast]~ ERROR E0623 +LL | let z: Option<&'a &'b usize> = None; | ^^^^^^^^^^^^^^^^^^^^^ ...but data from `b` flows into `a` here error: aborting due to 3 previous errors diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.mir.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.mir.stderr index abec468c9ea3e..16eda2844c64c 100644 --- a/src/test/ui/regions/regions-free-region-ordering-caller.mir.stderr +++ b/src/test/ui/regions/regions-free-region-ordering-caller.mir.stderr @@ -5,7 +5,7 @@ LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { | -- -- lifetime `'b` defined here | | | lifetime `'a` defined here -LL | let z: Option<&'b &'a usize> = None;//[ast]~ ERROR E0623 +LL | let z: Option<&'b &'a usize> = None; | ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b` error: lifetime may not live long enough @@ -16,7 +16,7 @@ LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { | | | lifetime `'a` defined here LL | let y: Paramd<'a> = Paramd { x: a }; -LL | let z: Option<&'b Paramd<'a>> = None;//[ast]~ ERROR E0623 +LL | let z: Option<&'b Paramd<'a>> = None; | ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'b` error: lifetime may not live long enough @@ -26,7 +26,7 @@ LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { | -- -- lifetime `'b` defined here | | | lifetime `'a` defined here -LL | let z: Option<&'a &'b usize> = None;//[ast]~ ERROR E0623 +LL | let z: Option<&'a &'b usize> = None; | ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a` error: aborting due to 3 previous errors diff --git a/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.nll.stderr b/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.nll.stderr index 935620075f7c6..b1c5878224d1d 100644 --- a/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.nll.stderr +++ b/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.nll.stderr @@ -4,9 +4,9 @@ error[E0506]: cannot assign to `a1` because it is borrowed LL | match (&a1,) { | --- borrow of `a1` occurs here LL | (&ref b0,) => { -LL | a1 = &f; //[ast]~ ERROR cannot assign +LL | a1 = &f; | ^^^^^^^ assignment to borrowed `a1` occurs here -LL | //[mir]~^ ERROR cannot assign to `a1` because it is borrowed +LL | LL | drop(b0); | -- borrow later used here diff --git a/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.stderr b/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.stderr index e23c6ada2b565..0074d2b4f775d 100644 --- a/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.stderr +++ b/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.stderr @@ -4,7 +4,7 @@ error[E0506]: cannot assign to `a1` because it is borrowed LL | match (&a1,) { | -- borrow of `a1` occurs here LL | (&ref b0,) => { -LL | a1 = &f; //[ast]~ ERROR cannot assign +LL | a1 = &f; | ^^^^^^^ assignment to borrowed `a1` occurs here error: aborting due to previous error diff --git a/src/test/ui/regions/regions-pattern-typing-issue-19997.mir.stderr b/src/test/ui/regions/regions-pattern-typing-issue-19997.mir.stderr index 935620075f7c6..b1c5878224d1d 100644 --- a/src/test/ui/regions/regions-pattern-typing-issue-19997.mir.stderr +++ b/src/test/ui/regions/regions-pattern-typing-issue-19997.mir.stderr @@ -4,9 +4,9 @@ error[E0506]: cannot assign to `a1` because it is borrowed LL | match (&a1,) { | --- borrow of `a1` occurs here LL | (&ref b0,) => { -LL | a1 = &f; //[ast]~ ERROR cannot assign +LL | a1 = &f; | ^^^^^^^ assignment to borrowed `a1` occurs here -LL | //[mir]~^ ERROR cannot assign to `a1` because it is borrowed +LL | LL | drop(b0); | -- borrow later used here diff --git a/src/test/ui/regions/regions-static-bound.ll.stderr b/src/test/ui/regions/regions-static-bound.ll.stderr index 4695a82ebb4cd..d0dc554b6f34f 100644 --- a/src/test/ui/regions/regions-static-bound.ll.stderr +++ b/src/test/ui/regions/regions-static-bound.ll.stderr @@ -1,7 +1,7 @@ error[E0312]: lifetime of reference outlives lifetime of borrowed content... --> $DIR/regions-static-bound.rs:9:5 | -LL | t //[ll]~ ERROR E0312 +LL | t | ^ | = note: ...the reference is valid for the static lifetime... @@ -16,7 +16,7 @@ error[E0621]: explicit lifetime required in the type of `u` | LL | fn error(u: &(), v: &()) { | --- help: add explicit lifetime `'static` to the type of `u`: `&'static ()` -LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621] +LL | static_id(&u); | ^^^^^^^^^ lifetime `'static` required error[E0621]: explicit lifetime required in the type of `v` @@ -25,7 +25,7 @@ error[E0621]: explicit lifetime required in the type of `v` LL | fn error(u: &(), v: &()) { | --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()` ... -LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621] +LL | static_id_indirect(&v); | ^^^^^^^^^^^^^^^^^^ lifetime `'static` required error: aborting due to 3 previous errors diff --git a/src/test/ui/regions/regions-static-bound.nll.stderr b/src/test/ui/regions/regions-static-bound.nll.stderr index d6cec03e0ff2e..b5f3e6cfaba09 100644 --- a/src/test/ui/regions/regions-static-bound.nll.stderr +++ b/src/test/ui/regions/regions-static-bound.nll.stderr @@ -3,7 +3,7 @@ error: lifetime may not live long enough | LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { | -- lifetime `'a` defined here -LL | t //[ll]~ ERROR E0312 +LL | t | ^ returning this value requires that `'a` must outlive `'static` error[E0621]: explicit lifetime required in the type of `u` @@ -11,7 +11,7 @@ error[E0621]: explicit lifetime required in the type of `u` | LL | fn error(u: &(), v: &()) { | --- help: add explicit lifetime `'static` to the type of `u`: `&'static ()` -LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621] +LL | static_id(&u); | ^^^^^^^^^^^^^ lifetime `'static` required error[E0621]: explicit lifetime required in the type of `v` @@ -20,7 +20,7 @@ error[E0621]: explicit lifetime required in the type of `v` LL | fn error(u: &(), v: &()) { | --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()` ... -LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621] +LL | static_id_indirect(&v); | ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required error: aborting due to 3 previous errors diff --git a/src/test/ui/rfc1445/feature-gate.no_gate.stderr b/src/test/ui/rfc1445/feature-gate.no_gate.stderr index 8c6a08d84a493..370b74b8779c0 100644 --- a/src/test/ui/rfc1445/feature-gate.no_gate.stderr +++ b/src/test/ui/rfc1445/feature-gate.no_gate.stderr @@ -1,7 +1,7 @@ error[E0658]: the semantics of constant patterns is not yet settled (see issue #31434) --> $DIR/feature-gate.rs:13:1 | -LL | #[structural_match] //[no_gate]~ ERROR semantics of constant patterns is not yet settled +LL | #[structural_match] | ^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(structural_match)] to the crate attributes to enable diff --git a/src/test/ui/rfc1445/feature-gate.with_gate.stderr b/src/test/ui/rfc1445/feature-gate.with_gate.stderr index da681662c2fa8..ca8dc75c5335f 100644 --- a/src/test/ui/rfc1445/feature-gate.with_gate.stderr +++ b/src/test/ui/rfc1445/feature-gate.with_gate.stderr @@ -1,7 +1,7 @@ error: compilation successful --> $DIR/feature-gate.rs:21:1 | -LL | / fn main() { //[with_gate]~ ERROR compilation successful +LL | / fn main() { LL | | let y = Foo { x: 1 }; LL | | match y { LL | | FOO => { } diff --git a/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr index 2f83a6485cdd7..3440edeadf9c1 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr @@ -10,8 +10,8 @@ help: consider changing this to accept closures that implement `FnMut` LL | call(|| { | __________^ LL | | counter += 1; -LL | | //[ast]~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure -LL | | //[mir]~^^ ERROR cannot assign to `counter` +LL | | +LL | | LL | | }); | |_____^ diff --git a/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr index 293f59ff4b27a..07883500b822e 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr @@ -10,8 +10,8 @@ help: consider changing this closure to take self by mutable reference LL | call(|| { | __________^ LL | | counter += 1; -LL | | //[ast]~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure -LL | | //[mir]~^^ ERROR cannot assign to `counter` +LL | | +LL | | LL | | }); | |_____^ diff --git a/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr index 2f83a6485cdd7..3440edeadf9c1 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr @@ -10,8 +10,8 @@ help: consider changing this to accept closures that implement `FnMut` LL | call(|| { | __________^ LL | | counter += 1; -LL | | //[ast]~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure -LL | | //[mir]~^^ ERROR cannot assign to `counter` +LL | | +LL | | LL | | }); | |_____^ From 704649d96d8a75aded78560eb0a1136b1e520dc9 Mon Sep 17 00:00:00 2001 From: Mathias Blikstad Date: Sun, 17 Mar 2019 17:01:59 +0100 Subject: [PATCH 3/3] Removed obsolete .stderr test outputs --- src/test/ui/E0508.ast.stderr | 12 -- src/test/ui/E0508.mir.stderr | 12 -- .../borrowck/borrowck-union-borrow.mir.stderr | 136 ------------------ 3 files changed, 160 deletions(-) delete mode 100644 src/test/ui/E0508.ast.stderr delete mode 100644 src/test/ui/E0508.mir.stderr delete mode 100644 src/test/ui/borrowck/borrowck-union-borrow.mir.stderr diff --git a/src/test/ui/E0508.ast.stderr b/src/test/ui/E0508.ast.stderr deleted file mode 100644 index 88401d0d88f1d..0000000000000 --- a/src/test/ui/E0508.ast.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array - --> $DIR/E0508.rs:18:18 - | -LL | let _value = array[0]; - | ^^^^^^^^ - | | - | cannot move out of here - | help: consider using a reference instead: `&array[0]` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/ui/E0508.mir.stderr b/src/test/ui/E0508.mir.stderr deleted file mode 100644 index 88401d0d88f1d..0000000000000 --- a/src/test/ui/E0508.mir.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array - --> $DIR/E0508.rs:18:18 - | -LL | let _value = array[0]; - | ^^^^^^^^ - | | - | cannot move out of here - | help: consider using a reference instead: `&array[0]` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/ui/borrowck/borrowck-union-borrow.mir.stderr b/src/test/ui/borrowck/borrowck-union-borrow.mir.stderr deleted file mode 100644 index 6855437d4c2f5..0000000000000 --- a/src/test/ui/borrowck/borrowck-union-borrow.mir.stderr +++ /dev/null @@ -1,136 +0,0 @@ -error[E0502]: cannot borrow `u.a` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-union-borrow.rs:27:23 - | -LL | let ra = &u.a; - | ---- immutable borrow occurs here -LL | let rma = &mut u.a; - | ^^^^^^^^ mutable borrow occurs here -LL | -LL | drop(ra); - | -- immutable borrow later used here - -error[E0506]: cannot assign to `u.a` because it is borrowed - --> $DIR/borrowck-union-borrow.rs:33:13 - | -LL | let ra = &u.a; - | ---- borrow of `u.a` occurs here -LL | u.a = 1; - | ^^^^^^^ assignment to borrowed `u.a` occurs here -LL | -LL | drop(ra); - | -- borrow later used here - -error[E0502]: cannot borrow `u.b` as mutable because it is also borrowed as immutable - --> $DIR/borrowck-union-borrow.rs:50:23 - | -LL | let ra = &u.a; - | ---- immutable borrow occurs here -LL | let rmb = &mut u.b; - | ^^^^^^^^ mutable borrow occurs here -LL | -LL | drop(ra); - | -- immutable borrow later used here - -error[E0506]: cannot assign to `u.b` because it is borrowed - --> $DIR/borrowck-union-borrow.rs:56:13 - | -LL | let ra = &u.a; - | ---- borrow of `u.b` occurs here -LL | u.b = 1; - | ^^^^^^^ assignment to borrowed `u.b` occurs here -LL | -LL | drop(ra); - | -- borrow later used here - -error[E0502]: cannot borrow `u.a` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-union-borrow.rs:63:22 - | -LL | let rma = &mut u.a; - | -------- mutable borrow occurs here -LL | let ra = &u.a; - | ^^^^ immutable borrow occurs here -LL | -LL | drop(rma); - | --- mutable borrow later used here - -error[E0503]: cannot use `u.a` because it was mutably borrowed - --> $DIR/borrowck-union-borrow.rs:69:21 - | -LL | let ra = &mut u.a; - | -------- borrow of `u.a` occurs here -LL | let a = u.a; - | ^^^ use of borrowed `u.a` -LL | -LL | drop(ra); - | -- borrow later used here - -error[E0499]: cannot borrow `u.a` as mutable more than once at a time - --> $DIR/borrowck-union-borrow.rs:75:24 - | -LL | let rma = &mut u.a; - | -------- first mutable borrow occurs here -LL | let rma2 = &mut u.a; - | ^^^^^^^^ second mutable borrow occurs here -LL | -LL | drop(rma); - | --- first borrow later used here - -error[E0506]: cannot assign to `u.a` because it is borrowed - --> $DIR/borrowck-union-borrow.rs:81:13 - | -LL | let rma = &mut u.a; - | -------- borrow of `u.a` occurs here -LL | u.a = 1; - | ^^^^^^^ assignment to borrowed `u.a` occurs here -LL | -LL | drop(rma); - | --- borrow later used here - -error[E0502]: cannot borrow `u.b` as immutable because it is also borrowed as mutable - --> $DIR/borrowck-union-borrow.rs:88:22 - | -LL | let rma = &mut u.a; - | -------- mutable borrow occurs here -LL | let rb = &u.b; - | ^^^^ immutable borrow occurs here -LL | -LL | drop(rma); - | --- mutable borrow later used here - -error[E0503]: cannot use `u.b` because it was mutably borrowed - --> $DIR/borrowck-union-borrow.rs:94:21 - | -LL | let ra = &mut u.a; - | -------- borrow of `u.a` occurs here -LL | let b = u.b; - | ^^^ use of borrowed `u.a` -... -LL | drop(ra); - | -- borrow later used here - -error[E0499]: cannot borrow `u.b` as mutable more than once at a time - --> $DIR/borrowck-union-borrow.rs:101:24 - | -LL | let rma = &mut u.a; - | -------- first mutable borrow occurs here -LL | let rmb2 = &mut u.b; - | ^^^^^^^^ second mutable borrow occurs here -LL | -LL | drop(rma); - | --- first borrow later used here - -error[E0506]: cannot assign to `u.b` because it is borrowed - --> $DIR/borrowck-union-borrow.rs:107:13 - | -LL | let rma = &mut u.a; - | -------- borrow of `u.b` occurs here -LL | u.b = 1; - | ^^^^^^^ assignment to borrowed `u.b` occurs here -LL | -LL | drop(rma); - | --- borrow later used here - -error: aborting due to 12 previous errors - -Some errors occurred: E0499, E0502, E0503, E0506. -For more information about an error, try `rustc --explain E0499`.