about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-24 12:28:44 +0000
committerbors <bors@rust-lang.org>2020-04-24 12:28:44 +0000
commit061256835886be38fcb2255d585ec4e1292b77d0 (patch)
tree824994c9e189927b671453c26ac58e0ce72b7976 /src/test
parent0b958790b336738540d027d645718713849638d7 (diff)
parent08ca4472679057539e71fdb78b9e45e74c6932db (diff)
downloadrust-061256835886be38fcb2255d585ec4e1292b77d0.tar.gz
rust-061256835886be38fcb2255d585ec4e1292b77d0.zip
Auto merge of #71509 - Dylan-DPC:rollup-n8s37rm, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #71235 (Tweak `'static` suggestion code)
 - #71318 (miri-unleash tests: ensure they fire even with 'allow(const_err)')
 - #71428 (Let compiletest recognize gdb 10.x)
 - #71475 (Miri Frame: use mir::Location to represent position in function)
 - #71476 (more compact way to adjust test sizes for Miri)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr6
-rw-r--r--src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr6
-rw-r--r--src/test/ui/async-await/issues/issue-63388-2.stderr6
-rw-r--r--src/test/ui/c-variadic/variadic-ffi-6.stderr6
-rw-r--r--src/test/ui/consts/miri_unleashed/abi-mismatch.rs9
-rw-r--r--src/test/ui/consts/miri_unleashed/abi-mismatch.stderr22
-rw-r--r--src/test/ui/consts/miri_unleashed/box.rs2
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static.rs30
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr91
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs24
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static2.stderr39
-rw-r--r--src/test/ui/consts/miri_unleashed/drop.rs2
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_const.rs12
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_const.stderr11
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_const2.rs4
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_references_ice.rs2
-rw-r--r--src/test/ui/consts/miri_unleashed/mutating_global.rs9
-rw-r--r--src/test/ui/consts/miri_unleashed/mutating_global.stderr30
-rw-r--r--src/test/ui/consts/miri_unleashed/non_const_fn.rs14
-rw-r--r--src/test/ui/consts/miri_unleashed/non_const_fn.stderr36
-rw-r--r--src/test/ui/foreign-fn-return-lifetime.stderr6
-rw-r--r--src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr25
-rw-r--r--src/test/ui/issues/issue-13497.stderr6
-rw-r--r--src/test/ui/issues/issue-26638.stderr12
-rw-r--r--src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr24
-rw-r--r--src/test/ui/specialization/defaultimpl/validation.stderr4
-rw-r--r--src/test/ui/suggestions/missing-lifetime-specifier.rs65
-rw-r--r--src/test/ui/suggestions/missing-lifetime-specifier.stderr256
-rw-r--r--src/test/ui/suggestions/return-without-lifetime.stderr19
-rw-r--r--src/test/ui/traits/negative-impls/negative-default-impls.stderr2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr4
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr2
-rw-r--r--src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr13
-rw-r--r--src/test/ui/unspecified-self-in-trait-ref.stderr2
36 files changed, 594 insertions, 211 deletions
diff --git a/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr b/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
index 2745e44ac0c..00f44129cc8 100644
--- a/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
+++ b/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
@@ -2,9 +2,13 @@ error[E0106]: missing lifetime specifier
   --> $DIR/bound-lifetime-in-binding-only.rs:52:23
    |
 LL | fn elision<T: Fn() -> &i32>() {
-   |                       ^ help: consider giving it a 'static lifetime: `&'static`
+   |                       ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL | fn elision<T: Fn() -> &'static i32>() {
+   |                       ^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
index 96f0cb85c8c..a5242707c71 100644
--- a/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
+++ b/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
@@ -2,9 +2,13 @@ error[E0106]: missing lifetime specifier
   --> $DIR/bound-lifetime-in-return-only.rs:34:23
    |
 LL | fn elision(_: fn() -> &i32) {
-   |                       ^ help: consider giving it a 'static lifetime: `&'static`
+   |                       ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL | fn elision(_: fn() -> &'static i32) {
+   |                       ^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/async-await/issues/issue-63388-2.stderr b/src/test/ui/async-await/issues/issue-63388-2.stderr
index 6edb9e63d48..ca42263dfed 100644
--- a/src/test/ui/async-await/issues/issue-63388-2.stderr
+++ b/src/test/ui/async-await/issues/issue-63388-2.stderr
@@ -4,9 +4,13 @@ error[E0106]: missing lifetime specifier
 LL |         foo: &dyn Foo, bar: &'a dyn Foo
    |              --------       -----------
 LL |     ) -> &dyn Foo
-   |          ^ help: consider using the named lifetime: `&'a`
+   |          ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `foo` or `bar`
+help: consider using the `'a` lifetime
+   |
+LL |     ) -> &'a dyn Foo
+   |          ^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/c-variadic/variadic-ffi-6.stderr b/src/test/ui/c-variadic/variadic-ffi-6.stderr
index 882e7f89f2a..4626a4bc2dc 100644
--- a/src/test/ui/c-variadic/variadic-ffi-6.stderr
+++ b/src/test/ui/c-variadic/variadic-ffi-6.stderr
@@ -2,9 +2,13 @@ error[E0106]: missing lifetime specifier
   --> $DIR/variadic-ffi-6.rs:7:6
    |
 LL | ) -> &usize {
-   |      ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
+   |      ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
+help: consider using the `'static` lifetime
+   |
+LL | ) -> &'static usize {
+   |      ^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/consts/miri_unleashed/abi-mismatch.rs b/src/test/ui/consts/miri_unleashed/abi-mismatch.rs
index d8e63b0bfb2..a99e6327987 100644
--- a/src/test/ui/consts/miri_unleashed/abi-mismatch.rs
+++ b/src/test/ui/consts/miri_unleashed/abi-mismatch.rs
@@ -2,15 +2,20 @@
 // compile-flags: -Z unleash-the-miri-inside-of-you
 
 #![feature(const_extern_fn)]
