about summary refs log tree commit diff
path: root/src/test/ui/borrowck
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-30 01:40:30 +0000
committerbors <bors@rust-lang.org>2021-09-30 01:40:30 +0000
commit4aa7879b559ccf7f82bcce2a8e532ea307697ea9 (patch)
tree393753bcad9b7b9d238c34eed23e40e8e6d54581 /src/test/ui/borrowck
parent24a789b666f2c36d443cde48b5baef04e5b3c76d (diff)
parent4d66986e090abed11c1aae9602f23385f94154fa (diff)
Auto merge of #89110 - Aaron1011:adjustment-span, r=estebank
Use larger span for adjustment THIR expressions

Currently, we use a relatively 'small' span for THIR
expressions generated by an 'adjustment' (e.g. an autoderef,
autoborrow, unsizing). As a result, if a borrow generated
by an adustment ends up causing a borrowcheck error, for example:

```rust
let mut my_var = String::new();
let my_ref = &my_var
my_var.push('a');
my_ref;
```

then the span for the mutable borrow may end up referring
to only the base expression (e.g. `my_var`), rather than
the method call which triggered the mutable borrow
(e.g. `my_var.push('a')`)

Due to a quirk of the MIR borrowck implementation,
this doesn't always get exposed in migration mode,
but it does in many cases.

This commit makes THIR building consistently use 'larger'
spans for adjustment expressions. These spans are recoded
when we first create the adjustment during typecheck. For
example, an autoref adjustment triggered by a method call
will record the span of the entire method call.

The intent of this change it make it clearer to users
when it's the specific way in which a variable is
used (for example, in a method call) that produdes
a borrowcheck error. For example, an error message
claiming that a 'mutable borrow occurs here' might
be confusing if it just points at a usage of a variable
(e.g. `my_var`), when no `&mut` is in sight. Pointing
at the entire expression should help to emphasize
that the method call itself is responsible for
the mutable borrow.

In several cases, this makes the `#![feature(nll)]` diagnostic
output match up exactly with the default (migration mode) output.
As a result, several `.nll.stderr` files end up getting removed
entirely.
Diffstat (limited to 'src/test/ui/borrowck')
-rw-r--r--src/test/ui/borrowck/borrow-tuple-fields.stderr12
-rw-r--r--src/test/ui/borrowck/borrowck-argument.stderr8
-rw-r--r--src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-borrow-mut-object-twice.stderr6
-rw-r--r--src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.stderr14
-rw-r--r--src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-closures-unique-imm.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-describe-lvalue.stderr12
-rw-r--r--src/test/ui/borrowck/borrowck-for-loop-head-linkage.nll.stderr27
-rw-r--r--src/test/ui/borrowck/borrowck-insert-during-each.stderr20
-rw-r--r--src/test/ui/borrowck/borrowck-issue-2657-1.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-lend-flow-if.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-lend-flow.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-loan-blocks-move-cc.stderr4
-rw-r--r--src/test/ui/borrowck/borrowck-loan-blocks-move.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-loan-in-overloaded-op.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-loan-rcvr.stderr18
-rw-r--r--src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-move-mut-base-ptr.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr10
-rw-r--r--src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr4
-rw-r--r--src/test/ui/borrowck/borrowck-object-lifetime.nll.stderr23
-rw-r--r--src/test/ui/borrowck/borrowck-object-lifetime.stderr8
-rw-r--r--src/test/ui/borrowck/borrowck-overloaded-index-autoderef.stderr16
-rw-r--r--src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr6
-rw-r--r--src/test/ui/borrowck/borrowck-swap-mut-base-ptr.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-union-borrow-nested.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-uniq-via-lend.stderr4
-rw-r--r--src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr4
-rw-r--r--src/test/ui/borrowck/index-mut-help-with-impl.stderr2
-rw-r--r--src/test/ui/borrowck/index-mut-help.stderr2
-rw-r--r--src/test/ui/borrowck/issue-42344.stderr2
-rw-r--r--src/test/ui/borrowck/issue-51117.stderr2
-rw-r--r--src/test/ui/borrowck/issue-81365-10.stderr2
-rw-r--r--src/test/ui/borrowck/issue-81365-5.stderr2
-rw-r--r--src/test/ui/borrowck/issue-82032.stderr2
-rw-r--r--src/test/ui/borrowck/issue-82462.nll.stderr22
-rw-r--r--src/test/ui/borrowck/issue-85581.stderr2
-rw-r--r--src/test/ui/borrowck/issue-85765.stderr2
-rw-r--r--src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr2
-rw-r--r--src/test/ui/borrowck/mut-borrow-outside-loop.stderr4
-rw-r--r--src/test/ui/borrowck/two-phase-across-loop.stderr2
-rw-r--r--src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr19
-rw-r--r--src/test/ui/borrowck/two-phase-multi-mut.stderr5
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr5
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr5
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr10
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr10
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.nll.stderr15
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr10
-rw-r--r--src/test/ui/borrowck/two-phase-sneaky.stderr2
-rw-r--r--src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr37
56 files changed, 178 insertions, 219 deletions
diff --git a/src/test/ui/borrowck/borrow-tuple-fields.stderr b/src/test/ui/borrowck/borrow-tuple-fields.stderr
index 503ea49d74e..ad628abcbfc 100644
--- a/src/test/ui/borrowck/borrow-tuple-fields.stderr
+++ b/src/test/ui/borrowck/borrow-tuple-fields.stderr
@@ -7,7 +7,7 @@ LL |     let y = x;
    |             ^ move out of `x` occurs here
 LL | 
 LL |     r.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable
   --> $DIR/borrow-tuple-fields.rs:18:13
@@ -17,7 +17,7 @@ LL |     let a = &x.0;
 LL |     let b = &mut x.0;
    |             ^^^^^^^^ mutable borrow occurs here
 LL |     a.use_ref();
-   |     - immutable borrow later used here
+   |     ----------- immutable borrow later used here
 
 error[E0499]: cannot borrow `x.0` as mutable more than once at a time
   --> $DIR/borrow-tuple-fields.rs:23:13
@@ -27,7 +27,7 @@ LL |     let a = &mut x.0;
 LL |     let b = &mut x.0;
    |             ^^^^^^^^ second mutable borrow occurs here
 LL |     a.use_ref();
-   |     - first borrow later used here
+   |     ----------- first borrow later used here
 
 error[E0505]: cannot move out of `x` because it is borrowed
   --> $DIR/borrow-tuple-fields.rs:28:13
@@ -37,7 +37,7 @@ LL |     let r = &x.0;
 LL |     let y = x;
    |             ^ move out of `x` occurs here
 LL |     r.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable
   --> $DIR/borrow-tuple-fields.rs:33:13
@@ -47,7 +47,7 @@ LL |     let a = &x.0;
 LL |     let b = &mut x.0;
    |             ^^^^^^^^ mutable borrow occurs here
 LL |     a.use_ref();
-   |     - immutable borrow later used here
+   |     ----------- immutable borrow later used here
 
 error[E0499]: cannot borrow `x.0` as mutable more than once at a time
   --> $DIR/borrow-tuple-fields.rs:38:13
@@ -57,7 +57,7 @@ LL |     let a = &mut x.0;
 LL |     let b = &mut x.0;
    |             ^^^^^^^^ second mutable borrow occurs here
 LL |     a.use_mut();
