about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-19 11:13:10 +0000
committerbors <bors@rust-lang.org>2018-04-19 11:13:10 +0000
commit8a28d94ea1b6c19b7e1d41ef9b33ccb73951f654 (patch)
treeca79b860528005be4f468f665f1270c1474241b0 /src
parent5fe6b58dfc5ef9bb5dbfba9cf74aa9293a33e7b2 (diff)
parent33bcb4ed16b01abeaa762c99e452da82c9c6275f (diff)
downloadrust-8a28d94ea1b6c19b7e1d41ef9b33ccb73951f654.tar.gz
rust-8a28d94ea1b6c19b7e1d41ef9b33ccb73951f654.zip
Auto merge of #49900 - pnkfelix:compare-mode-nll-followup-3, r=nikomatsakis
Add src/test/ui regression testing for NLL

This PR changes `x.py test` so that when you are running the `ui` test suite, it will also always run `compiletest` in the new `--compare-mode=nll`, which just double-checks that when running under the experimental NLL mode, the output matches the `<source-name>.nll.stderr` file, if present.

In order to reduce the chance of a developer revolt in response to this change, this PR also includes some changes to make the `--compare-mode=nll` more user-friendly:

 1. It now generates nll-specific .stamp files, and uses them (so that repeated runs can reuse previously cached results).
 2. Each line of terminal output distinguishes whether we are running under `--compare-mode=nll` by printing with the prefix `[ui (nll)]` instead of just the prefix `[ui]`.

Subtask of rust-lang/rust#48879
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/test.rs45
-rw-r--r--src/librustc/session/config.rs2
-rw-r--r--src/librustc_mir/borrow_check/nll/region_infer/values.rs14
-rw-r--r--src/test/ui/borrowck/borrowck-closures-two-mut.nll.stderr78
-rw-r--r--src/test/ui/borrowck/issue-45983.nll.stderr4
-rw-r--r--src/test/ui/borrowck/issue-7573.nll.stderr2
-rw-r--r--src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr2
-rw-r--r--src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr2
-rw-r--r--src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr2
-rw-r--r--src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr8
-rw-r--r--src/test/ui/did_you_mean/issue-34126.nll.stderr11
-rw-r--r--src/test/ui/did_you_mean/issue-35937.nll.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-38147-1.nll.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-38147-4.nll.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-39544.nll.stderr22
-rw-r--r--src/test/ui/error-codes/E0389.nll.stderr8
-rw-r--r--src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr2
-rw-r--r--src/test/ui/hygiene/fields-move.nll.stderr46
-rw-r--r--src/test/ui/hygiene/fields-numeric-borrowck.nll.stderr13
-rw-r--r--src/test/ui/hygiene/fields-numeric-borrowck.rs4
-rw-r--r--src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr2
-rw-r--r--src/test/ui/in-band-lifetimes/mismatched.nll.stderr4
-rw-r--r--src/test/ui/in-band-lifetimes/mismatched_trait.nll.stderr2
-rw-r--r--src/test/ui/issue-13058.nll.stderr4
-rw-r--r--src/test/ui/issue-36400.nll.stderr2
-rw-r--r--src/test/ui/issue-45697-1.nll.stderr34
-rw-r--r--src/test/ui/issue-46471-1.nll.stderr28
-rw-r--r--src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr4
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr2
-rw-r--r--src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr2
-rw-r--r--src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr18
-rw-r--r--src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr18
-rw-r--r--src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr2
-rw-r--r--src/test/ui/span/borrowck-object-mutability.nll.stderr2
-rw-r--r--src/test/ui/span/destructor-restrictions.nll.stderr16
-rw-r--r--src/test/ui/span/dropck_vec_cycle_checked.nll.stderr6
-rw-r--r--src/test/ui/span/dropck_vec_cycle_checked.rs3
-rw-r--r--src/test/ui/span/dropck_vec_cycle_checked.stderr12
-rw-r--r--src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr30
-rw-r--r--src/test/ui/span/wf-method-late-bound-regions.nll.stderr20
-rw-r--r--src/test/ui/span/wf-method-late-bound-regions.rs4
-rw-r--r--src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr8
-rwxr-xr-xsrc/test/ui/update-references.sh6
-rw-r--r--src/tools/compiletest/src/common.rs2
-rw-r--r--src/tools/compiletest/src/main.rs17
-rw-r--r--src/tools/compiletest/src/runtest.rs10
79 files changed, 327 insertions, 268 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 3d954cd5d84..ca18604e6d1 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -538,6 +538,7 @@ impl Step for RustdocUi {
             target: self.target,
             mode: "ui",
             suite: "rustdoc-ui",
+            compare_mode: None,
         })
     }
 }
@@ -590,6 +591,14 @@ macro_rules! default_test {
     }
 }
 
+macro_rules! default_test_with_compare_mode {
+    ($name:ident { path: $path:expr, mode: $mode:expr, suite: $suite:expr,
+                   compare_mode: $compare_mode:expr }) => {
+        test_with_compare_mode!($name { path: $path, mode: $mode, suite: $suite, default: true,
+                                        host: false, compare_mode: $compare_mode });
+    }
+}
+
 macro_rules! host_test {
     ($name:ident { path: $path:expr, mode: $mode:expr, suite: $suite:expr }) => {
         test!($name { path: $path, mode: $mode, suite: $suite, default: true, host: true });
@@ -597,12 +606,29 @@ macro_rules! host_test {
 }
 
 macro_rules! test {
+    ($name:ident { path: $path:expr, mode: $mode:expr, suite: $suite:expr, default: $default:expr,
+                   host: $host:expr }) => {
+        test_definitions!($name { path: $path, mode: $mode, suite: $suite, default: $default,
+                                  host: $host, compare_mode: None });
+    }
+}
+
+macro_rules! test_with_compare_mode {
+    ($name:ident { path: $path:expr, mode: $mode:expr, suite: $suite:expr, default: $default:expr,
+                   host: $host:expr, compare_mode: $compare_mode:expr }) => {
+        test_definitions!($name { path: $path, mode: $mode, suite: $suite, default: $default,
+                                  host: $host, compare_mode: Some($compare_mode) });
+    }
+}
+
+macro_rules! test_definitions {
     ($name:ident {
         path: $path:expr,
         mode: $mode:expr,
         suite: $suite:expr,
         default: $default:expr,
-        host: $host:expr
+        host: $host:expr,
+        compare_mode: $compare_mode:expr
     }) => {
         #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
         pub struct $name {
@@ -634,16 +660,18 @@ macro_rules! test {
                     target: self.target,
                     mode: $mode,
                     suite: $suite,
+                    compare_mode: $compare_mode,
                 })
             }
         }
     }
 }
 