+#![allow(const_err)]
 
 const extern "C" fn c_fn() {}
 
 const fn call_rust_fn(my_fn: extern "Rust" fn()) {
-    my_fn(); //~ ERROR any use of this value will cause an error
+    my_fn();
     //~^ WARN skipping const checks
+    //~| ERROR could not evaluate static initializer
+    //~| NOTE calling a function with ABI C using caller ABI Rust
+    //~| NOTE inside `call_rust_fn`
 }
 
-const VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "C" fn()) });
+static VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "C" fn()) });
 //~^ WARN skipping const checks
+//~| NOTE inside `VAL`
 
 fn main() {}
diff --git a/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr b/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr
index dba00d72ef0..674a293d281 100644
--- a/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr
+++ b/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr
@@ -1,29 +1,27 @@
 warning: skipping const checks
-  --> $DIR/abi-mismatch.rs:9:5
+  --> $DIR/abi-mismatch.rs:10:5
    |
 LL |     my_fn();
    |     ^^^^^^^
 
 warning: skipping const checks
-  --> $DIR/abi-mismatch.rs:13:39
+  --> $DIR/abi-mismatch.rs:17:40
    |
-LL | const VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "C" fn()) });
-   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | static VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "C" fn()) });
+   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: any use of this value will cause an error
-  --> $DIR/abi-mismatch.rs:9:5
+error[E0080]: could not evaluate static initializer
+  --> $DIR/abi-mismatch.rs:10:5
    |
 LL |     my_fn();
    |     ^^^^^^^
    |     |
    |     calling a function with ABI C using caller ABI Rust
-   |     inside `call_rust_fn` at $DIR/abi-mismatch.rs:9:5
-   |     inside `VAL` at $DIR/abi-mismatch.rs:13:17
+   |     inside `call_rust_fn` at $DIR/abi-mismatch.rs:10:5
 ...
-LL | const VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "C" fn()) });
-   | --------------------------------------------------------------------------------------
-   |
-   = note: `#[deny(const_err)]` on by default
+LL | static VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "C" fn()) });
+   |                  --------------------------------------------------------------------- inside `VAL` at $DIR/abi-mismatch.rs:17:18
 
 error: aborting due to previous error; 2 warnings emitted
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/box.rs b/src/test/ui/consts/miri_unleashed/box.rs
index 049727684d0..1b18470eded 100644
--- a/src/test/ui/consts/miri_unleashed/box.rs
+++ b/src/test/ui/consts/miri_unleashed/box.rs
@@ -1,6 +1,6 @@
 // compile-flags: -Zunleash-the-miri-inside-of-you
 #![feature(const_mut_refs, box_syntax)]
-#![deny(const_err)]
+#![allow(const_err)]
 
 use std::mem::ManuallyDrop;
 
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.rs b/src/test/ui/consts/miri_unleashed/const_refers_to_static.rs
index edbf0e02d8d..11f4a30d177 100644
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static.rs
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static.rs
@@ -1,39 +1,37 @@
+// build-fail
 // compile-flags: -Zunleash-the-miri-inside-of-you
-#![warn(const_err)]
+#![allow(const_err)]
 
 #![feature(const_raw_ptr_deref)]
 
 use std::sync::atomic::AtomicUsize;
 use std::sync::atomic::Ordering;
 
-const REF_INTERIOR_MUT: &usize = { //~ ERROR undefined behavior to use this value
-    static FOO: AtomicUsize = AtomicUsize::new(0);
-    unsafe { &*(&FOO as *const _ as *const usize) }
-    //~^ WARN skipping const checks
-};
+// These tests only cause an error when *using* the const.
 
 const MUTATE_INTERIOR_MUT: usize = {
     static FOO: AtomicUsize = AtomicUsize::new(0);
-    FOO.fetch_add(1, Ordering::Relaxed) //~ WARN any use of this value will cause an error
+    FOO.fetch_add(1, Ordering::Relaxed)
     //~^ WARN skipping const checks
     //~| WARN skipping const checks
 };
 
 const READ_INTERIOR_MUT: usize = {
     static FOO: AtomicUsize = AtomicUsize::new(0);
-    unsafe { *(&FOO as *const _ as *const usize) } //~ WARN any use of this value will cause an err
+    unsafe { *(&FOO as *const _ as *const usize) }
     //~^ WARN skipping const checks
 };
 
 static mut MUTABLE: u32 = 0;
-const READ_MUT: u32 = unsafe { MUTABLE }; //~ WARN any use of this value will cause an error
+const READ_MUT: u32 = unsafe { MUTABLE };
 //~^ WARN skipping const checks
 //~| WARN skipping const checks
 
-// ok some day perhaps
-const READ_IMMUT: &usize = { //~ ERROR it is undefined behavior to use this value
-    static FOO: usize = 0;
-    &FOO
-    //~^ WARN skipping const checks
-};
-fn main() {}
+fn main() {
+    MUTATE_INTERIOR_MUT;
+    //~^ ERROR: erroneous constant used
+    READ_INTERIOR_MUT;
+    //~^ ERROR: erroneous constant used
+    READ_MUT;
+    //~^ ERROR: erroneous constant used
+}
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
index 92e782612b2..788762808f1 100644
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
@@ -1,106 +1,51 @@
 warning: skipping const checks
-  --> $DIR/const_refers_to_static.rs:11:18
-   |
-LL |     unsafe { &*(&FOO as *const _ as *const usize) }
-   |                  ^^^
-
-warning: skipping const checks
-  --> $DIR/const_refers_to_static.rs:17:5
+  --> $DIR/const_refers_to_static.rs:14:5
    |
 LL |     FOO.fetch_add(1, Ordering::Relaxed)
    |     ^^^
 
 warning: skipping const checks
-  --> $DIR/const_refers_to_static.rs:17:5
+  --> $DIR/const_refers_to_static.rs:14:5
    |
 LL |     FOO.fetch_add(1, Ordering::Relaxed)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: skipping const checks