-   |     - first borrow later used here
+   |     ----------- first borrow later used here
 
 error: aborting due to 6 previous errors
 
diff --git a/src/test/ui/borrowck/borrowck-argument.stderr b/src/test/ui/borrowck/borrowck-argument.stderr
index cf158331409..d4d646e390c 100644
--- a/src/test/ui/borrowck/borrowck-argument.stderr
+++ b/src/test/ui/borrowck/borrowck-argument.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
 LL | fn func(arg: S) {
    |         --- help: consider changing this to be mutable: `mut arg`
 LL |     arg.mutate();
-   |     ^^^ cannot borrow as mutable
+   |     ^^^^^^^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
   --> $DIR/borrowck-argument.rs:15:9
@@ -12,7 +12,7 @@ error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
 LL |     fn method(&self, arg: S) {
    |                      --- help: consider changing this to be mutable: `mut arg`
 LL |         arg.mutate();
-   |         ^^^ cannot borrow as mutable
+   |         ^^^^^^^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
   --> $DIR/borrowck-argument.rs:21:9
@@ -20,13 +20,13 @@ error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
 LL |     fn default(&self, arg: S) {
    |                       --- help: consider changing this to be mutable: `mut arg`
 LL |         arg.mutate();
-   |         ^^^ cannot borrow as mutable
+   |         ^^^^^^^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable
   --> $DIR/borrowck-argument.rs:32:17
    |
 LL |     (|arg: S| { arg.mutate() })(s);
-   |       ---       ^^^ cannot borrow as mutable
+   |       ---       ^^^^^^^^^^^^ cannot borrow as mutable
    |       |
    |       help: consider changing this to be mutable: `mut arg`
 
diff --git a/src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr b/src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr
index 3ed76c13f6a..186ecddd6d6 100644
--- a/src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr
+++ b/src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
 LL |     let x = Foo { x: 3 };
    |         - help: consider changing this to be mutable: `mut x`
 LL |     x.printme();
-   |     ^ cannot borrow as mutable
+   |     ^^^^^^^^^^^ cannot borrow as mutable
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr b/src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr
index 76dc01202f6..237071e16fc 100644
--- a/src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr
+++ b/src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow `*a` as mutable, as `a` is not declared as mutable
 LL |     let a: Box<_> = Box::new(A);
    |         - help: consider changing this to be mutable: `mut a`
 LL |     a.foo();
-   |     ^ cannot borrow as mutable
+   |     ^^^^^^^ cannot borrow as mutable
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-borrow-mut-object-twice.stderr b/src/test/ui/borrowck/borrowck-borrow-mut-object-twice.stderr
index fa0ae318e72..42b6c34cd2f 100644
--- a/src/test/ui/borrowck/borrowck-borrow-mut-object-twice.stderr
+++ b/src/test/ui/borrowck/borrowck-borrow-mut-object-twice.stderr
@@ -2,11 +2,11 @@ error[E0499]: cannot borrow `*x` as mutable more than once at a time
   --> $DIR/borrowck-borrow-mut-object-twice.rs:13:5
    |
 LL |     let y = x.f1();
-   |             - first mutable borrow occurs here
+   |             ------ first mutable borrow occurs here
 LL |     x.f2();
-   |     ^ second mutable borrow occurs here
+   |     ^^^^^^ second mutable borrow occurs here
 LL |     y.use_ref();
-   |     - first borrow later used here
+   |     ----------- first borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.stderr b/src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.stderr
index 426d5bc4726..fdf6568d839 100644
--- a/src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.stderr
+++ b/src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.stderr
@@ -58,7 +58,7 @@ error[E0596]: cannot borrow data in an `Rc` as mutable
   --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:72:5
    |
 LL |     x.set(0, 0);
-   |     ^ cannot borrow as mutable
+   |     ^^^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Rc<Point>`
 
@@ -66,7 +66,7 @@ error[E0596]: cannot borrow data in an `Rc` as mutable
   --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:76:5
    |
 LL |     x.set(0, 0);
-   |     ^ cannot borrow as mutable
+   |     ^^^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Rc<Point>`
 
@@ -74,7 +74,7 @@ error[E0596]: cannot borrow data in an `Rc` as mutable
   --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:84:5
    |
 LL |     x.y_mut()
-   |     ^ cannot borrow as mutable
+   |     ^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Rc<Point>`
 
@@ -82,7 +82,7 @@ error[E0596]: cannot borrow data in an `Rc` as mutable
   --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:88:5
    |
 LL |     x.y_mut()
-   |     ^ cannot borrow as mutable
+   |     ^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Rc<Point>`
 
@@ -90,7 +90,7 @@ error[E0596]: cannot borrow data in an `Rc` as mutable
   --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:92:6
    |
 LL |     *x.y_mut() = 3;
-   |      ^ cannot borrow as mutable
+   |      ^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Rc<Point>`
 
@@ -98,7 +98,7 @@ error[E0596]: cannot borrow data in an `Rc` as mutable
   --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:96:6
    |
 LL |     *x.y_mut() = 3;
-   |      ^ cannot borrow as mutable
+   |      ^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Rc<Point>`
 
@@ -106,7 +106,7 @@ error[E0596]: cannot borrow data in an `Rc` as mutable
   --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:100:6
    |
 LL |     *x.y_mut() = 3;
-   |      ^ cannot borrow as mutable
+   |      ^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Rc<Point>`
 
diff --git a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.stderr b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.stderr
index c91a4377b4c..01379ed8512 100644
--- a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.stderr
+++ b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.stderr
@@ -7,7 +7,7 @@ LL |     buggy_map.insert(42, &*Box::new(1));
    |                            creates a temporary which is freed while still in use
 ...
 LL |     buggy_map.insert(43, &*tmp);
-   |     --------- borrow later used here
+   |     --------------------------- borrow later used here
    |
    = note: consider using a `let` binding to create a longer lived value
 
diff --git a/src/test/ui/borrowck/borrowck-closures-unique-imm.stderr b/src/test/ui/borrowck/borrowck-closures-unique-imm.stderr
index b8bbb31a355..0c5fd39b718 100644
--- a/src/test/ui/borrowck/borrowck-closures-unique-imm.stderr
+++ b/src/test/ui/borrowck/borrowck-closures-unique-imm.stderr
@@ -6,7 +6,7 @@ LL |         let p = &this.x;
 LL |         &mut this.x;
    |         ^^^^^^^^^^^ mutable borrow occurs here
 LL |         p.use_ref();
-   |         - immutable borrow later used here
+   |         ----------- immutable borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
index 4b9c5a2a98f..f909dbc4082 100644
--- a/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
+++ b/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
@@ -41,7 +41,7 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed
   --> $DIR/borrowck-describe-lvalue.rs:37:9
    |
 LL |         let x = f.x();
-   |                 - borrow of `f` occurs here
+   |                 ----- borrow of `f` occurs here
 LL |         f.x;
    |         ^^^ use of borrowed `f`
 LL |         drop(x);
@@ -51,7 +51,7 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed
   --> $DIR/borrowck-describe-lvalue.rs:44:9
    |
 LL |         let x = g.x();
-   |                 - borrow of `g` occurs here
+   |                 ----- borrow of `g` occurs here
 LL |         g.0;
    |         ^^^ use of borrowed `g`
 LL |         drop(x);
@@ -71,7 +71,7 @@ error[E0503]: cannot use `e.0` because it was mutably borrowed
   --> $DIR/borrowck-describe-lvalue.rs:59:20
    |
 LL |         let x = e.x();
-   |                 - borrow of `e` occurs here
+   |                 ----- borrow of `e` occurs here
 LL |         match e {
 LL |             Baz::X(value) => value
    |                    ^^^^^ use of borrowed `e`
@@ -93,7 +93,7 @@ error[E0503]: cannot use `f.x` because it was mutably borrowed
   --> $DIR/borrowck-describe-lvalue.rs:74:9
    |
 LL |         let x = f.x();
-   |                 - borrow of `*f` occurs here
+   |                 ----- borrow of `*f` occurs here
 LL |         f.x;
    |         ^^^ use of borrowed `*f`
 LL |         drop(x);
@@ -103,7 +103,7 @@ error[E0503]: cannot use `g.0` because it was mutably borrowed
   --> $DIR/borrowck-describe-lvalue.rs:81:9
    |
 LL |         let x = g.x();
-   |                 - borrow of `*g` occurs here
+   |                 ----- borrow of `*g` occurs here
 LL |         g.0;
    |         ^^^ use of borrowed `*g`
 LL |         drop(x);
@@ -123,7 +123,7 @@ error[E0503]: cannot use `e.0` because it was mutably borrowed
   --> $DIR/borrowck-describe-lvalue.rs:96:20
    |
 LL |         let x = e.x();
-   |                 - borrow of `*e` occurs here
+   |                 ----- borrow of `*e` occurs here
 LL |         match *e {
 LL |             Baz::X(value) => value
    |                    ^^^^^ use of borrowed `*e`
diff --git a/src/test/ui/borrowck/borrowck-for-loop-head-linkage.nll.stderr b/src/test/ui/borrowck/borrowck-for-loop-head-linkage.nll.stderr
deleted file mode 100644
index 3468f29fb1a..00000000000
--- a/src/test/ui/borrowck/borrowck-for-loop-head-linkage.nll.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error[E0502]: cannot borrow `vector` as mutable because it is also borrowed as immutable
-  --> $DIR/borrowck-for-loop-head-linkage.rs:7:9
-   |
-LL |     for &x in &vector {
-   |               -------
-   |               |
-   |               immutable borrow occurs here
-   |               immutable borrow later used here
-LL |         let cap = vector.capacity();
-LL |         vector.extend(repeat(0));
-   |         ^^^^^^ mutable borrow occurs here
-
-error[E0502]: cannot borrow `vector` as mutable because it is also borrowed as immutable
-  --> $DIR/borrowck-for-loop-head-linkage.rs:8:9
-   |
-LL |     for &x in &vector {
-   |               -------
-   |               |
-   |               immutable borrow occurs here
-   |               immutable borrow later used here
-...
-LL |         vector[1] = 5;
-   |         ^^^^^^ mutable borrow occurs here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/borrowck/borrowck-insert-during-each.stderr b/src/test/ui/borrowck/borrowck-insert-during-each.stderr
index a1ac45795fa..99d08e905d5 100644
--- a/src/test/ui/borrowck/borrowck-insert-during-each.stderr
+++ b/src/test/ui/borrowck/borrowck-insert-during-each.stderr
@@ -16,15 +16,17 @@ LL | |         })
 error[E0500]: closure requires unique access to `f` but it is already borrowed
   --> $DIR/borrowck-insert-during-each.rs:18:9
    |
-LL |     f.foo(
-   |     - --- first borrow later used by call
-   |     |
-   |     borrow occurs here
-LL |
-LL |         |a| {
-   |         ^^^ closure construction occurs here
-LL |             f.n.insert(*a);
-   |             --- second borrow occurs due to use of `f` in closure
+LL |       f.foo(
+   |       - --- first borrow later used by call
+   |  _____|
+   | |
+LL | |
+LL | |         |a| {
+   | |         ^^^ closure construction occurs here
+LL | |             f.n.insert(*a);
+   | |             --- second borrow occurs due to use of `f` in closure
+LL | |         })
+   | |__________- borrow occurs here
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/borrowck/borrowck-issue-2657-1.stderr b/src/test/ui/borrowck/borrowck-issue-2657-1.stderr
index 4ea4eb8f007..390bb9384f8 100644
--- a/src/test/ui/borrowck/borrowck-issue-2657-1.stderr
+++ b/src/test/ui/borrowck/borrowck-issue-2657-1.stderr
@@ -6,7 +6,7 @@ LL |       Some(ref _y) => {
 LL |         let _a = x;
    |                  ^ move out of `x` occurs here
 LL |         _y.use_ref();
-   |         -- borrow later used here
+   |         ------------ borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-lend-flow-if.stderr b/src/test/ui/borrowck/borrowck-lend-flow-if.stderr
index 68a82bdb57c..e47efc0e0b3 100644
--- a/src/test/ui/borrowck/borrowck-lend-flow-if.stderr
+++ b/src/test/ui/borrowck/borrowck-lend-flow-if.stderr
@@ -7,7 +7,7 @@ LL |     }
 LL |     borrow_mut(&mut *v);
    |                ^^^^^^^ mutable borrow occurs here
 LL |     _w.use_ref();
-   |     -- immutable borrow later used here
+   |     ------------ immutable borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-lend-flow.stderr b/src/test/ui/borrowck/borrowck-lend-flow.stderr
index 07b11b3e728..40c14f54cb8 100644
--- a/src/test/ui/borrowck/borrowck-lend-flow.stderr
+++ b/src/test/ui/borrowck/borrowck-lend-flow.stderr
@@ -6,7 +6,7 @@ LL |     let _w = &v;
 LL |     borrow_mut(&mut *v);
    |                ^^^^^^^ mutable borrow occurs here
 LL |     _w.use_ref();
-   |     -- immutable borrow later used here
+   |     ------------ immutable borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-loan-blocks-move-cc.stderr b/src/test/ui/borrowck/borrowck-loan-blocks-move-cc.stderr
index ac25502ad05..3548da35b61 100644
--- a/src/test/ui/borrowck/borrowck-loan-blocks-move-cc.stderr
+++ b/src/test/ui/borrowck/borrowck-loan-blocks-move-cc.stderr
@@ -10,7 +10,7 @@ LL |         println!("v={}", *v);
    |                          -- move occurs due to use in closure
 LL |     });
 LL |     w.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error[E0505]: cannot move out of `v` because it is borrowed
   --> $DIR/borrowck-loan-blocks-move-cc.rs:24:19
@@ -24,7 +24,7 @@ LL |         println!("v={}", *v);
    |                          -- move occurs due to use in closure
 LL |     });
 LL |     w.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/borrowck/borrowck-loan-blocks-move.stderr b/src/test/ui/borrowck/borrowck-loan-blocks-move.stderr
index 615660febbc..b5c6b101f76 100644
--- a/src/test/ui/borrowck/borrowck-loan-blocks-move.stderr
+++ b/src/test/ui/borrowck/borrowck-loan-blocks-move.stderr
@@ -6,7 +6,7 @@ LL |     let w = &v;
 LL |     take(v);
    |          ^ move out of `v` occurs here
 LL |     w.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.stderr b/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.stderr
index cd288065b74..0dd720ff6ce 100644
--- a/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.stderr
+++ b/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.stderr
@@ -4,7 +4,7 @@ error[E0382]: borrow of moved value: `x`
 LL |     let x = Foo(Box::new(3));
    |         - move occurs because `x` has type `Foo`, which does not implement the `Copy` trait
 LL |     let _y = {x} + x.clone(); // the `{x}` forces a move to occur
-   |               -    ^ value borrowed here after move
+   |               -    ^^^^^^^^^ value borrowed here after move
    |               |
    |               value moved here
 
diff --git a/src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.stderr b/src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.stderr
index aa874c34a22..1d8d04c9181 100644
--- a/src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.stderr
+++ b/src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.stderr
@@ -17,7 +17,7 @@ LL |     let q = &mut p;
    |             ------ mutable borrow occurs here
 ...
 LL |     p.times(3);
-   |     ^ immutable borrow occurs here
+   |     ^^^^^^^^^^ immutable borrow occurs here
 LL | 
 LL |     *q + 3; // OK to use the new alias `q`
    |     -- mutable borrow later used here
diff --git a/src/test/ui/borrowck/borrowck-loan-rcvr.stderr b/src/test/ui/borrowck/borrowck-loan-rcvr.stderr
index 489ec7d04ed..74cad575d27 100644
--- a/src/test/ui/borrowck/borrowck-loan-rcvr.stderr
+++ b/src/test/ui/borrowck/borrowck-loan-rcvr.stderr
@@ -1,13 +1,15 @@
 error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
   --> $DIR/borrowck-loan-rcvr.rs:23:14
    |
-LL |     p.blockm(|| {
-   |     - ------ ^^ mutable borrow occurs here
-   |     | |
-   |     | immutable borrow later used by call
-   |     immutable borrow occurs here
-LL |         p.x = 10;
-   |         --- second borrow occurs due to use of `p` in closure
+LL |       p.blockm(|| {
+   |       - ------ ^^ mutable borrow occurs here
+   |       | |
+   |  _____| immutable borrow later used by call
+   | |
+LL | |         p.x = 10;
+   | |         --- second borrow occurs due to use of `p` in closure
+LL | |     })
+   | |______- immutable borrow occurs here
 
 error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable
   --> $DIR/borrowck-loan-rcvr.rs:34:5
@@ -15,7 +17,7 @@ error[E0502]: cannot borrow `p` as immutable because it is also borrowed as muta
 LL |     let l = &mut p;
    |             ------ mutable borrow occurs here
 LL |     p.impurem();
-   |     ^ immutable borrow occurs here
+   |     ^^^^^^^^^^^ immutable borrow occurs here
 LL | 
 LL |     l.x += 1;
    |     -------- mutable borrow later used here
diff --git a/src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr b/src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr
index e4840fba672..b305e3c0a16 100644
--- a/src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr
+++ b/src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr
@@ -7,7 +7,7 @@ LL |
 LL |     let z = *a;
    |             ^^ move out of `*a` occurs here
 LL |     b.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-move-mut-base-ptr.stderr b/src/test/ui/borrowck/borrowck-move-mut-base-ptr.stderr
index 77f5b72e51c..d5ff0c501c4 100644
--- a/src/test/ui/borrowck/borrowck-move-mut-base-ptr.stderr
+++ b/src/test/ui/borrowck/borrowck-move-mut-base-ptr.stderr
@@ -7,7 +7,7 @@ LL |     let t1 = t0;
    |              ^^ move out of `t0` occurs here
 LL |     *t1 = 22;
 LL |     p.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr
index 0a29d2bb1d5..79745065070 100644
--- a/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.stderr
@@ -2,7 +2,7 @@ error[E0507]: cannot move out of an `Rc`
   --> $DIR/borrowck-move-out-of-overloaded-auto-deref.rs:4:14
    |
 LL |     let _x = Rc::new(vec![1, 2]).into_iter();
-   |              ^^^^^^^^^^^^^^^^^^^ move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
+   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr
index a4090777939..15ac737606d 100644
--- a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr
+++ b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr
@@ -5,8 +5,9 @@ LL |             1 => { addr.push(&mut x); }
    |                              ^^^^^^ second mutable borrow occurs here
 LL |             2 => { addr.push(&mut x); }
 LL |             _ => { addr.push(&mut x); }
-   |                    ----      ------ first mutable borrow occurs here
-   |                    |
+   |                    -----------------
+   |                    |         |
+   |                    |         first mutable borrow occurs here
    |                    first borrow later used here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time
@@ -15,8 +16,9 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
 LL |             2 => { addr.push(&mut x); }
    |                              ^^^^^^ second mutable borrow occurs here
 LL |             _ => { addr.push(&mut x); }
-   |                    ----      ------ first mutable borrow occurs here
-   |                    |
+   |                    -----------------
+   |                    |         |
+   |                    |         first mutable borrow occurs here
    |                    first borrow later used here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time
diff --git a/src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr
index f2baee09376..ef811b84905 100644
--- a/src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr
+++ b/src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr
@@ -7,7 +7,7 @@ LL |     let mut t2 = &mut t0;
    |                  ^^^^^^^ mutable borrow occurs here
 LL |     **t2 += 1;              // Mutates `*t0`
 LL |     p.use_ref();
-   |     - immutable borrow later used here
+   |     ----------- immutable borrow later used here
 
 error[E0499]: cannot borrow `t0` as mutable more than once at a time
   --> $DIR/borrowck-mut-borrow-of-mut-base-ptr.rs:19:18
@@ -18,7 +18,7 @@ LL |     let mut t2 = &mut t0;
    |                  ^^^^^^^ second mutable borrow occurs here
 LL |     **t2 += 1;                  // Mutates `*t0` but not through `*p`
 LL |     p.use_mut();
-   |     - first borrow later used here
+   |     ----------- first borrow later used here
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/borrowck/borrowck-object-lifetime.nll.stderr b/src/test/ui/borrowck/borrowck-object-lifetime.nll.stderr
deleted file mode 100644
index 49c3f861ea9..00000000000
--- a/src/test/ui/borrowck/borrowck-object-lifetime.nll.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable
-  --> $DIR/borrowck-object-lifetime.rs:20:13
-   |
-LL |     let y = x.borrowed();
-   |             - immutable borrow occurs here
-LL |     let z = x.mut_borrowed();
-   |             ^ mutable borrow occurs here
-LL |     y.use_ref();
-   |     - immutable borrow later used here
-
-error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
-  --> $DIR/borrowck-object-lifetime.rs:26:13
-   |
-LL |     let y = x.borrowed();
-   |             - immutable borrow occurs here
-LL |     let z = &mut x;
-   |             ^^^^^^ mutable borrow occurs here
-LL |     y.use_ref();
-   |     - immutable borrow later used here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/borrowck/borrowck-object-lifetime.stderr b/src/test/ui/borrowck/borrowck-object-lifetime.stderr
index cf94c74dec2..215ed760ae1 100644
--- a/src/test/ui/borrowck/borrowck-object-lifetime.stderr
+++ b/src/test/ui/borrowck/borrowck-object-lifetime.stderr
@@ -2,21 +2,21 @@ error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immut
   --> $DIR/borrowck-object-lifetime.rs:20:13
    |
 LL |     let y = x.borrowed();
-   |             - immutable borrow occurs here
+   |             ------------ immutable borrow occurs here
 LL |     let z = x.mut_borrowed();
    |             ^^^^^^^^^^^^^^^^ mutable borrow occurs here
 LL |     y.use_ref();
-   |     - immutable borrow later used here
+   |     ----------- immutable borrow later used here
 
 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
   --> $DIR/borrowck-object-lifetime.rs:26:13
    |
 LL |     let y = x.borrowed();
-   |             - immutable borrow occurs here
+   |             ------------ immutable borrow occurs here
 LL |     let z = &mut x;
    |             ^^^^^^ mutable borrow occurs here
 LL |     y.use_ref();
-   |     - immutable borrow later used here
+   |     ----------- immutable borrow later used here
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/borrowck/borrowck-overloaded-index-autoderef.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-autoderef.stderr
index 978e1291722..087f2ac799e 100644
--- a/src/test/ui/borrowck/borrowck-overloaded-index-autoderef.stderr
+++ b/src/test/ui/borrowck/borrowck-overloaded-index-autoderef.stderr
@@ -6,7 +6,7 @@ LL |     let p = &mut f[&s];
 LL |     let q = &f[&s];
    |              ^ immutable borrow occurs here
 LL |     p.use_mut();
-   |     - mutable borrow later used here
+   |     ----------- mutable borrow later used here
 
 error[E0499]: cannot borrow `*f` as mutable more than once at a time
   --> $DIR/borrowck-overloaded-index-autoderef.rs:43:18
@@ -16,7 +16,7 @@ LL |     let p = &mut f[&s];
 LL |     let q = &mut f[&s];
    |                  ^ second mutable borrow occurs here
 LL |     p.use_mut();
-   |     - first borrow later used here
+   |     ----------- first borrow later used here
 
 error[E0499]: cannot borrow `f.foo` as mutable more than once at a time
   --> $DIR/borrowck-overloaded-index-autoderef.rs:53:18
@@ -26,7 +26,7 @@ LL |     let p = &mut f.foo[&s];
 LL |     let q = &mut f.foo[&s];
    |                  ^^^^^ second mutable borrow occurs here
 LL |     p.use_mut();
-   |     - first borrow later used here
+   |     ----------- first borrow later used here
 
 error[E0502]: cannot borrow `f.foo` as mutable because it is also borrowed as immutable
   --> $DIR/borrowck-overloaded-index-autoderef.rs:65:18
@@ -36,7 +36,7 @@ LL |     let p = &f.foo[&s];
 LL |     let q = &mut f.foo[&s];
    |                  ^^^^^ mutable borrow occurs here
 LL |     p.use_ref();
-   |     - immutable borrow later used here
+   |     ----------- immutable borrow later used here
 
 error[E0506]: cannot assign to `f.foo` because it is borrowed
   --> $DIR/borrowck-overloaded-index-autoderef.rs:71:5
@@ -46,7 +46,7 @@ LL |     let p = &f.foo[&s];
 LL |     f.foo = g;
    |     ^^^^^^^^^ assignment to borrowed `f.foo` occurs here
 LL |     p.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error[E0506]: cannot assign to `*f` because it is borrowed
   --> $DIR/borrowck-overloaded-index-autoderef.rs:77:5
@@ -56,7 +56,7 @@ LL |     let p = &f.foo[&s];
 LL |     *f = g;
    |     ^^^^^^ assignment to borrowed `*f` occurs here
 LL |     p.use_ref();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error[E0506]: cannot assign to `f.foo` because it is borrowed
   --> $DIR/borrowck-overloaded-index-autoderef.rs:83:5
@@ -66,7 +66,7 @@ LL |     let p = &mut f.foo[&s];
 LL |     f.foo = g;
    |     ^^^^^^^^^ assignment to borrowed `f.foo` occurs here
 LL |     p.use_mut();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error[E0506]: cannot assign to `*f` because it is borrowed
   --> $DIR/borrowck-overloaded-index-autoderef.rs:89:5
@@ -76,7 +76,7 @@ LL |     let p = &mut f.foo[&s];
 LL |     *f = g;
    |     ^^^^^^ assignment to borrowed `*f` occurs here
 LL |     p.use_mut();
-   |     - borrow later used here
+   |     ----------- borrow later used here
 
 error: aborting due to 8 previous errors
 
diff --git a/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr
index db73d4c04ac..d05996413dd 100644
--- a/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr
+++ b/src/test/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr
@@ -8,7 +8,7 @@ LL |     let z = &x;
    |             ^^ immutable borrow occurs here
 ...
 LL |     y.use_mut();
-   |     - mutable borrow later used here
+   |     ----------- mutable borrow later used here
 
 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
   --> $DIR/borrowck-report-with-custom-diagnostic.rs:21:21
@@ -20,7 +20,7 @@ LL |             let z = &mut x;
    |                     ^^^^^^ mutable borrow occurs here
 ...
 LL |             y.use_ref();
-   |             - immutable borrow later used here
+   |             ----------- immutable borrow later used here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time
   --> $DIR/borrowck-report-with-custom-diagnostic.rs:36:17
@@ -32,7 +32,7 @@ LL |         let z = &mut x;
    |                 ^^^^^^ second mutable borrow occurs here
 ...
 LL |         y.use_mut();
-   |         - first borrow later used here
+   |         ----------- first borrow later used here
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/borrowck/borrowck-swap-mut-base-ptr.stderr b/src/test/ui/borrowck/borrowck-swap-mut-base-ptr.stderr
index 1c55953c91f..b39215b9aab 100644
--- a/src/test/ui/borrowck/borrowck-swap-mut-base-ptr.stderr
+++ b/src/test/ui/borrowck/borrowck-swap-mut-base-ptr.stderr
@@ -7,7 +7,7 @@ LL |     swap(&mut t0, &mut t1);
    |          ^^^^^^^ mutable borrow occurs here
 LL |     *t1 = 22;
 LL |     p.use_ref();
-   |     - immutable borrow later used here
+   |     ----------- immutable borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-union-borrow-nested.stderr b/src/test/ui/borrowck/borrowck-union-borrow-nested.stderr
index 61569b9cac1..4bd7d54cffe 100644
--- a/src/test/ui/borrowck/borrowck-union-borrow-nested.stderr
+++ b/src/test/ui/borrowck/borrowck-union-borrow-nested.stderr
@@ -6,7 +6,7 @@ LL |             let ra = &mut u.s.a;
 LL |             let b = u.c;
    |                     ^^^ use of borrowed `u.s.a`
 LL |             ra.use_mut();
-   |             -- borrow later used here
+   |             ------------ borrow later used here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/borrowck-uniq-via-lend.stderr b/src/test/ui/borrowck/borrowck-uniq-via-lend.stderr
index 923edc8edae..6dbe4c74b58 100644
--- a/src/test/ui/borrowck/borrowck-uniq-via-lend.stderr
+++ b/src/test/ui/borrowck/borrowck-uniq-via-lend.stderr
@@ -6,7 +6,7 @@ LL |     let w = &mut v;
 LL |     borrow(&*v);
    |            ^^^ immutable borrow occurs here
 LL |     w.use_mut();
-   |     - mutable borrow later used here
+   |     ----------- mutable borrow later used here
 
 error[E0502]: cannot borrow `*v` as immutable because it is also borrowed as mutable
   --> $DIR/borrowck-uniq-via-lend.rs:53:12
@@ -16,7 +16,7 @@ LL |     x = &mut v;
 LL |     borrow(&*v);
    |            ^^^ immutable borrow occurs here
 LL |     x.use_mut();
-   |     - mutable borrow later used here
+   |     ----------- mutable borrow later used here
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.stderr
index 5141fcc1bb2..eb0f24b9b7a 100644
--- a/src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.stderr
+++ b/src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.stderr
@@ -5,8 +5,9 @@ LL |     let vb: &mut [isize] = &mut v;
    |                            ------ first mutable borrow occurs here
 ...
 LL |             v.push(tail[0] + tail[1]);
-   |             ^      ------- first borrow later used here
-   |             |
+   |             ^^^^^^^-------^^^^^^^^^^^
+   |             |      |
+   |             |      first borrow later used here
    |             second mutable borrow occurs here
 
 error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
index 41c9b3be281..ddd89afe5bf 100644
--- a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
+++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
@@ -8,7 +8,7 @@ LL |             vec[0] = Box::new(4);
    |             ^^^^^^ assignment to borrowed `vec[_]` occurs here
 LL |
 LL |             _a.use_ref();
-   |             -- borrow later used here
+   |             ------------ borrow later used here
 
 error[E0506]: cannot assign to `vec[_]` because it is borrowed
   --> $DIR/borrowck-vec-pattern-nesting.rs:23:13
@@ -20,7 +20,7 @@ LL |             vec[0] = Box::new(4);
    |             ^^^^^^ assignment to borrowed `vec[_]` occurs here
 LL |
 LL |             _b.use_ref();
-   |             -- borrow later used here
+   |             ------------ borrow later used here
 
 error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
   --> $DIR/borrowck-vec-pattern-nesting.rs:34:11
diff --git a/src/test/ui/borrowck/index-mut-help-with-impl.stderr b/src/test/ui/borrowck/index-mut-help-with-impl.stderr
index 89391f4099a..69dca7e7b56 100644
--- a/src/test/ui/borrowck/index-mut-help-with-impl.stderr
+++ b/src/test/ui/borrowck/index-mut-help-with-impl.stderr
@@ -2,7 +2,7 @@ error[E0596]: cannot borrow data in a `&` reference as mutable
   --> $DIR/index-mut-help-with-impl.rs:9:5
    |
 LL |     Index::index(&v, 1..2).make_ascii_uppercase();
-   |     ^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/index-mut-help.stderr b/src/test/ui/borrowck/index-mut-help.stderr
index 52b9ad496e5..057c6ee15f3 100644
--- a/src/test/ui/borrowck/index-mut-help.stderr
+++ b/src/test/ui/borrowck/index-mut-help.stderr
@@ -2,7 +2,7 @@ error[E0596]: cannot borrow data in an index of `HashMap<&str, String>` as mutab
   --> $DIR/index-mut-help.rs:11:5
    |
 LL |     map["peter"].clear();
-   |     ^^^^^^^^^^^^ cannot borrow as mutable
+   |     ^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
    |
    = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>`
 
diff --git a/src/test/ui/borrowck/issue-42344.stderr b/src/test/ui/borrowck/issue-42344.stderr
index 5cffa1b5121..29b4c8c38d7 100644
--- a/src/test/ui/borrowck/issue-42344.stderr
+++ b/src/test/ui/borrowck/issue-42344.stderr
@@ -2,7 +2,7 @@ error[E0596]: cannot borrow `*TAB[_]` as mutable, as `TAB` is an immutable stati
   --> $DIR/issue-42344.rs:4:5
    |
 LL |     TAB[0].iter_mut();
-   |     ^^^^^^ cannot borrow as mutable
+   |     ^^^^^^^^^^^^^^^^^ cannot borrow as mutable
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/issue-51117.stderr b/src/test/ui/borrowck/issue-51117.stderr
index f8a9608ad37..ef1a16ea953 100644
--- a/src/test/ui/borrowck/issue-51117.stderr
+++ b/src/test/ui/borrowck/issue-51117.stderr
@@ -4,7 +4,7 @@ error[E0499]: cannot borrow `*bar` as mutable more than once at a time
 LL |         Some(baz) => {
    |              --- first mutable borrow occurs here
 LL |             bar.take();
-   |             ^^^ second mutable borrow occurs here
+   |             ^^^^^^^^^^ second mutable borrow occurs here
 LL |             drop(baz);
    |                  --- first borrow later used here
 
diff --git a/src/test/ui/borrowck/issue-81365-10.stderr b/src/test/ui/borrowck/issue-81365-10.stderr
index 891f70ed7f6..27123ef2be1 100644
--- a/src/test/ui/borrowck/issue-81365-10.stderr
+++ b/src/test/ui/borrowck/issue-81365-10.stderr
@@ -2,7 +2,7 @@ error[E0506]: cannot assign to `self.container_field` because it is borrowed
   --> $DIR/issue-81365-10.rs:21:9
    |
 LL |         let first = &self.deref().target_field;
-   |                      ---- borrow of `self.container_field` occurs here
+   |                      ------------ borrow of `self.container_field` occurs here
 LL |         self.container_field = true;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `self.container_field` occurs here
 LL |         first;
diff --git a/src/test/ui/borrowck/issue-81365-5.stderr b/src/test/ui/borrowck/issue-81365-5.stderr
index 7c0e9f43bd0..8201894c6db 100644
--- a/src/test/ui/borrowck/issue-81365-5.stderr
+++ b/src/test/ui/borrowck/issue-81365-5.stderr
@@ -2,7 +2,7 @@ error[E0506]: cannot assign to `self.container_field` because it is borrowed
   --> $DIR/issue-81365-5.rs:28:9
    |
 LL |         let first = self.get();
-   |                     ---- borrow of `self.container_field` occurs here
+   |                     ---------- borrow of `self.container_field` occurs here
 LL |         self.container_field = true;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `self.container_field` occurs here
 LL |         first;
diff --git a/src/test/ui/borrowck/issue-82032.stderr b/src/test/ui/borrowck/issue-82032.stderr
index f272477a9f5..25f343117a3 100644
--- a/src/test/ui/borrowck/issue-82032.stderr
+++ b/src/test/ui/borrowck/issue-82032.stderr
@@ -7,7 +7,7 @@ LL |         for v in self.0.values() {
    |                  |      help: use mutable method: `values_mut()`
    |                  this iterator yields `&` references
 LL |             v.flush();
-   |             ^ `v` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+   |             ^^^^^^^^^ `v` is a `&` reference, so the data it refers to cannot be borrowed as mutable
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/issue-82462.nll.stderr b/src/test/ui/borrowck/issue-82462.nll.stderr
deleted file mode 100644
index 10497c30e64..00000000000
--- a/src/test/ui/borrowck/issue-82462.nll.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
-  --> $DIR/issue-82462.rs:18:9
-   |
-LL |     for x in DroppingSlice(&*v).iter() {
-   |              ------------------
-   |              |               |
-   |              |               immutable borrow occurs here
-   |              a temporary with access to the immutable borrow is created here ...
-LL |         v.push(*x);
-   |         ^ mutable borrow occurs here
-LL |         break;
-LL |     }
-   |     - ... and the immutable borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DroppingSlice`
-   |
-help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
-   |
-LL |     };
-   |      +
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0502`.
diff --git a/src/test/ui/borrowck/issue-85581.stderr b/src/test/ui/borrowck/issue-85581.stderr
index 29c0429f2a0..59ca4867fd7 100644
--- a/src/test/ui/borrowck/issue-85581.stderr
+++ b/src/test/ui/borrowck/issue-85581.stderr
@@ -7,7 +7,7 @@ LL |     match heap.peek_mut() {
    |           first mutable borrow occurs here
    |           a temporary with access to the first borrow is created here ...
 LL |         Some(_) => { heap.pop(); },
-   |                      ^^^^ second mutable borrow occurs here
+   |                      ^^^^^^^^^^ second mutable borrow occurs here
 ...
 LL | }
    | - ... and the first borrow might be used here, when that temporary is dropped and runs the destructor for type `Option<PeekMut<'_, i32>>`
diff --git a/src/test/ui/borrowck/issue-85765.stderr b/src/test/ui/borrowck/issue-85765.stderr
index af83c6ea6d9..80acaa7d21c 100644
--- a/src/test/ui/borrowck/issue-85765.stderr
+++ b/src/test/ui/borrowck/issue-85765.stderr
@@ -5,7 +5,7 @@ LL |     let rofl: &Vec<Vec<i32>> = &mut test;
    |         ---- help: consider changing this to be a mutable reference: `&mut Vec<Vec<i32>>`
 LL |
 LL |     rofl.push(Vec::new());
-   |     ^^^^ `rofl` is a `&` reference, so the data it refers to cannot be borrowed as mutable
+   |     ^^^^^^^^^^^^^^^^^^^^^ `rofl` is a `&` reference, so the data it refers to cannot be borrowed as mutable
 
 error[E0594]: cannot assign to `*r`, which is behind a `&` reference
   --> $DIR/issue-85765.rs:12:5
diff --git a/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr b/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr
index e4c51bb77c9..2ffe7ff6413 100644
--- a/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr
+++ b/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr
@@ -53,7 +53,7 @@ error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
   --> $DIR/mut-borrow-of-mut-ref.rs:35:5
    |
 LL |     f.bar();
-   |     ^ cannot borrow as mutable
+   |     ^^^^^^^ cannot borrow as mutable
    |
 help: consider making the binding mutable
    |
diff --git a/src/test/ui/borrowck/mut-borrow-outside-loop.stderr b/src/test/ui/borrowck/mut-borrow-outside-loop.stderr
index 4fcb693f1bf..e6895b27f35 100644
--- a/src/test/ui/borrowck/mut-borrow-outside-loop.stderr
+++ b/src/test/ui/borrowck/mut-borrow-outside-loop.stderr
@@ -6,7 +6,7 @@ LL |     let first = &mut void;
 LL |     let second = &mut void;
    |                  ^^^^^^^^^ second mutable borrow occurs here
 LL |     first.use_mut();
-   |     ----- first borrow later used here
+   |     --------------- first borrow later used here
 
 error[E0499]: cannot borrow `inner_void` as mutable more than once at a time
   --> $DIR/mut-borrow-outside-loop.rs:15:28
@@ -17,7 +17,7 @@ LL |         let inner_second = &mut inner_void;
    |                            ^^^^^^^^^^^^^^^ second mutable borrow occurs here
 LL |         inner_second.use_mut();
 LL |         inner_first.use_mut();
-   |         ----------- first borrow later used here
+   |         --------------------- first borrow later used here
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/borrowck/two-phase-across-loop.stderr b/src/test/ui/borrowck/two-phase-across-loop.stderr
index d4e515d12bb..95896c6bbf9 100644
--- a/src/test/ui/borrowck/two-phase-across-loop.stderr
+++ b/src/test/ui/borrowck/two-phase-across-loop.stderr
@@ -2,7 +2,7 @@ error[E0499]: cannot borrow `foo` as mutable more than once at a time
   --> $DIR/two-phase-across-loop.rs:17:22
    |
 LL |         strings.push(foo.get_string());
-   |                      ^^^ `foo` was mutably borrowed here in the previous iteration of the loop
+   |                      ^^^^^^^^^^^^^^^^ `foo` was mutably borrowed here in the previous iteration of the loop
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr
index 9bfd8b994bf..a89bb941532 100644
--- a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr
+++ b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr
@@ -1,13 +1,18 @@
 error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable
   --> $DIR/two-phase-cannot-nest-mut-self-calls.rs:16:9
    |
-LL |     vec.get({
-   |     --- --- immutable borrow later used by call
-   |     |
-   |     immutable borrow occurs here
-LL | 
-LL |         vec.push(2);
-   |         ^^^ mutable borrow occurs here
+LL |       vec.get({
+   |       -   --- immutable borrow later used by call
+   |  _____|
+   | |
+LL | |
+LL | |         vec.push(2);
+   | |         ^^^^^^^^^^^ mutable borrow occurs here
+LL | |
+LL | |
+LL | |         0
+LL | |     });
+   | |______- immutable borrow occurs here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/two-phase-multi-mut.stderr b/src/test/ui/borrowck/two-phase-multi-mut.stderr
index 33fa4a3a150..2e53e17a31b 100644
--- a/src/test/ui/borrowck/two-phase-multi-mut.stderr
+++ b/src/test/ui/borrowck/two-phase-multi-mut.stderr
@@ -12,8 +12,9 @@ error[E0499]: cannot borrow `foo` as mutable more than once at a time
   --> $DIR/two-phase-multi-mut.rs:11:16
    |
 LL |     foo.method(&mut foo);
-   |     --- ------ ^^^^^^^^ second mutable borrow occurs here
-   |     |   |
+   |     -----------^^^^^^^^-
+   |     |   |      |
+   |     |   |      second mutable borrow occurs here
    |     |   first borrow later used by call
    |     first mutable borrow occurs here
 
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
index e4fceb197be..6cff53399ca 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2015.stderr
@@ -27,8 +27,9 @@ LL |     let shared = &v;
    |                  -- immutable borrow occurs here
 LL | 
 LL |     v.push(shared.len());
-   |     ^      ------ immutable borrow later used here
-   |     |
+   |     ^^^^^^^------------^
+   |     |      |
+   |     |      immutable borrow later used here
    |     mutable borrow occurs here
    |
    = note: `#[warn(mutable_borrow_reservation_conflict)]` on by default
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
index e4fceb197be..6cff53399ca 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.migrate2018.stderr
@@ -27,8 +27,9 @@ LL |     let shared = &v;
    |                  -- immutable borrow occurs here
 LL | 
 LL |     v.push(shared.len());
-   |     ^      ------ immutable borrow later used here
-   |     |
+   |     ^^^^^^^------------^
+   |     |      |
+   |     |      immutable borrow later used here
    |     mutable borrow occurs here
    |
    = note: `#[warn(mutable_borrow_reservation_conflict)]` on by default
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr
index 52017394e89..0ae6fe78c6a 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2015.stderr
@@ -5,8 +5,9 @@ LL |     let shared = &v;
    |                  -- immutable borrow occurs here
 LL | 
 LL |     v.extend(shared);
-   |     ^        ------ immutable borrow later used here
-   |     |
+   |     ^^^^^^^^^------^
+   |     |        |
+   |     |        immutable borrow later used here
    |     mutable borrow occurs here
 
 error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
@@ -26,8 +27,9 @@ LL |     let shared = &v;
    |                  -- immutable borrow occurs here
 LL | 
 LL |     v.push(shared.len());
-   |     ^      ------ immutable borrow later used here
-   |     |
+   |     ^^^^^^^------------^
+   |     |      |
+   |     |      immutable borrow later used here
    |     mutable borrow occurs here
 
 error: aborting due to 3 previous errors
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr
index 52017394e89..0ae6fe78c6a 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.nll2018.stderr
@@ -5,8 +5,9 @@ LL |     let shared = &v;
    |                  -- immutable borrow occurs here
 LL | 
 LL |     v.extend(shared);
-   |     ^        ------ immutable borrow later used here
-   |     |
+   |     ^^^^^^^^^------^
+   |     |        |
+   |     |        immutable borrow later used here
    |     mutable borrow occurs here
 
 error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
@@ -26,8 +27,9 @@ LL |     let shared = &v;
    |                  -- immutable borrow occurs here
 LL | 
 LL |     v.push(shared.len());
-   |     ^      ------ immutable borrow later used here
-   |     |
+   |     ^^^^^^^------------^
+   |     |      |
+   |     |      immutable borrow later used here
    |     mutable borrow occurs here
 
 error: aborting due to 3 previous errors
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.nll.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.nll.stderr
index d2ea5ab2077..52e8de3c4ac 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.nll.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.nll.stderr
@@ -5,8 +5,9 @@ LL |         let shared = &v;
    |                      -- immutable borrow occurs here
 LL | 
 LL |         v.push(shared.len());
-   |         ^      ------ immutable borrow later used here
-   |         |
+   |         ^^^^^^^------------^
+   |         |      |
+   |         |      immutable borrow later used here
    |         mutable borrow occurs here
 
 error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
@@ -16,8 +17,9 @@ LL |         let shared = &v;
    |                      -- immutable borrow occurs here
 LL | 
 LL |         v.push(shared.len());
-   |         ^      ------ immutable borrow later used here
-   |         |
+   |         ^^^^^^^------------^
+   |         |      |
+   |         |      immutable borrow later used here
    |         mutable borrow occurs here
 
 error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
@@ -27,8 +29,9 @@ LL |         let shared = &v;
    |                      -- immutable borrow occurs here
 LL | 
 LL |         v.push(shared.len());
-   |         ^      ------ immutable borrow later used here
-   |         |
+   |         ^^^^^^^------------^
+   |         |      |
+   |         |      immutable borrow later used here
    |         mutable borrow occurs here
 
 error: aborting due to 3 previous errors
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr
index 03f49d2d92f..aab21c9e78b 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-future-compat-lint.stderr
@@ -5,8 +5,9 @@ LL |         let shared = &v;
    |                      -- immutable borrow occurs here
 LL | 
 LL |         v.push(shared.len());
-   |         ^      ------ immutable borrow later used here
-   |         |
+   |         ^^^^^^^------------^
+   |         |      |
+   |         |      immutable borrow later used here
    |         mutable borrow occurs here
    |
 note: the lint level is defined here
@@ -24,8 +25,9 @@ LL |         let shared = &v;
    |                      -- immutable borrow occurs here
 LL | 
 LL |         v.push(shared.len());
-   |         ^      ------ immutable borrow later used here
-   |         |
+   |         ^^^^^^^------------^
+   |         |      |
+   |         |      immutable borrow later used here
    |         mutable borrow occurs here
    |
 note: the lint level is defined here
diff --git a/src/test/ui/borrowck/two-phase-sneaky.stderr b/src/test/ui/borrowck/two-phase-sneaky.stderr
index c66f3cbed91..cffbf0706fe 100644
--- a/src/test/ui/borrowck/two-phase-sneaky.stderr
+++ b/src/test/ui/borrowck/two-phase-sneaky.stderr
@@ -7,7 +7,7 @@ LL |     v[0].push_str({
    |     first mutable borrow occurs here
 LL | 
 LL |         v.push(format!("foo"));
-   |         ^ second mutable borrow occurs here
+   |         ^^^^^^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr b/src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr
index 7d0e1566750..5a240d90011 100644
--- a/src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr
+++ b/src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr
@@ -13,7 +13,7 @@ error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as im
   --> $DIR/two-phase-surprise-no-conflict.rs:57:17
    |
 LL |                 self.hash_expr(&self.cx_mut.body(eid).value);
-   |                 ^^^^^---------^^-----------^^^^^^^^^^^^^^^^^
+   |                 ^^^^^---------^^---------------------^^^^^^^
    |                 |    |          |
    |                 |    |          immutable borrow occurs here
    |                 |    immutable borrow later used by call
@@ -23,8 +23,9 @@ error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
   --> $DIR/two-phase-surprise-no-conflict.rs:119:51
    |
 LL |     reg.register_static(Box::new(TrivialPass::new(&mut reg.sess_mut)));
-   |     --- ---------------                           ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
-   |     |   |
+   |     ----------------------------------------------^^^^^^^^^^^^^^^^^---
+   |     |   |                                         |
+   |     |   |                                         second mutable borrow occurs here
    |     |   first borrow later used by call
    |     first mutable borrow occurs here
 
@@ -32,8 +33,9 @@ error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
   --> $DIR/two-phase-surprise-no-conflict.rs:122:54
    |
 LL |     reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
-   |     --- --------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
-   |     |   |
+   |     -------------------------------------------------^^^^^^^^^^^^^^^^^---
+   |     |   |                                            |
+   |     |   |                                            second mutable borrow occurs here
    |     |   first borrow later used by call
    |     first mutable borrow occurs here
 
@@ -41,8 +43,9 @@ error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
   --> $DIR/two-phase-surprise-no-conflict.rs:125:53
    |
 LL |     reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
-   |     --- -------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
-   |     |   |
+   |     ------------------------------------------------^^^^^^^^^^^^^^^^^---
+   |     |   |                                           |
+   |     |   |                                           second mutable borrow occurs here
    |     |   first borrow later used by call
    |     first mutable borrow occurs here
 
@@ -50,8 +53,9 @@ error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
   --> $DIR/two-phase-surprise-no-conflict.rs:128:44
    |
 LL |     reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
-   |     --- ------------                       ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
-   |     |   |
+   |     ---------------------------------------^^^^^^^^^^^^^^^^^--
+   |     |   |                                  |
+   |     |   |                                  second mutable borrow occurs here
    |     |   first borrow later used by call
    |     first mutable borrow occurs here
 
@@ -102,8 +106,9 @@ error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
   --> $DIR/two-phase-surprise-no-conflict.rs:154:54
    |
 LL |     reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
-   |     --- --------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
-   |     |   |
+   |     -------------------------------------------------^^^^^^^^^^^^^^^^^---
+   |     |   |                                            |
+   |     |   |                                            second mutable borrow occurs here
    |     |   first borrow later used by call
    |     first mutable borrow occurs here
 
@@ -124,8 +129,9 @@ error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
   --> $DIR/two-phase-surprise-no-conflict.rs:158:53
    |
 LL |     reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
-   |     --- -------------                               ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
-   |     |   |
+   |     ------------------------------------------------^^^^^^^^^^^^^^^^^---
+   |     |   |                                           |
+   |     |   |                                           second mutable borrow occurs here
    |     |   first borrow later used by call
    |     first mutable borrow occurs here
 
@@ -143,8 +149,9 @@ error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
   --> $DIR/two-phase-surprise-no-conflict.rs:162:44
    |
 LL |     reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
-   |     --- ------------                       ^^^^^^^^^^^^^^^^^ second mutable borrow occurs here
-   |     |   |
+   |     ---------------------------------------^^^^^^^^^^^^^^^^^--
+   |     |   |                                  |
+   |     |   |                                  second mutable borrow occurs here
    |     |   first borrow later used by call
    |     first mutable borrow occurs here