-default_test!(Ui {
+default_test_with_compare_mode!(Ui {
     path: "src/test/ui",
     mode: "ui",
-    suite: "ui"
+    suite: "ui",
+    compare_mode: "nll"
 });
 
 default_test!(RunPass {
@@ -804,6 +832,7 @@ struct Compiletest {
     target: Interned<String>,
     mode: &'static str,
     suite: &'static str,
+    compare_mode: Option<&'static str>,
 }
 
 impl Step for Compiletest {
@@ -823,6 +852,7 @@ impl Step for Compiletest {
         let target = self.target;
         let mode = self.mode;
         let suite = self.suite;
+        let compare_mode = self.compare_mode;
 
         // Skip codegen tests if they aren't enabled in configuration.
         if !builder.config.codegen_tests && suite == "codegen" {
@@ -1044,6 +1074,15 @@ impl Step for Compiletest {
                  suite, mode, &compiler.host, target));
         let _time = util::timeit(&builder);
         try_run(builder, &mut cmd);
+
+        if let Some(compare_mode) = compare_mode {
+            cmd.arg("--compare-mode").arg(compare_mode);
+            let _folder = builder.fold_output(|| format!("test_{}_{}", suite, compare_mode));
+            builder.info(&format!("Check compiletest suite={} mode={} compare_mode={} ({} -> {})",
+                                  suite, mode, compare_mode, &compiler.host, target));
+            let _time = util::timeit(&builder);
+            try_run(builder, &mut cmd);
+        }
     }
 }
 
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index 59823390a0a..2e6689efee5 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -1259,6 +1259,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
         useful for profiling / PGO."),
     relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
         "choose which RELRO level to use"),
+    nll_subminimal_causes: bool = (false, parse_bool, [UNTRACKED],
+        "when tracking region error causes, accept subminimal results for faster execution."),
     disable_nll_user_type_assert: bool = (false, parse_bool, [UNTRACKED],
         "disable user provided type assertion in NLL"),
     trans_time_graph: bool = (false, parse_bool, [UNTRACKED],
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/values.rs b/src/librustc_mir/borrow_check/nll/region_infer/values.rs
index 2f0b4c24bd6..d15d85792d9 100644
--- a/src/librustc_mir/borrow_check/nll/region_infer/values.rs
+++ b/src/librustc_mir/borrow_check/nll/region_infer/values.rs
@@ -14,7 +14,7 @@ use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::indexed_vec::Idx;
 use rustc_data_structures::indexed_vec::IndexVec;
 use rustc::mir::{BasicBlock, Location, Mir};
-use rustc::ty::RegionVid;
+use rustc::ty::{self, RegionVid};
 use syntax::codemap::Span;
 
 use super::{Cause, CauseExt, TrackCauses};
@@ -263,7 +263,17 @@ impl RegionValues {
             if let Some(causes) = &mut self.causes {
                 let cause = make_cause(causes);
                 let old_cause = causes.get_mut(&(r, i)).unwrap();
-                if cause < **old_cause {
+                // #49998: compare using root cause alone to avoid
+                // useless traffic from similar outlives chains.
+
+                let overwrite = if ty::tls::with(|tcx| {
+                    tcx.sess.opts.debugging_opts.nll_subminimal_causes
+                }) {
+                    cause.root_cause() < old_cause.root_cause()
+                } else {
+                    cause < **old_cause
+                };
+                if overwrite {
                     *old_cause = Rc::new(cause);
                     return true;
                 }
diff --git a/src/test/ui/borrowck/borrowck-closures-two-mut.nll.stderr b/src/test/ui/borrowck/borrowck-closures-two-mut.nll.stderr
deleted file mode 100644
index a21a6e36778..00000000000
--- a/src/test/ui/borrowck/borrowck-closures-two-mut.nll.stderr
+++ /dev/null
@@ -1,78 +0,0 @@
-error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:24:24
-   |
-LL |     let c1 = to_fn_mut(|| x = 4);
-   |                        -- - previous borrow occurs due to use of `x` in closure
-   |                        |
-   |                        first mutable borrow occurs here
-LL |     let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once
-   |                        ^^ - borrow occurs due to use of `x` in closure
-   |                        |
-   |                        second mutable borrow occurs here
-LL |     //~| ERROR cannot borrow `x` as mutable more than once
-LL | }
-   | - first borrow ends here
-
-error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:35:24
-   |
-LL |     let c1 = to_fn_mut(|| set(&mut x));
-   |                        --          - previous borrow occurs due to use of `x` in closure
-   |                        |
-   |                        first mutable borrow occurs here
-LL |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
-   |                        ^^          - borrow occurs due to use of `x` in closure
-   |                        |
-   |                        second mutable borrow occurs here
-LL |     //~| ERROR cannot borrow `x` as mutable more than once
-LL | }
-   | - first borrow ends here
-
-error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:42:24
-   |
-LL |     let c1 = to_fn_mut(|| x = 5);
-   |                        -- - previous borrow occurs due to use of `x` in closure
-   |                        |
-   |                        first mutable borrow occurs here
-LL |     let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once
-   |                        ^^          - borrow occurs due to use of `x` in closure
-   |                        |
-   |                        second mutable borrow occurs here
-LL |     //~| ERROR cannot borrow `x` as mutable more than once
-LL | }
-   | - first borrow ends here
-
-error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:49:24
-   |
-LL |     let c1 = to_fn_mut(|| x = 5);
-   |                        -- - previous borrow occurs due to use of `x` in closure
-   |                        |
-   |                        first mutable borrow occurs here
-LL |     let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure)
-   |                        ^^                                  - borrow occurs due to use of `x` in closure
-   |                        |
-   |                        second mutable borrow occurs here
-...
-LL | }
-   | - first borrow ends here
-
-error[E0499]: cannot borrow `x` as mutable more than once at a time (Ast)
-  --> $DIR/borrowck-closures-two-mut.rs:61:24
-   |
-LL |     let c1 = to_fn_mut(|| set(&mut *x.f));
-   |                        --           - previous borrow occurs due to use of `x` in closure
-   |                        |
-   |                        first mutable borrow occurs here
-LL |     let c2 = to_fn_mut(|| set(&mut *x.f));
-   |                        ^^           - borrow occurs due to use of `x` in closure
-   |                        |
-   |                        second mutable borrow occurs here
-...
-LL | }
-   | - first borrow ends here
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0499`.
diff --git a/src/test/ui/borrowck/issue-45983.nll.stderr b/src/test/ui/borrowck/issue-45983.nll.stderr
index ecd17edb079..1aec71fee34 100644
--- a/src/test/ui/borrowck/issue-45983.nll.stderr
+++ b/src/test/ui/borrowck/issue-45983.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/issue-45983.rs:17:27
    |
 LL |     give_any(|y| x = Some(y));
@@ -16,7 +16,7 @@ error[E0594]: cannot assign to immutable item `x`
 LL |     give_any(|y| x = Some(y));
    |                  ^^^^^^^^^^^ cannot mutate
    |
-   = note: Value not mutable causing this error: `x`
+   = note: the value which is causing this path not to be mutable is...: `x`
 
 error[E0596]: cannot borrow immutable item `x` as mutable
   --> $DIR/issue-45983.rs:17:14
diff --git a/src/test/ui/borrowck/issue-7573.nll.stderr b/src/test/ui/borrowck/issue-7573.nll.stderr
index c55c49604d0..84c6236eb0a 100644
--- a/src/test/ui/borrowck/issue-7573.nll.stderr
+++ b/src/test/ui/borrowck/issue-7573.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/issue-7573.rs:27:31
    |
 LL |     let mut lines_to_use: Vec<&CrateId> = Vec::new();
diff --git a/src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr b/src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr
index d34a716bb2b..ee3970aa8fd 100644
--- a/src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr
+++ b/src/test/ui/borrowck/regions-escape-bound-fn-2.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/regions-escape-bound-fn-2.rs:18:27
    |
 LL |     with_int(|y| x = Some(y));
diff --git a/src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr b/src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr
index b69c172bcdc..07a4ab1dbb1 100644
--- a/src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr
+++ b/src/test/ui/borrowck/regions-escape-bound-fn.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/regions-escape-bound-fn.rs:18:22
    |
 LL |     with_int(|y| x = Some(y));
diff --git a/src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr b/src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr
index 788654a2ecc..14c255ef527 100644
--- a/src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr
+++ b/src/test/ui/borrowck/regions-escape-unboxed-closure.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/regions-escape-unboxed-closure.rs:16:27
    |
 LL |     with_int(&mut |y| x = Some(y));
diff --git a/src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr b/src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr
index 18edf2addc5..bbae80e16ab 100644
--- a/src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr
+++ b/src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr
@@ -1,22 +1,22 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/expect-region-supply-region.rs:28:13
    |
 LL |         f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
    |             ^^^^^^^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/expect-region-supply-region.rs:38:13
    |
 LL |         f = Some(x); //~ ERROR borrowed data cannot be stored outside of its closure
    |             ^^^^^^^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/expect-region-supply-region.rs:47:33
    |
 LL |     closure_expecting_bound(|x: &'x u32| {
    |                                 ^^^^^^^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/expect-region-supply-region.rs:52:13
    |
 LL |         f = Some(x);
diff --git a/src/test/ui/did_you_mean/issue-34126.nll.stderr b/src/test/ui/did_you_mean/issue-34126.nll.stderr
index afdc26a75c7..81f858f6bfc 100644
--- a/src/test/ui/did_you_mean/issue-34126.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-34126.nll.stderr
@@ -1,3 +1,9 @@
+error[E0596]: cannot borrow immutable item `self` as mutable
+  --> $DIR/issue-34126.rs:16:18
+   |
+LL |         self.run(&mut self); //~ ERROR cannot borrow
+   |                  ^^^^^^^^^ cannot borrow as mutable
+
 error[E0502]: cannot borrow `self` as mutable because it is also borrowed as immutable
   --> $DIR/issue-34126.rs:16:18
    |
@@ -8,6 +14,7 @@ LL |         self.run(&mut self); //~ ERROR cannot borrow
    |         immutable borrow occurs here
    |         borrow later used here
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0502`.
+Some errors occurred: E0502, E0596.
+For more information about an error, try `rustc --explain E0502`.
diff --git a/src/test/ui/did_you_mean/issue-35937.nll.stderr b/src/test/ui/did_you_mean/issue-35937.nll.stderr
index 7b5f452d322..40b640b63cf 100644
--- a/src/test/ui/did_you_mean/issue-35937.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-35937.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `f.v` as mutable
 LL |     f.v.push("cat".to_string()); //~ ERROR cannot borrow
    |     ^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `f`
+   = note: the value which is causing this path not to be mutable is...: `f`
 
 error[E0384]: cannot assign twice to immutable variable `s.x`
   --> $DIR/issue-35937.rs:26:5
diff --git a/src/test/ui/did_you_mean/issue-38147-1.nll.stderr b/src/test/ui/did_you_mean/issue-38147-1.nll.stderr
index 099479eaf2b..8e442677951 100644
--- a/src/test/ui/did_you_mean/issue-38147-1.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-38147-1.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*self.s` as mutable
 LL |         self.s.push('x'); //~ ERROR cannot borrow data mutably
    |         ^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/did_you_mean/issue-38147-4.nll.stderr b/src/test/ui/did_you_mean/issue-38147-4.nll.stderr
index 5649fc903a0..6808222cc32 100644
--- a/src/test/ui/did_you_mean/issue-38147-4.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-38147-4.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*f.s` as mutable
 LL |     f.s.push('x'); //~ ERROR cannot borrow data mutably
    |     ^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*f`
+   = note: the value which is causing this path not to be mutable is...: `*f`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/did_you_mean/issue-39544.nll.stderr b/src/test/ui/did_you_mean/issue-39544.nll.stderr
index 6e57796aa45..f5f5b675e77 100644
--- a/src/test/ui/did_you_mean/issue-39544.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-39544.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `z.x` as mutable
 LL |     let _ = &mut z.x; //~ ERROR cannot borrow
    |             ^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `z`
+   = note: the value which is causing this path not to be mutable is...: `z`
 
 error[E0596]: cannot borrow immutable item `self.x` as mutable
   --> $DIR/issue-39544.rs:26:17
@@ -12,7 +12,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error[E0596]: cannot borrow immutable item `self.x` as mutable
   --> $DIR/issue-39544.rs:30:17
@@ -20,7 +20,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error[E0596]: cannot borrow immutable item `other.x` as mutable
   --> $DIR/issue-39544.rs:31:17
@@ -28,7 +28,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*other`
+   = note: the value which is causing this path not to be mutable is...: `*other`
 
 error[E0596]: cannot borrow immutable item `self.x` as mutable
   --> $DIR/issue-39544.rs:35:17
@@ -36,7 +36,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error[E0596]: cannot borrow immutable item `other.x` as mutable
   --> $DIR/issue-39544.rs:36:17
@@ -44,7 +44,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*other`
+   = note: the value which is causing this path not to be mutable is...: `*other`
 
 error[E0596]: cannot borrow immutable item `self.x` as mutable
   --> $DIR/issue-39544.rs:40:17
@@ -52,7 +52,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error[E0596]: cannot borrow immutable item `other.x` as mutable
   --> $DIR/issue-39544.rs:41:17
@@ -60,7 +60,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*other`
+   = note: the value which is causing this path not to be mutable is...: `*other`
 
 error[E0596]: cannot borrow immutable item `other.x` as mutable
   --> $DIR/issue-39544.rs:45:17
@@ -68,7 +68,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*other`
+   = note: the value which is causing this path not to be mutable is...: `*other`
 
 error[E0596]: cannot borrow immutable item `z.x` as mutable
   --> $DIR/issue-39544.rs:51:13
@@ -76,7 +76,7 @@ error[E0596]: cannot borrow immutable item `z.x` as mutable
 LL |     let _ = &mut z.x; //~ ERROR cannot borrow
    |             ^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `z`
+   = note: the value which is causing this path not to be mutable is...: `z`
 
 error[E0596]: cannot borrow immutable item `w.x` as mutable
   --> $DIR/issue-39544.rs:52:13
@@ -84,7 +84,7 @@ error[E0596]: cannot borrow immutable item `w.x` as mutable
 LL |     let _ = &mut w.x; //~ ERROR cannot borrow
    |             ^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*w`
+   = note: the value which is causing this path not to be mutable is...: `*w`
 
 error[E0594]: cannot assign to immutable item `*x.0`
   --> $DIR/issue-39544.rs:58:5
diff --git a/src/test/ui/error-codes/E0389.nll.stderr b/src/test/ui/error-codes/E0389.nll.stderr
index 13ba653a5ca..0525e16239d 100644
--- a/src/test/ui/error-codes/E0389.nll.stderr
+++ b/src/test/ui/error-codes/E0389.nll.stderr
@@ -1,10 +1,10 @@
-error[E0594]: cannot assign to immutable item `fancy_ref.num`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/E0389.rs:18:5
    |
+LL |     let fancy_ref = &(&mut fancy);
+   |                     ------------- help: consider changing this to be a mutable reference: `&mut (&mut fancy)`
 LL |     fancy_ref.num = 6; //~ ERROR E0389
-   |     ^^^^^^^^^^^^^^^^^ cannot mutate
-   |
-   = note: Value not mutable causing this error: `*fancy_ref`
+   |     ^^^^^^^^^^^^^^^^^ `fancy_ref` is a `&` reference, so the data it refers to cannot be written
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr
index e9f09795691..5ae6afa7b17 100644
--- a/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr
+++ b/src/test/ui/error-codes/E0621-does-not-trigger-for-closures.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/E0621-does-not-trigger-for-closures.rs:25:5
    |
 LL |     invoke(&x, |a, b| if a > b { a } else { b }); //~ ERROR E0495
diff --git a/src/test/ui/hygiene/fields-move.nll.stderr b/src/test/ui/hygiene/fields-move.nll.stderr
new file mode 100644
index 00000000000..51f8067b8ce
--- /dev/null
+++ b/src/test/ui/hygiene/fields-move.nll.stderr
@@ -0,0 +1,46 @@
+error[E0382]: use of moved value: `foo.x`
+  --> $DIR/fields-move.rs:38:42
+   |
+LL |    $foo.x
+   |    ------ value moved here
+...
+LL |     assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                                          ^^^^^ value used here after move
+   |
+   = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
+
+error[E0382]: use of moved value: `foo.x`
+  --> $DIR/fields-move.rs:28:9
+   |
+LL |    $foo.x
+   |    ------ value moved here
+...
+LL |         $foo.x //~ ERROR use of moved value: `foo.x`
+   |         ^^^^^^ value used here after move
+...
+LL |     assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                                          ----- value moved here
+LL |     assert_two_copies(copy_legacy!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                       ----------------- in this macro invocation
+   |
+   = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
+
+error[E0382]: use of moved value: `foo.x`
+  --> $DIR/fields-move.rs:39:42
+   |
+LL |    $foo.x
+   |    ------ value moved here
+...
+LL |         $foo.x //~ ERROR use of moved value: `foo.x`
+   |         ------ value moved here
+...
+LL |     assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                                          ----- value moved here
+LL |     assert_two_copies(copy_legacy!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                                          ^^^^^ value used here after move
+   |
+   = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/src/test/ui/hygiene/fields-numeric-borrowck.nll.stderr b/src/test/ui/hygiene/fields-numeric-borrowck.nll.stderr
new file mode 100644
index 00000000000..3a0a6f66d61
--- /dev/null
+++ b/src/test/ui/hygiene/fields-numeric-borrowck.nll.stderr
@@ -0,0 +1,13 @@
+error: compilation successful
+  --> $DIR/fields-numeric-borrowck.rs:13:1
+   |
+LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
+LL | |     let mut s = S(0);
+LL | |     let borrow1 = &mut s.0;
+LL | |     let S { 0: ref mut borrow2 } = s;
+LL | |     //~^ ERROR cannot borrow `s.0` as mutable more than once at a time
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/hygiene/fields-numeric-borrowck.rs b/src/test/ui/hygiene/fields-numeric-borrowck.rs
index 50ace39e709..975684fbd41 100644
--- a/src/test/ui/hygiene/fields-numeric-borrowck.rs
+++ b/src/test/ui/hygiene/fields-numeric-borrowck.rs
@@ -7,10 +7,10 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
-
+#![feature(rustc_attrs)]
 struct S(u8);
 
-fn main() {
+fn main() { #![rustc_error] // rust-lang/rust#49855
     let mut s = S(0);
     let borrow1 = &mut s.0;
     let S { 0: ref mut borrow2 } = s;
diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr b/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr
index 34ee39c7164..ec8c4ecf102 100644
--- a/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr
+++ b/src/test/ui/in-band-lifetimes/impl/dyn-trait.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/dyn-trait.rs:33:16
    |
 LL |     static_val(x); //~ ERROR cannot infer
diff --git a/src/test/ui/in-band-lifetimes/mismatched.nll.stderr b/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
index 0930583a7ee..cd2ebc341ea 100644
--- a/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
+++ b/src/test/ui/in-band-lifetimes/mismatched.nll.stderr
@@ -1,10 +1,10 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/mismatched.rs:14:42
    |
 LL | fn foo(x: &'a u32, y: &u32) -> &'a u32 { y } //~ ERROR explicit lifetime required
    |                                          ^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/mismatched.rs:16:46
    |
 LL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch
diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait.nll.stderr b/src/test/ui/in-band-lifetimes/mismatched_trait.nll.stderr
index 5e42cab9974..886e3834d1d 100644
--- a/src/test/ui/in-band-lifetimes/mismatched_trait.nll.stderr
+++ b/src/test/ui/in-band-lifetimes/mismatched_trait.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/mismatched_trait.rs:16:9
    |
 LL |         y //~ ERROR explicit lifetime required
diff --git a/src/test/ui/issue-13058.nll.stderr b/src/test/ui/issue-13058.nll.stderr
index 604ad38ad23..146385f3de2 100644
--- a/src/test/ui/issue-13058.nll.stderr
+++ b/src/test/ui/issue-13058.nll.stderr
@@ -1,10 +1,10 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/issue-13058.rs:24:21
    |
 LL |     let cont_iter = cont.iter();
    |                     ^^^^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/issue-13058.rs:24:26
    |
 LL |     let cont_iter = cont.iter();
diff --git a/src/test/ui/issue-36400.nll.stderr b/src/test/ui/issue-36400.nll.stderr
index 040e6300af6..80459937479 100644
--- a/src/test/ui/issue-36400.nll.stderr
+++ b/src/test/ui/issue-36400.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*x` as mutable
 LL |     f(&mut *x); //~ ERROR cannot borrow immutable
    |       ^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `x`
+   = note: the value which is causing this path not to be mutable is...: `x`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issue-45697-1.nll.stderr b/src/test/ui/issue-45697-1.nll.stderr
deleted file mode 100644
index cf108691a0e..00000000000
--- a/src/test/ui/issue-45697-1.nll.stderr
+++ /dev/null
@@ -1,34 +0,0 @@
-error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Ast)
-  --> $DIR/issue-45697-1.rs:30:9
-   |
-LL |         let z = copy_borrowed_ptr(&mut y);
-   |                                        - borrow of `*y.pointer` occurs here
-LL |         *y.pointer += 1;
-   |         ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
-
-error[E0503]: cannot use `*y.pointer` because it was mutably borrowed (Mir)
-  --> $DIR/issue-45697-1.rs:30:9
-   |
-LL |         let z = copy_borrowed_ptr(&mut y);
-   |                                   ------ borrow of `y` occurs here
-LL |         *y.pointer += 1;
-   |         ^^^^^^^^^^^^^^^ use of borrowed `y`
-...
-LL |         *z.pointer += 1;
-   |         --------------- borrow later used here
-
-error[E0506]: cannot assign to `*y.pointer` because it is borrowed (Mir)
-  --> $DIR/issue-45697-1.rs:30:9
-   |
-LL |         let z = copy_borrowed_ptr(&mut y);
-   |                                   ------ borrow of `*y.pointer` occurs here
-LL |         *y.pointer += 1;
-   |         ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here
-...
-LL |         *z.pointer += 1;
-   |         --------------- borrow later used here
-
-error: aborting due to 3 previous errors
-
-Some errors occurred: E0503, E0506.
-For more information about an error, try `rustc --explain E0503`.
diff --git a/src/test/ui/issue-46471-1.nll.stderr b/src/test/ui/issue-46471-1.nll.stderr
deleted file mode 100644
index 0108056bc72..00000000000
--- a/src/test/ui/issue-46471-1.nll.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error[E0597]: `z` does not live long enough (Ast)
-  --> $DIR/issue-46471-1.rs:16:14
-   |
-LL |         &mut z
-   |              ^ borrowed value does not live long enough
-LL |     };
-   |     - `z` dropped here while still borrowed
-...
-LL | }
-   | - borrowed value needs to live until here
-
-error[E0597]: `z` does not live long enough (Mir)
-  --> $DIR/issue-46471-1.rs:16:9
-   |
-LL |       let y = {
-   |  _____________-
-LL | |         let mut z = 0;
-LL | |         &mut z
-   | |         ^^^^^^ borrowed value does not live long enough
-LL | |     };
-   | |     -
-   | |     |
-   | |_____borrowed value only lives until here
-   |       borrow later used here
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
index 62ccea36bd3..d422a63bcad 100644
--- a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
+++ b/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/42701_one_named_and_one_anonymous.rs:20:9
    |
 LL |         &*x //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
index 78546594ef0..5451562cdfb 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:21:21
    |
 LL |                     other //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
index 11bb1df3c78..e1dfeb0ac6a 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-if-else-2.rs:12:16
    |
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
index a619e6ca964..1e45914138d 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-if-else-3.rs:12:27
    |
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
index 92245173ce8..e264b3428c9 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-2.rs:14:15
    |
 LL |    if x > y { x } else { y } //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
index 32ef068b8b9..6119f3c5605 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl-3.rs:18:36
    |
 LL |     if true { &self.field } else { x } //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
index fd10b0d338c..71e9c34ac2b 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-if-else-using-impl.rs:21:20
    |
 LL |         if x > y { x } else { y } //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
index f17b24a0aca..5e49e4ec4a9 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-if-else.rs:12:27
    |
 LL |     if x > y { x } else { y } //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
index b1663fe5eb6..6c16d6a608e 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-return-type-is-anon.rs:18:5
    |
 LL |     x //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
index 19b8bd2f780..6dc96ace4d0 100644
--- a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:18:30
    |
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr
index 0b34e464b4b..a51d9307d07 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex2a-push-one-existing-name-2.rs:16:12
    |
 LL |     y.push(x); //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr
index 212b39966aa..c5f3510fa0e 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:12
    |
 LL |     x.push(y); //~ ERROR explicit lifetime required
diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr
index ad39028154a..e50fd74faf4 100644
--- a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex2a-push-one-existing-name.rs:16:12
    |
 LL |     x.push(y); //~ ERROR explicit lifetime
diff --git a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
index 34daea7c9f4..283192c6843 100644
--- a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex2b-push-no-existing-names.rs:16:12
    |
 LL |     x.push(y); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr
index 96baa5c8ad2..2ca202b402c 100644
--- a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex2c-push-inference-variable.rs:16:13
    |
 LL |     let z = Ref { data: y.data };
diff --git a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
index e5d47689b49..712c25f8929 100644
--- a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex2d-push-inference-variable-2.rs:17:13
    |
 LL |     let b = Ref { data: y.data };
diff --git a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
index 668752f8e02..351966902a4 100644
--- a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex2e-push-inference-variable-3.rs:17:13
    |
 LL |     let b = Ref { data: y.data };
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
index 45234249711..871a0b109b4 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-2.rs:12:9
    |
 LL |     v = x; //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
index 581088a9258..102981977e5 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr
@@ -1,10 +1,10 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-3.rs:12:13
    |
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
    |             ^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-3.rs:12:15
    |
 LL |     z.push((x,y)); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
index b15f5f4a0fc..191389b7706 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-both-are-structs-2.rs:16:11
    |
 LL |     x.b = y.b; //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
index 0ec73c2e778..159367cc9d2 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-both-are-structs-3.rs:16:11
    |
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr
index 727a701d3f2..3bbcbdd6681 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-both-are-structs-4.rs:16:11
    |
 LL |     x.a = x.b; //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
index f010c87377e..9d1f6a3e36f 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs:18:12
    |
 LL |     x.push(y); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
index 2b48b176ae8..5df93fd5547 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-both-are-structs-latebound-regions.rs:15:12
    |
 LL |     x.push(y); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
index c9ac04cb01e..cd602cf950b 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-both-are-structs.rs:15:12
    |
 LL |     x.push(y); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
index 9c7fc8ac458..52c90839c32 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-latebound-regions.rs:12:12
    |
 LL |     x.push(y); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
index 85a0b7c1345..9d6d68f518d 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:14:9
    |
 LL |     y = x.b; //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
index 4e160001b87..e7fb67f117f 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-one-is-struct-3.rs:14:11
    |
 LL |     y.b = x; //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
index 7bbc3c4084f..af9e3a42664 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:14:11
    |
 LL |     y.b = x; //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
index 9fd7bbac247..5437beaab65 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-one-is-struct.rs:17:11
    |
 LL |     x.b = y; //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
index 528a846991c..42e1d42a32c 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5
    |
 LL |     x //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
index f8c0b5940c9..26b0488cfdc 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-self-is-anon.rs:17:19
    |
 LL |         if true { x } else { self } //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
index 284f760435c..f58f33c9a9a 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-using-fn-items.rs:11:10
    |
 LL |   y.push(z); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
index 389549a8464..4d54f6fe037 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-using-impl-items.rs:15:16
    |
 LL |         x.push(y); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
index 185ea89275f..4bfb4ac2833 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions-using-trait-objects.rs:11:10
    |
 LL |   y.push(z); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr b/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr
index 629a97ab5ca..c25eedc770d 100644
--- a/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr
+++ b/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr
@@ -1,4 +1,4 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/ex3-both-anon-regions.rs:12:12
    |
 LL |     x.push(y); //~ ERROR lifetime mismatch
diff --git a/src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr b/src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr
index 6ae5f777a93..b97bdeea409 100644
--- a/src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr
+++ b/src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr
@@ -1,20 +1,26 @@
-error[E0594]: cannot assign to immutable item `*x`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/enum.rs:19:5
    |
+LL |     let Wrap(x) = &Wrap(3);
+   |              - help: consider changing this to be a mutable reference: `&mut`
 LL |     *x += 1; //~ ERROR cannot assign to immutable
-   |     ^^^^^^^ cannot mutate
+   |     ^^^^^^^
 
-error[E0594]: cannot assign to immutable item `*x`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/enum.rs:23:9
    |
+LL |     if let Some(x) = &Some(3) {
+   |                 - help: consider changing this to be a mutable reference: `&mut`
 LL |         *x += 1; //~ ERROR cannot assign to immutable
-   |         ^^^^^^^ cannot mutate
+   |         ^^^^^^^
 
-error[E0594]: cannot assign to immutable item `*x`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/enum.rs:29:9
    |
+LL |     while let Some(x) = &Some(3) {
+   |                    - help: consider changing this to be a mutable reference: `&mut`
 LL |         *x += 1; //~ ERROR cannot assign to immutable
-   |         ^^^^^^^ cannot mutate
+   |         ^^^^^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr b/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr
index 7138c4ac06e..3ee4dc07bb8 100644
--- a/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr
+++ b/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr
@@ -1,20 +1,26 @@
-error[E0594]: cannot assign to immutable item `*n`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/explicit-mut.rs:17:13
    |
+LL |         Some(n) => {
+   |              - help: consider changing this to be a mutable reference: `&mut`
 LL |             *n += 1; //~ ERROR cannot assign to immutable
-   |             ^^^^^^^ cannot mutate
+   |             ^^^^^^^
 
-error[E0594]: cannot assign to immutable item `*n`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/explicit-mut.rs:25:13
    |
+LL |         Some(n) => {
+   |              - help: consider changing this to be a mutable reference: `&mut`
 LL |             *n += 1; //~ ERROR cannot assign to immutable
-   |             ^^^^^^^ cannot mutate
+   |             ^^^^^^^
 
-error[E0594]: cannot assign to immutable item `*n`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/explicit-mut.rs:33:13
    |
+LL |         Some(n) => {
+   |              - help: consider changing this to be a mutable reference: `&mut`
 LL |             *n += 1; //~ ERROR cannot assign to immutable
-   |             ^^^^^^^ cannot mutate
+   |             ^^^^^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
index 505ee95088f..26e9ea4dc0b 100644
--- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
+++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
@@ -24,7 +24,7 @@ error[E0596]: cannot borrow immutable item `*f.f` as mutable
 LL |     f.f.call_mut(())
    |     ^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*f`
+   = note: the value which is causing this path not to be mutable is...: `*f`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-call-is-borrow-issue-12224.rs:66:13
diff --git a/src/test/ui/span/borrowck-object-mutability.nll.stderr b/src/test/ui/span/borrowck-object-mutability.nll.stderr
index 100b5ae150a..9b5e084bd37 100644
--- a/src/test/ui/span/borrowck-object-mutability.nll.stderr
+++ b/src/test/ui/span/borrowck-object-mutability.nll.stderr
@@ -10,7 +10,7 @@ error[E0596]: cannot borrow immutable item `*x` as mutable
 LL |     x.borrowed_mut(); //~ ERROR cannot borrow
    |     ^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `x`
+   = note: the value which is causing this path not to be mutable is...: `x`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/span/destructor-restrictions.nll.stderr b/src/test/ui/span/destructor-restrictions.nll.stderr
index e69de29bb2d..5de246cbb73 100644
--- a/src/test/ui/span/destructor-restrictions.nll.stderr
+++ b/src/test/ui/span/destructor-restrictions.nll.stderr
@@ -0,0 +1,16 @@
+error[E0597]: `*a` does not live long enough
+  --> $DIR/destructor-restrictions.rs:18:10
+   |
+LL |         *a.borrow() + 1
+   |          ^---------
+   |          |
+   |          borrowed value does not live long enough
+   |          borrow may end up in a temporary, created here
+LL |     }; //~^ ERROR `*a` does not live long enough
+   |     -- temporary later dropped here, potentially using the reference
+   |     |
+   |     borrowed value only lives until here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr b/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr
index 41edd04c92e..b7f8b85f46c 100644
--- a/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr
+++ b/src/test/ui/span/dropck_vec_cycle_checked.nll.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `c1` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:118:24
+  --> $DIR/dropck_vec_cycle_checked.rs:121:24
    |
 LL |     c3.v[0].v.set(Some(&c1));
    |                        ^^^ borrowed value does not live long enough
@@ -11,7 +11,7 @@ LL | }
    | borrow later used here, when `c1` is dropped
 
 error[E0597]: `c2` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:110:24
+  --> $DIR/dropck_vec_cycle_checked.rs:113:24
    |
 LL |     c1.v[0].v.set(Some(&c2));
    |                        ^^^ borrowed value does not live long enough
@@ -23,7 +23,7 @@ LL | }
    | borrow later used here, when `c1` is dropped
 
 error[E0597]: `c3` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:112:24
+  --> $DIR/dropck_vec_cycle_checked.rs:115:24
    |
 LL |     c1.v[1].v.set(Some(&c3));
    |                        ^^^ borrowed value does not live long enough
diff --git a/src/test/ui/span/dropck_vec_cycle_checked.rs b/src/test/ui/span/dropck_vec_cycle_checked.rs
index 0560900e858..ece58d21ba9 100644
--- a/src/test/ui/span/dropck_vec_cycle_checked.rs
+++ b/src/test/ui/span/dropck_vec_cycle_checked.rs
@@ -8,6 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-flags: -Z nll-subminimal-causes
+// (Work around rust-lang/rust#49998 by opting into nll-subminimal-causes.)
+
 // Reject mixing cyclic structure and Drop when using Vec.
 //
 // (Compare against compile-fail/dropck_arr_cycle_checked.rs)
diff --git a/src/test/ui/span/dropck_vec_cycle_checked.stderr b/src/test/ui/span/dropck_vec_cycle_checked.stderr
index 63b0ab52d39..a6bc8da6f7c 100644
--- a/src/test/ui/span/dropck_vec_cycle_checked.stderr
+++ b/src/test/ui/span/dropck_vec_cycle_checked.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `c2` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:110:25
+  --> $DIR/dropck_vec_cycle_checked.rs:113:25
    |
 LL |     c1.v[0].v.set(Some(&c2));
    |                         ^^ borrowed value does not live long enough
@@ -10,7 +10,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c3` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:112:25
+  --> $DIR/dropck_vec_cycle_checked.rs:115:25
    |
 LL |     c1.v[1].v.set(Some(&c3));
    |                         ^^ borrowed value does not live long enough
@@ -21,7 +21,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c2` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:114:25
+  --> $DIR/dropck_vec_cycle_checked.rs:117:25
    |
 LL |     c2.v[0].v.set(Some(&c2));
    |                         ^^ borrowed value does not live long enough
@@ -32,7 +32,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c3` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:116:25
+  --> $DIR/dropck_vec_cycle_checked.rs:119:25
    |
 LL |     c2.v[1].v.set(Some(&c3));
    |                         ^^ borrowed value does not live long enough
@@ -43,7 +43,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c1` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:118:25
+  --> $DIR/dropck_vec_cycle_checked.rs:121:25
    |
 LL |     c3.v[0].v.set(Some(&c1));
    |                         ^^ borrowed value does not live long enough
@@ -54,7 +54,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c2` does not live long enough
-  --> $DIR/dropck_vec_cycle_checked.rs:120:25
+  --> $DIR/dropck_vec_cycle_checked.rs:123:25
    |
 LL |     c3.v[1].v.set(Some(&c2));
    |                         ^^ borrowed value does not live long enough
diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
index e69de29bb2d..56f2d14390e 100644
--- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
+++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
@@ -0,0 +1,30 @@
+error[E0597]: `y` does not live long enough
+  --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:20:5
+   |
+LL |     y.borrow().clone()
+   |     ^---------
+   |     |
+   |     borrowed value does not live long enough
+   |     borrow may end up in a temporary, created here
+LL | }
+   | -
+   | |
+   | borrowed value only lives until here
+   | temporary later dropped here, potentially using the reference
+
+error[E0597]: `y` does not live long enough
+  --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:27:9
+   |
+LL |         y.borrow().clone()
+   |         ^---------
+   |         |
+   |         borrowed value does not live long enough
+   |         borrow may end up in a temporary, created here
+LL |     };
+   |     -- temporary later dropped here, potentially using the reference
+   |     |
+   |     borrowed value only lives until here
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/wf-method-late-bound-regions.nll.stderr b/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
index a175cf1b38a..063ac376b05 100644
--- a/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
+++ b/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
@@ -1,14 +1,14 @@
-error: compilation successful
-  --> $DIR/wf-method-late-bound-regions.rs:25:1
+error[E0597]: `pointer` does not live long enough
+  --> $DIR/wf-method-late-bound-regions.rs:30:18
    |
-LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
-LL | |     let f = Foo(None);
-LL | |     let f2 = f;
-LL | |     let dangling = {
-...  |
-LL | |     println!("{}", dangling);
-LL | | }
-   | |_^
+LL |         f2.xmute(&pointer)
+   |                  ^^^^^^^^ borrowed value does not live long enough
+LL |     };
+   |     - borrowed value only lives until here
+LL |     //~^^ ERROR `pointer` does not live long enough
+LL |     println!("{}", dangling);
+   |                    -------- borrow later used here
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/wf-method-late-bound-regions.rs b/src/test/ui/span/wf-method-late-bound-regions.rs
index 317cd395d0a..d58c29d4a32 100644
--- a/src/test/ui/span/wf-method-late-bound-regions.rs
+++ b/src/test/ui/span/wf-method-late-bound-regions.rs
@@ -11,7 +11,7 @@
 // A method's receiver must be well-formed, even if it has late-bound regions.
 // Because of this, a method's substs being well-formed does not imply that
 // the method's implied bounds are met.
-#![feature(rustc_attrs)]
+
 struct Foo<'b>(Option<&'b ()>);
 
 trait Bar<'b> {
@@ -22,7 +22,7 @@ impl<'b> Bar<'b> for Foo<'b> {
     fn xmute<'a>(&'a self, u: &'b u32) -> &'a u32 { u }
 }
 
-fn main() { #![rustc_error] // rust-lang/rust#49855
+fn main() {
     let f = Foo(None);
     let f2 = f;
     let dangling = {
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr
index f8ea891914e..10a03786d7b 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.nll.stderr
@@ -1,22 +1,22 @@
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/dyn-trait-underscore.rs:20:14
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |              ^^^^^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/dyn-trait-underscore.rs:20:20
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |                    ^^^^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/dyn-trait-underscore.rs:20:5
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
    |     ^^^^^^^^
 
-warning: not reporting region error due to -Znll
+warning: not reporting region error due to nll
   --> $DIR/dyn-trait-underscore.rs:20:5
    |
 LL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime
diff --git a/src/test/ui/update-references.sh b/src/test/ui/update-references.sh
index c2c842fcc49..cfe9a43707c 100755
--- a/src/test/ui/update-references.sh
+++ b/src/test/ui/update-references.sh
@@ -33,6 +33,7 @@ shift
 
 while [[ "$1" != "" ]]; do
     STDERR_NAME="${1/%.rs/.stderr}"
+    STDERR_NLL_NAME="${1/%.rs/.nll.stderr}"
     STDOUT_NAME="${1/%.rs/.stdout}"
     shift
     if [ -f $BUILD_DIR/$STDOUT_NAME ] && \
@@ -45,4 +46,9 @@ while [[ "$1" != "" ]]; do
         echo updating $MYDIR/$STDERR_NAME
         cp $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME
     fi
+    if [ -f $BUILD_DIR/$STDERR_NLL_NAME ] && \
+           ! (diff $BUILD_DIR/$STDERR_NLL_NAME $MYDIR/$STDERR_NLL_NAME >& /dev/null); then
+        echo updating $MYDIR/$STDERR_NLL_NAME
+        cp $BUILD_DIR/$STDERR_NLL_NAME $MYDIR/$STDERR_NLL_NAME
+    fi
 done
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs
index 41fc67a66f4..365b47447f2 100644
--- a/src/tools/compiletest/src/common.rs
+++ b/src/tools/compiletest/src/common.rs
@@ -101,7 +101,7 @@ pub enum CompareMode {
 }
 
 impl CompareMode {
-    fn to_str(&self) -> &'static str {
+    pub(crate) fn to_str(&self) -> &'static str {
         match *self {
             CompareMode::Nll => "nll"
         }
diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs
index ae4f4aa4046..37f7af0abe8 100644
--- a/src/tools/compiletest/src/main.rs
+++ b/src/tools/compiletest/src/main.rs
@@ -626,7 +626,7 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> test::TestDescAndFn
 
     // Debugging emscripten code doesn't make sense today
     let ignore = early_props.ignore
-        || (!up_to_date(config, testpaths, &early_props) && config.compare_mode.is_none())
+        || !up_to_date(config, testpaths, &early_props)
         || (config.mode == DebugInfoGdb || config.mode == DebugInfoLldb)
             && config.target.contains("emscripten");
 
@@ -642,10 +642,15 @@ pub fn make_test(config: &Config, testpaths: &TestPaths) -> test::TestDescAndFn
 }
 
 fn stamp(config: &Config, testpaths: &TestPaths) -> PathBuf {
+    let mode_suffix = match config.compare_mode {
+        Some(ref mode) => format!("-{}", mode.to_str()),
+        None => format!(""),
+    };
     let stamp_name = format!(
-        "{}-{}.stamp",
+        "{}-{}{}.stamp",
         testpaths.file.file_name().unwrap().to_str().unwrap(),
-        config.stage_id
+        config.stage_id,
+        mode_suffix
     );
     config
         .build_base
@@ -728,7 +733,11 @@ pub fn make_test_name(config: &Config, testpaths: &TestPaths) -> test::TestName
     let path = PathBuf::from(config.src_base.file_name().unwrap())
         .join(&testpaths.relative_dir)
         .join(&testpaths.file.file_name().unwrap());
-    test::DynTestName(format!("[{}] {}", config.mode, path.display()))
+    let mode_suffix = match config.compare_mode {
+        Some(ref mode) => format!(" ({})", mode.to_str()),
+        None => format!(""),
+    };
+    test::DynTestName(format!("[{}{}] {}", config.mode, mode_suffix, path.display()))
 }
 
 pub fn make_test_closure(config: &Config, testpaths: &TestPaths) -> test::TestFn {
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index e79aefb7236..c16dbd0272a 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2811,7 +2811,7 @@ impl<'test> TestCx<'test> {
         normalized
     }
 
-    fn load_expected_output(&self, kind: &str) -> String {
+    fn expected_output_path(&self, kind: &str) -> PathBuf {
         let mut path = expected_output_path(&self.testpaths,
                                             self.revision,
                                             &self.config.compare_mode,
@@ -2822,6 +2822,11 @@ impl<'test> TestCx<'test> {
             path = expected_output_path(&self.testpaths, self.revision, &None, kind);
         }
 
+        path
+    }
+
+    fn load_expected_output(&self, kind: &str) -> String {
+        let path = self.expected_output_path(kind);
         if path.exists() {
             match self.load_expected_output_from_path(&path) {
                 Ok(x) => x,
@@ -2875,7 +2880,8 @@ impl<'test> TestCx<'test> {
             }
         }
 
-        let output_file = self.output_base_name().with_extension(kind);
+        let expected_output_path = self.expected_output_path(kind);
+        let output_file = self.output_base_name().with_file_name(&expected_output_path);
         match File::create(&output_file).and_then(|mut f| f.write_all(actual.as_bytes())) {
             Ok(()) => {}
             Err(e) => self.fatal(&format!(