-  --> $DIR/const_refers_to_static.rs:24:17
+  --> $DIR/const_refers_to_static.rs:21:17
    |
 LL |     unsafe { *(&FOO as *const _ as *const usize) }
    |                 ^^^
 
 warning: skipping const checks
-  --> $DIR/const_refers_to_static.rs:29:32
+  --> $DIR/const_refers_to_static.rs:26:32
    |
 LL | const READ_MUT: u32 = unsafe { MUTABLE };
    |                                ^^^^^^^
 
 warning: skipping const checks
-  --> $DIR/const_refers_to_static.rs:29:32
+  --> $DIR/const_refers_to_static.rs:26:32
    |
 LL | const READ_MUT: u32 = unsafe { MUTABLE };
    |                                ^^^^^^^
 
-warning: skipping const checks
-  --> $DIR/const_refers_to_static.rs:36:6
+error[E0080]: erroneous constant used
+  --> $DIR/const_refers_to_static.rs:31:5
    |
-LL |     &FOO
-   |      ^^^
+LL |     MUTATE_INTERIOR_MUT;
+   |     ^^^^^^^^^^^^^^^^^^^ referenced constant has errors
 
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refers_to_static.rs:9:1
+error[E0080]: erroneous constant used
+  --> $DIR/const_refers_to_static.rs:33:5
    |
-LL | / const REF_INTERIOR_MUT: &usize = {
-LL | |     static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | |     unsafe { &*(&FOO as *const _ as *const usize) }
-LL | |
-LL | | };
-   | |__^ type validation failed: encountered a reference pointing to a static variable
-   |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+LL |     READ_INTERIOR_MUT;
+   |     ^^^^^^^^^^^^^^^^^ referenced constant has errors
 
-warning: any use of this value will cause an error
-  --> $DIR/const_refers_to_static.rs:17:5
-   |
-LL | / const MUTATE_INTERIOR_MUT: usize = {
-LL | |     static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | |     FOO.fetch_add(1, Ordering::Relaxed)
-   | |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `std::sync::atomic::AtomicUsize::fetch_add`
-LL | |
-LL | |
-LL | | };
-   | |__-
-   |
-note: the lint level is defined here
-  --> $DIR/const_refers_to_static.rs:2:9
-   |
-LL | #![warn(const_err)]
-   |         ^^^^^^^^^
-
-warning: any use of this value will cause an error
-  --> $DIR/const_refers_to_static.rs:24:14
-   |
-LL | / const READ_INTERIOR_MUT: usize = {
-LL | |     static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | |     unsafe { *(&FOO as *const _ as *const usize) }
-   | |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
-LL | |
-LL | | };
-   | |__-
-
-warning: any use of this value will cause an error
-  --> $DIR/const_refers_to_static.rs:29:32
-   |
-LL | const READ_MUT: u32 = unsafe { MUTABLE };
-   | -------------------------------^^^^^^^---
-   |                                |
-   |                                constant accesses static
-
-error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refers_to_static.rs:34:1
-   |
-LL | / const READ_IMMUT: &usize = {
-LL | |     static FOO: usize = 0;
-LL | |     &FOO
-LL | |
-LL | | };
-   | |__^ type validation failed: encountered a reference pointing to a static variable
+error[E0080]: erroneous constant used
+  --> $DIR/const_refers_to_static.rs:35:5
    |
-   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+LL |     READ_MUT;
+   |     ^^^^^^^^ referenced constant has errors
 
-error: aborting due to 2 previous errors; 10 warnings emitted
+error: aborting due to 3 previous errors; 5 warnings emitted
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs
new file mode 100644
index 00000000000..2704f2a7d73
--- /dev/null
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs
@@ -0,0 +1,24 @@
+// compile-flags: -Zunleash-the-miri-inside-of-you
+#![allow(const_err)]
+
+#![feature(const_raw_ptr_deref)]
+
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::Ordering;
+
+// These tests cause immediate error when *defining* the const.
+
+const REF_INTERIOR_MUT: &usize = { //~ ERROR undefined behavior to use this value
+    static FOO: AtomicUsize = AtomicUsize::new(0);
+    unsafe { &*(&FOO as *const _ as *const usize) }
+    //~^ WARN skipping const checks
+};
+
+// ok some day perhaps
+const READ_IMMUT: &usize = { //~ ERROR it is undefined behavior to use this value
+    static FOO: usize = 0;
+    &FOO
+    //~^ WARN skipping const checks
+};
+
+fn main() {}
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.stderr
new file mode 100644
index 00000000000..2a233d63efe
--- /dev/null
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.stderr
@@ -0,0 +1,39 @@
+warning: skipping const checks
+  --> $DIR/const_refers_to_static2.rs:13:18
+   |
+LL |     unsafe { &*(&FOO as *const _ as *const usize) }
+   |                  ^^^
+
+warning: skipping const checks
+  --> $DIR/const_refers_to_static2.rs:20:6
+   |
+LL |     &FOO
+   |      ^^^
+
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/const_refers_to_static2.rs:11:1
+   |
+LL | / const REF_INTERIOR_MUT: &usize = {
+LL | |     static FOO: AtomicUsize = AtomicUsize::new(0);
+LL | |     unsafe { &*(&FOO as *const _ as *const usize) }
+LL | |
+LL | | };
+   | |__^ type validation failed: encountered a reference pointing to a static variable
+   |
+   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+
+error[E0080]: it is undefined behavior to use this value
+  --> $DIR/const_refers_to_static2.rs:18:1
+   |
+LL | / const READ_IMMUT: &usize = {
+LL | |     static FOO: usize = 0;
+LL | |     &FOO
+LL | |
+LL | | };
+   | |__^ type validation failed: encountered a reference pointing to a static variable
+   |
+   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
+
+error: aborting due to 2 previous errors; 2 warnings emitted
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/drop.rs b/src/test/ui/consts/miri_unleashed/drop.rs
index 2f39148d697..3b9208dd126 100644
--- a/src/test/ui/consts/miri_unleashed/drop.rs
+++ b/src/test/ui/consts/miri_unleashed/drop.rs
@@ -1,6 +1,6 @@
 // compile-flags: -Zunleash-the-miri-inside-of-you
 // error-pattern: calling non-const function `<std::vec::Vec<i32> as std::ops::Drop>::drop`
-#![deny(const_err)]
+#![allow(const_err)]
 
 use std::mem::ManuallyDrop;
 
diff --git a/src/test/ui/consts/miri_unleashed/mutable_const.rs b/src/test/ui/consts/miri_unleashed/mutable_const.rs
index 972f59549ea..5cc8808be5d 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_const.rs
+++ b/src/test/ui/consts/miri_unleashed/mutable_const.rs
@@ -1,8 +1,13 @@
 // compile-flags: -Zunleash-the-miri-inside-of-you
+// normalize-stderr-test "alloc[0-9]+" -> "allocN"
 
 #![feature(const_raw_ptr_deref)]
 #![feature(const_mut_refs)]
-#![deny(const_err)]
+#![deny(const_err)] // The `allow` variant is tested by `mutable_const2`.
+//~^ NOTE lint level
+// Here we check that even though `MUTABLE_BEHIND_RAW` is created from a mutable
+// allocation, we intern that allocation as *immutable* and reject writes to it.
+// We avoid the `delay_span_bug` ICE by having compilation fail via the `deny` above.
 
 use std::cell::UnsafeCell;
 
@@ -10,10 +15,13 @@ use std::cell::UnsafeCell;
 const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
 //~^ WARN: skipping const checks
 
-const MUTATING_BEHIND_RAW: () = {
+const MUTATING_BEHIND_RAW: () = { //~ NOTE
     // Test that `MUTABLE_BEHIND_RAW` is actually immutable, by doing this at const time.
     unsafe {
         *MUTABLE_BEHIND_RAW = 99 //~ ERROR any use of this value will cause an error
+        //~^ NOTE: which is read-only
+        // FIXME would be good to match more of the error message here, but looks like we
+        // normalize *after* checking the annoations here.
     }
 };
 
diff --git a/src/test/ui/consts/miri_unleashed/mutable_const.stderr b/src/test/ui/consts/miri_unleashed/mutable_const.stderr
index 54a9eda2146..34993247fca 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_const.stderr
+++ b/src/test/ui/consts/miri_unleashed/mutable_const.stderr
@@ -1,25 +1,26 @@
 warning: skipping const checks
-  --> $DIR/mutable_const.rs:10:38
+  --> $DIR/mutable_const.rs:15:38
    |
 LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
    |                                      ^^^^^^^^^^^^^^^^^^^^
 
 error: any use of this value will cause an error
-  --> $DIR/mutable_const.rs:16:9
+  --> $DIR/mutable_const.rs:21:9
    |
 LL | / const MUTATING_BEHIND_RAW: () = {
 LL | |     // Test that `MUTABLE_BEHIND_RAW` is actually immutable, by doing this at const time.
 LL | |     unsafe {
 LL | |         *MUTABLE_BEHIND_RAW = 99
-   | |         ^^^^^^^^^^^^^^^^^^^^^^^^ writing to alloc2 which is read-only
+   | |         ^^^^^^^^^^^^^^^^^^^^^^^^ writing to allocN which is read-only
+...  |
 LL | |     }
 LL | | };
    | |__-
    |
 note: the lint level is defined here
-  --> $DIR/mutable_const.rs:5:9
+  --> $DIR/mutable_const.rs:6:9
    |
-LL | #![deny(const_err)]
+LL | #![deny(const_err)] // The `allow` variant is tested by `mutable_const2`.
    |         ^^^^^^^^^
 
 error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/consts/miri_unleashed/mutable_const2.rs b/src/test/ui/consts/miri_unleashed/mutable_const2.rs
index 97af1f2f993..c2c7fb18e2a 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_const2.rs
+++ b/src/test/ui/consts/miri_unleashed/mutable_const2.rs
@@ -3,11 +3,11 @@
 // rustc-env:RUST_BACKTRACE=0
 // normalize-stderr-test "note: rustc 1.* running on .*" -> "note: rustc VERSION running on TARGET"
 // normalize-stderr-test "note: compiler flags: .*" -> "note: compiler flags: FLAGS"
-// normalize-stderr-test "interpret/intern.rs:[0-9]*:[0-9]*" -> "interpret/intern.rs:LL:CC"
+// normalize-stderr-test "interpret/intern.rs:[0-9]+:[0-9]+" -> "interpret/intern.rs:LL:CC"
 
 #![feature(const_raw_ptr_deref)]
 #![feature(const_mut_refs)]
-#![deny(const_err)]
+#![allow(const_err)]
 
 use std::cell::UnsafeCell;
 
diff --git a/src/test/ui/consts/miri_unleashed/mutable_references_ice.rs b/src/test/ui/consts/miri_unleashed/mutable_references_ice.rs
index 635cad81c97..9d8d5f513c7 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_references_ice.rs
+++ b/src/test/ui/consts/miri_unleashed/mutable_references_ice.rs
@@ -3,7 +3,7 @@
 // rustc-env:RUST_BACKTRACE=0
 // normalize-stderr-test "note: rustc 1.* running on .*" -> "note: rustc VERSION running on TARGET"
 // normalize-stderr-test "note: compiler flags: .*" -> "note: compiler flags: FLAGS"
-// normalize-stderr-test "interpret/intern.rs:[0-9]*:[0-9]*" -> "interpret/intern.rs:LL:CC"
+// normalize-stderr-test "interpret/intern.rs:[0-9]+:[0-9]+" -> "interpret/intern.rs:LL:CC"
 
 #![allow(const_err)]
 
diff --git a/src/test/ui/consts/miri_unleashed/mutating_global.rs b/src/test/ui/consts/miri_unleashed/mutating_global.rs
index acc6fb026cd..902fe0aa1e7 100644
--- a/src/test/ui/consts/miri_unleashed/mutating_global.rs
+++ b/src/test/ui/consts/miri_unleashed/mutating_global.rs
@@ -1,14 +1,15 @@
 // compile-flags: -Zunleash-the-miri-inside-of-you
+#![allow(const_err)]
 
 // Make sure we cannot mutate globals.
 
 static mut GLOBAL: i32 = 0;
 
-const MUTATING_GLOBAL: () = {
+static MUTATING_GLOBAL: () = {
     unsafe {
-        GLOBAL = 99 //~ ERROR any use of this value will cause an error
-        //~^ WARN skipping const checks
-        //~| WARN skipping const checks
+        GLOBAL = 99
+        //~^ ERROR could not evaluate static initializer
+        //~| NOTE modifying a static's initial value
     }
 };
 
diff --git a/src/test/ui/consts/miri_unleashed/mutating_global.stderr b/src/test/ui/consts/miri_unleashed/mutating_global.stderr
index dd449d5da35..ba9dd56190a 100644
--- a/src/test/ui/consts/miri_unleashed/mutating_global.stderr
+++ b/src/test/ui/consts/miri_unleashed/mutating_global.stderr
@@ -1,29 +1,9 @@
-warning: skipping const checks
-  --> $DIR/mutating_global.rs:9:9
+error[E0080]: could not evaluate static initializer
+  --> $DIR/mutating_global.rs:10:9
    |
 LL |         GLOBAL = 99
-   |         ^^^^^^
+   |         ^^^^^^^^^^^ modifying a static's initial value from another static's initializer
 
-warning: skipping const checks
-  --> $DIR/mutating_global.rs:9:9
-   |
-LL |         GLOBAL = 99
-   |         ^^^^^^
-
-error: any use of this value will cause an error
-  --> $DIR/mutating_global.rs:9:9
-   |
-LL | / const MUTATING_GLOBAL: () = {
-LL | |     unsafe {
-LL | |         GLOBAL = 99
-   | |         ^^^^^^^^^^^ modifying a static's initial value from another static's initializer
-LL | |
-LL | |
-LL | |     }
-LL | | };
-   | |__-
-   |
-   = note: `#[deny(const_err)]` on by default
-
-error: aborting due to previous error; 2 warnings emitted
+error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/non_const_fn.rs b/src/test/ui/consts/miri_unleashed/non_const_fn.rs
index cfb57d21cee..b401884139d 100644
--- a/src/test/ui/consts/miri_unleashed/non_const_fn.rs
+++ b/src/test/ui/consts/miri_unleashed/non_const_fn.rs
@@ -1,17 +1,13 @@
-// build-fail
 // compile-flags: -Zunleash-the-miri-inside-of-you
 
-#![warn(const_err)]
+#![allow(const_err)]
 
 // A test demonstrating that we prevent calling non-const fn during CTFE.
 
 fn foo() {}
 
-const C: () = foo(); //~ WARN: skipping const checks
-//~^ WARN any use of this value will cause an error
+static C: () = foo(); //~ WARN: skipping const checks
+//~^ ERROR could not evaluate static initializer
+//~| NOTE calling non-const function `foo`
 
-fn main() {
-    println!("{:?}", C);
-    //~^ ERROR: evaluation of constant expression failed
-    //~| WARN: erroneous constant used [const_err]
-}
+fn main() {}
diff --git a/src/test/ui/consts/miri_unleashed/non_const_fn.stderr b/src/test/ui/consts/miri_unleashed/non_const_fn.stderr
index cc31c41164f..d20cd6d6f0b 100644
--- a/src/test/ui/consts/miri_unleashed/non_const_fn.stderr
+++ b/src/test/ui/consts/miri_unleashed/non_const_fn.stderr
@@ -1,35 +1,15 @@
 warning: skipping const checks
-  --> $DIR/non_const_fn.rs:10:15
+  --> $DIR/non_const_fn.rs:9:16
    |
-LL | const C: () = foo();
-   |               ^^^^^
+LL | static C: () = foo();
+   |                ^^^^^
 
-warning: any use of this value will cause an error
-  --> $DIR/non_const_fn.rs:10:15
+error[E0080]: could not evaluate static initializer
+  --> $DIR/non_const_fn.rs:9:16
    |
-LL | const C: () = foo();
-   | --------------^^^^^-
-   |               |
-   |               calling non-const function `foo`
-   |
-note: the lint level is defined here
-  --> $DIR/non_const_fn.rs:4:9
-   |
-LL | #![warn(const_err)]
-   |         ^^^^^^^^^
-
-error[E0080]: evaluation of constant expression failed
-  --> $DIR/non_const_fn.rs:14:22
-   |
-LL |     println!("{:?}", C);
-   |                      ^ referenced constant has errors
-
-warning: erroneous constant used
-  --> $DIR/non_const_fn.rs:14:22
-   |
-LL |     println!("{:?}", C);
-   |                      ^ referenced constant has errors
+LL | static C: () = foo();
+   |                ^^^^^ calling non-const function `foo`
 
-error: aborting due to previous error; 3 warnings emitted
+error: aborting due to previous error; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/foreign-fn-return-lifetime.stderr b/src/test/ui/foreign-fn-return-lifetime.stderr
index 575da18f240..feecb6d80e7 100644
--- a/src/test/ui/foreign-fn-return-lifetime.stderr
+++ b/src/test/ui/foreign-fn-return-lifetime.stderr
@@ -2,9 +2,13 @@ error[E0106]: missing lifetime specifier
   --> $DIR/foreign-fn-return-lifetime.rs:5:19
    |
 LL |     pub fn f() -> &u8;
-   |                   ^ help: consider giving it a 'static lifetime: `&'static`
+   |                   ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     pub fn f() -> &'static u8;
+   |                   ^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr b/src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
index 9f410c0dbbb..1106a067822 100644
--- a/src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
+++ b/src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
@@ -5,16 +5,33 @@ LL | fn should_error<T>() where T : Into<&u32> {}
    |                                     ^ explicit lifetime name needed here
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:19
+  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:21
    |
 LL |     fn foo<'b, L: X<&'b Nested<K>>>();
-   |                   ^^^^^^^^^^^^^^^^ expected lifetime parameter
+   |                     ^ expected named lifetime parameter
+   |
+note: these named lifetimes are available to use
+  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:8:9
+   |
+LL | trait X<'a, K: 'a> {
+   |         ^^
+LL |     fn foo<'b, L: X<&'b Nested<K>>>();
+   |            ^^
+help: consider using one of the available lifetimes here
+   |
+LL |     fn foo<'b, L: X<'lifetime, &'b Nested<K>>>();
+   |                     ^^^^^^^^^^
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:13:15
+  --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:13:17
    |
 LL | fn bar<'b, L: X<&'b Nested<i32>>>(){}
-   |               ^^^^^^^^^^^^^^^^^^ expected lifetime parameter
+   |                 ^ expected named lifetime parameter
+   |
+help: consider using the `'b` lifetime
+   |
+LL | fn bar<'b, L: X<'b, &'b Nested<i32>>>(){}
+   |                 ^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/issues/issue-13497.stderr b/src/test/ui/issues/issue-13497.stderr
index b72f0277052..a231f73d067 100644
--- a/src/test/ui/issues/issue-13497.stderr
+++ b/src/test/ui/issues/issue-13497.stderr
@@ -2,9 +2,13 @@ error[E0106]: missing lifetime specifier
   --> $DIR/issue-13497.rs:2:5
    |
 LL |     &str
-   |     ^ help: consider giving it a 'static lifetime: `&'static`
+   |     ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     &'static str
+   |     ^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/issues/issue-26638.stderr b/src/test/ui/issues/issue-26638.stderr
index 1d8fbdc63c5..3df58d66d1f 100644
--- a/src/test/ui/issues/issue-26638.stderr
+++ b/src/test/ui/issues/issue-26638.stderr
@@ -14,17 +14,25 @@ error[E0106]: missing lifetime specifier
   --> $DIR/issue-26638.rs:4:40
    |
 LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
-   |                                        ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
+   |                                        ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
+help: consider using the `'static` lifetime
+   |
+LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &'static str { iter() }
+   |                                        ^^^^^^^^
 
 error[E0106]: missing lifetime specifier
   --> $DIR/issue-26638.rs:7:22
    |
 LL | fn parse_type_3() -> &str { unimplemented!() }
-   |                      ^ help: consider giving it a 'static lifetime: `&'static`
+   |                      ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL | fn parse_type_3() -> &'static str { unimplemented!() }
+   |                      ^^^^^^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
index 461c1832e9a..5809b5bd661 100644
--- a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
+++ b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
@@ -2,9 +2,13 @@ error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:2:11
    |
 LL | fn f() -> &isize {
-   |           ^ help: consider giving it a 'static lifetime: `&'static`
+   |           ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL | fn f() -> &'static isize {
+   |           ^^^^^^^^
 
 error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:7:33
@@ -34,25 +38,37 @@ error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:21:20
    |
 LL | fn i(_x: isize) -> &isize {
-   |                    ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
+   |                    ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
+help: consider using the `'static` lifetime
+   |
+LL | fn i(_x: isize) -> &'static isize {
+   |                    ^^^^^^^^
 
 error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:34:24
    |
 LL | fn j(_x: StaticStr) -> &isize {
-   |                        ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
+   |                        ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
+help: consider using the `'static` lifetime
+   |
+LL | fn j(_x: StaticStr) -> &'static isize {
+   |                        ^^^^^^^^
 
 error[E0106]: missing lifetime specifier
   --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:40:49
    |
 LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
-   |                                                 ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
+   |                                                 ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
+help: consider using the `'a` lifetime
+   |
+LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize {
+   |                                                 ^^^
 
 error: aborting due to 6 previous errors
 
diff --git a/src/test/ui/specialization/defaultimpl/validation.stderr b/src/test/ui/specialization/defaultimpl/validation.stderr
index 9bf59bd4f63..254eaf51a64 100644
--- a/src/test/ui/specialization/defaultimpl/validation.stderr
+++ b/src/test/ui/specialization/defaultimpl/validation.stderr
@@ -25,13 +25,13 @@ LL | default impl !Send for Z {}
    | default because of this
 
 error[E0750]: negative impls cannot be default impls
-  --> $DIR/validation.rs:10:14
+  --> $DIR/validation.rs:10:1
    |
 LL | default impl !Send for Z {}
    | ^^^^^^^      ^
 
 error[E0750]: negative impls cannot be default impls
-  --> $DIR/validation.rs:14:14
+  --> $DIR/validation.rs:14:1
    |
 LL | default impl !Tr for S {}
    | ^^^^^^^      ^
diff --git a/src/test/ui/suggestions/missing-lifetime-specifier.rs b/src/test/ui/suggestions/missing-lifetime-specifier.rs
new file mode 100644
index 00000000000..b09c1879d70
--- /dev/null
+++ b/src/test/ui/suggestions/missing-lifetime-specifier.rs
@@ -0,0 +1,65 @@
+#![allow(bare_trait_objects)]
+use std::collections::HashMap;
+use std::cell::RefCell;
+
+pub union Foo<'t, 'k> {
+    i: &'t i64,
+    f: &'k f64,
+}
+trait Bar<'t, 'k> {}
+
+pub union Qux<'t, 'k, I> {
+    i: &'t I,
+    f: &'k I,
+}
+trait Tar<'t, 'k, I> {}
+
+thread_local! {
+    static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
+    //~^ ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+}
+thread_local! {
+    static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
+    //~^ ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+    //~| ERROR the lifetime bound for this object type cannot be deduced from context
+    //~| ERROR the lifetime bound for this object type cannot be deduced from context
+}
+thread_local! {
+    static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
+    //~^ ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+}
+thread_local! {
+    static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
+    //~^ ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+    //~| ERROR the lifetime bound for this object type cannot be deduced from context
+    //~| ERROR the lifetime bound for this object type cannot be deduced from context
+}
+
+thread_local! {
+    static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
+    //~^ ERROR wrong number of lifetime arguments: expected 2, found 1
+    //~| ERROR wrong number of lifetime arguments: expected 2, found 1
+    //~| ERROR wrong number of lifetime arguments: expected 2, found 1
+    //~| ERROR wrong number of lifetime arguments: expected 2, found 1
+}
+thread_local! {
+    static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+    //~^ ERROR the lifetime bound for this object type cannot be deduced from context
+    //~| ERROR the lifetime bound for this object type cannot be deduced from context
+    //~| ERROR wrong number of lifetime arguments: expected 2, found 1
+    //~| ERROR wrong number of lifetime arguments: expected 2, found 1
+    //~| ERROR wrong number of lifetime arguments: expected 2, found 1
+    //~| ERROR wrong number of lifetime arguments: expected 2, found 1
+    //~| ERROR missing lifetime specifier
+    //~| ERROR missing lifetime specifier
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/missing-lifetime-specifier.stderr b/src/test/ui/suggestions/missing-lifetime-specifier.stderr
new file mode 100644
index 00000000000..f5ff54cc916
--- /dev/null
+++ b/src/test/ui/suggestions/missing-lifetime-specifier.stderr
@@ -0,0 +1,256 @@
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-specifier.rs:18:44
+   |
+LL |     static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^ expected 2 lifetime parameters
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^^^^^^^^^^^^^^
+
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-specifier.rs:18:44
+   |
+LL |     static a: RefCell<HashMap<i32, Vec<Vec<Foo>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^ expected 2 lifetime parameters
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^^^^^^^^^^^^^^
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-specifier.rs:23:44
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
+   |                                            ^ expected named lifetime parameter
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^
+
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-specifier.rs:23:45
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^ expected 2 lifetime parameters
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^^^^^^^^^^^^^^
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-specifier.rs:23:44
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
+   |                                            ^ expected named lifetime parameter
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^
+
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-specifier.rs:23:45
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^ expected 2 lifetime parameters
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^^^^^^^^^^^^^^
+
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-specifier.rs:32:48
+   |
+LL |     static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
+   |                                                ^ expected 2 lifetime parameters
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                                ^^^^^^^^^^^^^^^^^
+
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-specifier.rs:32:48
+   |
+LL |     static c: RefCell<HashMap<i32, Vec<Vec<Qux<i32>>>>> = RefCell::new(HashMap::new());
+   |                                                ^ expected 2 lifetime parameters
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                                ^^^^^^^^^^^^^^^^^
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-specifier.rs:37:44
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^ expected named lifetime parameter
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^
+
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-specifier.rs:37:49
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                                 ^ expected 2 lifetime parameters
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                                 ^^^^^^^^^^^^^^^^^
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-specifier.rs:37:44
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^ expected named lifetime parameter
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^
+
+error[E0106]: missing lifetime specifiers
+  --> $DIR/missing-lifetime-specifier.rs:37:49
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                                 ^ expected 2 lifetime parameters
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                                 ^^^^^^^^^^^^^^^^^
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-specifier.rs:54:44
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^ expected named lifetime parameter
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^
+
+error[E0106]: missing lifetime specifier
+  --> $DIR/missing-lifetime-specifier.rs:54:44
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^ expected named lifetime parameter
+   |
+   = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^
+
+error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
+  --> $DIR/missing-lifetime-specifier.rs:23:45
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^
+
+error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
+  --> $DIR/missing-lifetime-specifier.rs:23:45
+   |
+LL |     static b: RefCell<HashMap<i32, Vec<Vec<&Bar>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^
+
+error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
+  --> $DIR/missing-lifetime-specifier.rs:37:45
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^
+
+error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
+  --> $DIR/missing-lifetime-specifier.rs:37:45
+   |
+LL |     static d: RefCell<HashMap<i32, Vec<Vec<&Tar<i32>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^
+
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+  --> $DIR/missing-lifetime-specifier.rs:47:44
+   |
+LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
+
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+  --> $DIR/missing-lifetime-specifier.rs:47:44
+   |
+LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
+
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+  --> $DIR/missing-lifetime-specifier.rs:47:44
+   |
+LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
+
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+  --> $DIR/missing-lifetime-specifier.rs:47:44
+   |
+LL |     static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                            ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
+
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+  --> $DIR/missing-lifetime-specifier.rs:54:45
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
+
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+  --> $DIR/missing-lifetime-specifier.rs:54:45
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
+
+error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
+  --> $DIR/missing-lifetime-specifier.rs:54:45
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^^^^^^^^^^
+
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+  --> $DIR/missing-lifetime-specifier.rs:54:45
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
+
+error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
+  --> $DIR/missing-lifetime-specifier.rs:54:45
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^^^^^^^^^^
+
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
+  --> $DIR/missing-lifetime-specifier.rs:54:45
+   |
+LL |     static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
+   |                                             ^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
+
+error: aborting due to 28 previous errors
+
+Some errors have detailed explanations: E0106, E0107.
+For more information about an error, try `rustc --explain E0106`.
diff --git a/src/test/ui/suggestions/return-without-lifetime.stderr b/src/test/ui/suggestions/return-without-lifetime.stderr
index ce3b1748da4..2a237d61f50 100644
--- a/src/test/ui/suggestions/return-without-lifetime.stderr
+++ b/src/test/ui/suggestions/return-without-lifetime.stderr
@@ -2,23 +2,36 @@ error[E0106]: missing lifetime specifier
   --> $DIR/return-without-lifetime.rs:2:16
    |
 LL | struct Foo<'a>(&usize);
-   |                ^ help: consider using the named lifetime: `&'a`
+   |                ^ expected named lifetime parameter
+   |
+help: consider using the `'a` lifetime
+   |
+LL | struct Foo<'a>(&'a usize);
+   |                ^^^
 
 error[E0106]: missing lifetime specifier
   --> $DIR/return-without-lifetime.rs:5:34
    |
 LL | fn func1<'a>(_arg: &'a Thing) -> &() { unimplemented!() }
-   |                    ---------     ^ help: consider using the named lifetime: `&'a`
+   |                    ---------     ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of `_arg`'s 2 lifetimes it is borrowed from
+help: consider using the `'a` lifetime
+   |
+LL | fn func1<'a>(_arg: &'a Thing) -> &'a () { unimplemented!() }
+   |                                  ^^^
 
 error[E0106]: missing lifetime specifier
   --> $DIR/return-without-lifetime.rs:7:35
    |
 LL | fn func2<'a>(_arg: &Thing<'a>) -> &() { unimplemented!() }
-   |                    ----------     ^ help: consider using the named lifetime: `&'a`
+   |                    ----------     ^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but the signature does not say which one of `_arg`'s 2 lifetimes it is borrowed from
+help: consider using the `'a` lifetime
+   |
+LL | fn func2<'a>(_arg: &Thing<'a>) -> &'a () { unimplemented!() }
+   |                                   ^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/traits/negative-impls/negative-default-impls.stderr b/src/test/ui/traits/negative-impls/negative-default-impls.stderr
index d2423d01a9a..a70bbe6b948 100644
--- a/src/test/ui/traits/negative-impls/negative-default-impls.stderr
+++ b/src/test/ui/traits/negative-impls/negative-default-impls.stderr
@@ -1,5 +1,5 @@
 error[E0750]: negative impls cannot be default impls
-  --> $DIR/negative-default-impls.rs:8:14
+  --> $DIR/negative-default-impls.rs:8:1
    |
 LL | default impl !MyTrait for u32 {}
    | ^^^^^^^      ^
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr b/src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr
index 7af9c57a830..b824d160d71 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr
@@ -2,7 +2,7 @@ error[E0658]: parenthetical notation is only stable when used with `Fn`-family t
   --> $DIR/unboxed-closure-feature-gate.rs:13:20
    |
 LL |     let x: Box<dyn Foo(isize)>;
-   |                    ^^^
+   |                    ^^^^^^^^^^
    |
    = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
    = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr
index 9a3bdd2bd5e..9da36906d55 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr
@@ -2,7 +2,7 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
   --> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:3:17
    |
 LL | fn bar1(x: &dyn Fn<(), Output=()>) {
-   |                 ^^ help: use parenthetical notation instead: `Fn() -> ()`
+   |                 ^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn() -> ()`
    |
    = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
    = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
@@ -11,7 +11,7 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje
   --> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:7:28
    |
 LL | fn bar2<T>(x: &T) where T: Fn<()> {
-   |                            ^^ help: use parenthetical notation instead: `Fn() -> ()`
+   |                            ^^^^^^ help: use parenthetical notation instead: `Fn() -> ()`
    |
    = note: see issue #29625 <https://github.com/rust-lang/rust/issues/29625> for more information
    = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr
index b92f054498b..e9d51983a7a 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr
@@ -2,7 +2,7 @@ error[E0107]: wrong number of lifetime arguments: expected 1, found 0
   --> $DIR/unboxed-closure-sugar-region.rs:30:51
    |
 LL | fn test2(x: &dyn Foo<(isize,),Output=()>, y: &dyn Foo(isize)) {
-   |                                                   ^^^ expected 1 lifetime argument
+   |                                                   ^^^^^^^^^^ expected 1 lifetime argument
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr
index f482098cbff..f42ac38d370 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr
@@ -2,7 +2,7 @@ error[E0107]: wrong number of type arguments: expected 3, found 1
   --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:5:16
    |
 LL | fn foo(_: &dyn Three())
-   |                ^^^^^ expected 3 type arguments
+   |                ^^^^^^^ expected 3 type arguments
 
 error[E0220]: associated type `Output` not found for `Three<(), [type error], [type error]>`
   --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:5:16
diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
index ada4551baef..594cdd245b3 100644
--- a/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
+++ b/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
@@ -14,15 +14,24 @@ error[E0106]: missing lifetime specifier
   --> $DIR/underscore-lifetime-binders.rs:2:17
    |
 LL | struct Baz<'a>(&'_ &'a u8);
-   |                 ^^ help: consider using the named lifetime: `'a`
+   |                 ^^ expected named lifetime parameter
+   |
+help: consider using the `'a` lifetime
+   |
+LL | struct Baz<'a>(&'a &'a u8);
+   |                 ^^
 
 error[E0106]: missing lifetime specifier
   --> $DIR/underscore-lifetime-binders.rs:10:33
    |
 LL | fn meh() -> Box<dyn for<'_> Meh<'_>>
-   |                                 ^^ help: consider giving it a 'static lifetime: `'static`
+   |                                 ^^ expected named lifetime parameter
    |
    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
+help: consider using the `'static` lifetime
+   |
+LL | fn meh() -> Box<dyn for<'_> Meh<'static>>
+   |                                 ^^^^^^^
 
 error[E0106]: missing lifetime specifier
   --> $DIR/underscore-lifetime-binders.rs:16:35
diff --git a/src/test/ui/unspecified-self-in-trait-ref.stderr b/src/test/ui/unspecified-self-in-trait-ref.stderr
index e057a7842b2..9310b3d7ede 100644
--- a/src/test/ui/unspecified-self-in-trait-ref.stderr
+++ b/src/test/ui/unspecified-self-in-trait-ref.stderr
@@ -31,7 +31,7 @@ LL | | }
    | |_- type parameter `A` must be specified for this
 ...
 LL |       let e = Bar::<usize>::lol();
-   |               ^^^ missing reference to `A`
+   |               ^^^^^^^^^^^^^^^^^ missing reference to `A`
    |
    = note: because of the default `Self` reference, type parameters must be specified on object types