about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorEmil Gardström <emil.gardstrom@gmail.com>2022-04-24 14:08:23 +0200
committerEmil Gardström <emil.gardstrom@gmail.com>2022-04-24 18:33:06 +0200
commit8b8f6653cfd54525714f02efe7af0a0f830e185c (patch)
tree08350f3a61cde865ec0fa0ca084b874e88a389f3 /src/test/ui
parentd8e59edbfa47ff38e23e6dedab6bedd3b41895e0 (diff)
downloadrust-8b8f6653cfd54525714f02efe7af0a0f830e185c.tar.gz
rust-8b8f6653cfd54525714f02efe7af0a0f830e185c.zip
add `DefId` to unsafety violations and display function path in E0133
this enables consumers to access the function definition that was reported to be unsafe
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr16
-rw-r--r--src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs8
-rw-r--r--src/test/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr8
-rw-r--r--src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr4
-rw-r--r--src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr4
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr8
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs4
-rw-r--r--src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.thir.stderr4
-rw-r--r--src/test/ui/error-codes/E0133.mir.stderr4
-rw-r--r--src/test/ui/error-codes/E0133.thir.stderr4
-rw-r--r--src/test/ui/foreign-unsafe-fn-called.mir.stderr4
-rw-r--r--src/test/ui/foreign-unsafe-fn-called.rs2
-rw-r--r--src/test/ui/foreign-unsafe-fn-called.thir.stderr4
-rw-r--r--src/test/ui/intrinsics/unchecked_math_unsafe.mir.stderr12
-rw-r--r--src/test/ui/intrinsics/unchecked_math_unsafe.thir.stderr12
-rw-r--r--src/test/ui/issues/issue-28776.mir.stderr4
-rw-r--r--src/test/ui/issues/issue-28776.thir.stderr4
-rw-r--r--src/test/ui/issues/issue-3080.mir.stderr4
-rw-r--r--src/test/ui/issues/issue-3080.thir.stderr4
-rw-r--r--src/test/ui/issues/issue-5844.mir.stderr4
-rw-r--r--src/test/ui/issues/issue-5844.thir.stderr4
-rw-r--r--src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.mir.stderr40
-rw-r--r--src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs20
-rw-r--r--src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.thir.stderr40
-rw-r--r--src/test/ui/threads-sendsync/issue-43733.mir.stderr10
-rw-r--r--src/test/ui/threads-sendsync/issue-43733.rs7
-rw-r--r--src/test/ui/threads-sendsync/issue-43733.thir.stderr10
-rw-r--r--src/test/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs1
-rw-r--r--src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr16
-rw-r--r--src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs8
-rw-r--r--src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr16
-rw-r--r--src/test/ui/unsafe/unsafe-const-fn.mir.stderr4
-rw-r--r--src/test/ui/unsafe/unsafe-const-fn.thir.stderr4
-rw-r--r--src/test/ui/unsafe/unsafe-fn-called-from-safe.mir.stderr4
-rw-r--r--src/test/ui/unsafe/unsafe-fn-called-from-safe.rs2
-rw-r--r--src/test/ui/unsafe/unsafe-fn-called-from-safe.thir.stderr4
-rw-r--r--src/test/ui/unsafe/unsafe-fn-used-as-value.mir.stderr4
-rw-r--r--src/test/ui/unsafe/unsafe-fn-used-as-value.rs2
-rw-r--r--src/test/ui/unsafe/unsafe-fn-used-as-value.thir.stderr4
39 files changed, 160 insertions, 158 deletions
diff --git a/src/test/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr b/src/test/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr
index d22413beecb..b094aa198e8 100644
--- a/src/test/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr
+++ b/src/test/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr
@@ -1,32 +1,32 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `S::f` is unsafe and requires unsafe function or block
   --> $DIR/async-unsafe-fn-call-in-safe.rs:14:5
    |
 LL |     S::f();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `S::f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/async-unsafe-fn-call-in-safe.rs:15:5
    |
 LL |     f();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `S::f` is unsafe and requires unsafe function or block
   --> $DIR/async-unsafe-fn-call-in-safe.rs:19:5
    |
 LL |     S::f();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `S::f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/async-unsafe-fn-call-in-safe.rs:20:5
    |
 LL |     f();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs b/src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs
index fc37822cb7b..2605905ff76 100644
--- a/src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs
+++ b/src/test/ui/async-await/async-unsafe-fn-call-in-safe.rs
@@ -11,11 +11,11 @@ impl S {
 async unsafe fn f() {}
 
 async fn g() {
-    S::f(); //~ ERROR call to unsafe function is unsafe
-    f(); //~ ERROR call to unsafe function is unsafe
+    S::f(); //~ ERROR call to unsafe function `S::f` is unsafe
+    f(); //~ ERROR call to unsafe function `f` is unsafe
 }
 
 fn main() {
-    S::f(); //[mir]~ ERROR call to unsafe function is unsafe
-    f(); //[mir]~ ERROR call to unsafe function is unsafe
+    S::f(); //[mir]~ ERROR call to unsafe function `S::f` is unsafe
+    f(); //[mir]~ ERROR call to unsafe function `f` is unsafe
 }
diff --git a/src/test/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr b/src/test/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr
index 21ba45d7f1e..3d57ca5f55e 100644
--- a/src/test/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr
+++ b/src/test/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr
@@ -1,16 +1,16 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `S::f` is unsafe and requires unsafe function or block
   --> $DIR/async-unsafe-fn-call-in-safe.rs:14:5
    |
 LL |     S::f();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `S::f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/async-unsafe-fn-call-in-safe.rs:15:5
    |
 LL |     f();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr b/src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr
index a60100ddaea..9a43711a4f0 100644
--- a/src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr
+++ b/src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `std::pin::Pin::<P>::new_unchecked` is unsafe and requires unsafe function or block
   --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:5:31
    |
 LL |     let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); };
-   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `std::pin::Pin::<P>::new_unchecked`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr b/src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr
index a60100ddaea..9405f6a8e9e 100644
--- a/src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr
+++ b/src/test/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `Pin::<P>::new_unchecked` is unsafe and requires unsafe function or block
   --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:5:31
    |
 LL |     let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); };
-   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `Pin::<P>::new_unchecked`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr
index 33014a1500c..bedb934ab1c 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr
@@ -1,16 +1,16 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block
   --> $DIR/const-extern-fn-requires-unsafe.rs:9:17
    |
 LL |     let a: [u8; foo()];
-   |                 ^^^^^ call to unsafe function
+   |                 ^^^^^ call to unsafe function `foo`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block
   --> $DIR/const-extern-fn-requires-unsafe.rs:11:5
    |
 LL |     foo();
-   |     ^^^^^ call to unsafe function
+   |     ^^^^^ call to unsafe function `foo`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
index 031e67a1e3c..b4cf729703a 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs
@@ -7,7 +7,7 @@ const unsafe extern "C" fn foo() -> usize { 5 }
 
 fn main() {
     let a: [u8; foo()];
-    //~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
+    //~^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block
     foo();
-    //[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
+    //[mir]~^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block
 }
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.thir.stderr b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.thir.stderr
index c6077da768b..f5361f355e1 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.thir.stderr
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block
   --> $DIR/const-extern-fn-requires-unsafe.rs:9:17
    |
 LL |     let a: [u8; foo()];
-   |                 ^^^^^ call to unsafe function
+   |                 ^^^^^ call to unsafe function `foo`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/error-codes/E0133.mir.stderr b/src/test/ui/error-codes/E0133.mir.stderr
index b11d5e2c2fc..7d6dc0c7f09 100644
--- a/src/test/ui/error-codes/E0133.mir.stderr
+++ b/src/test/ui/error-codes/E0133.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/E0133.rs:7:5
    |
 LL |     f();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/error-codes/E0133.thir.stderr b/src/test/ui/error-codes/E0133.thir.stderr
index b11d5e2c2fc..7d6dc0c7f09 100644
--- a/src/test/ui/error-codes/E0133.thir.stderr
+++ b/src/test/ui/error-codes/E0133.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/E0133.rs:7:5
    |
 LL |     f();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/foreign-unsafe-fn-called.mir.stderr b/src/test/ui/foreign-unsafe-fn-called.mir.stderr
index d3cf5d84fdd..cb5252361d3 100644
--- a/src/test/ui/foreign-unsafe-fn-called.mir.stderr
+++ b/src/test/ui/foreign-unsafe-fn-called.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `test::free` is unsafe and requires unsafe function or block
   --> $DIR/foreign-unsafe-fn-called.rs:11:5
    |
 LL |     test::free();
-   |     ^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^ call to unsafe function `test::free`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/foreign-unsafe-fn-called.rs b/src/test/ui/foreign-unsafe-fn-called.rs
index de3de286fc9..cd084a1620a 100644
--- a/src/test/ui/foreign-unsafe-fn-called.rs
+++ b/src/test/ui/foreign-unsafe-fn-called.rs
@@ -9,5 +9,5 @@ mod test {
 
 fn main() {
     test::free();
-    //~^ ERROR call to unsafe function is unsafe
+    //~^ ERROR call to unsafe function `test::free` is unsafe
 }
diff --git a/src/test/ui/foreign-unsafe-fn-called.thir.stderr b/src/test/ui/foreign-unsafe-fn-called.thir.stderr
index d3cf5d84fdd..cb5252361d3 100644
--- a/src/test/ui/foreign-unsafe-fn-called.thir.stderr
+++ b/src/test/ui/foreign-unsafe-fn-called.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `test::free` is unsafe and requires unsafe function or block
   --> $DIR/foreign-unsafe-fn-called.rs:11:5
    |
 LL |     test::free();
-   |     ^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^ call to unsafe function `test::free`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/intrinsics/unchecked_math_unsafe.mir.stderr b/src/test/ui/intrinsics/unchecked_math_unsafe.mir.stderr
index 26b2f9f2713..e67e81cdc4e 100644
--- a/src/test/ui/intrinsics/unchecked_math_unsafe.mir.stderr
+++ b/src/test/ui/intrinsics/unchecked_math_unsafe.mir.stderr
@@ -1,24 +1,24 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `std::intrinsics::unchecked_add` is unsafe and requires unsafe function or block
   --> $DIR/unchecked_math_unsafe.rs:8:15
    |
 LL |     let add = std::intrinsics::unchecked_add(x, y);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `std::intrinsics::unchecked_add`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `std::intrinsics::unchecked_sub` is unsafe and requires unsafe function or block
   --> $DIR/unchecked_math_unsafe.rs:9:15
    |
 LL |     let sub = std::intrinsics::unchecked_sub(x, y);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `std::intrinsics::unchecked_sub`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `std::intrinsics::unchecked_mul` is unsafe and requires unsafe function or block
   --> $DIR/unchecked_math_unsafe.rs:10:15
    |
 LL |     let mul = std::intrinsics::unchecked_mul(x, y);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `std::intrinsics::unchecked_mul`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/intrinsics/unchecked_math_unsafe.thir.stderr b/src/test/ui/intrinsics/unchecked_math_unsafe.thir.stderr
index 26b2f9f2713..50aaef8694f 100644
--- a/src/test/ui/intrinsics/unchecked_math_unsafe.thir.stderr
+++ b/src/test/ui/intrinsics/unchecked_math_unsafe.thir.stderr
@@ -1,24 +1,24 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `unchecked_add` is unsafe and requires unsafe function or block
   --> $DIR/unchecked_math_unsafe.rs:8:15
    |
 LL |     let add = std::intrinsics::unchecked_add(x, y);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `unchecked_add`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `unchecked_sub` is unsafe and requires unsafe function or block
   --> $DIR/unchecked_math_unsafe.rs:9:15
    |
 LL |     let sub = std::intrinsics::unchecked_sub(x, y);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `unchecked_sub`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `unchecked_mul` is unsafe and requires unsafe function or block
   --> $DIR/unchecked_math_unsafe.rs:10:15
    |
 LL |     let mul = std::intrinsics::unchecked_mul(x, y);
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `unchecked_mul`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/issues/issue-28776.mir.stderr b/src/test/ui/issues/issue-28776.mir.stderr
index 1d470fb5e0f..bb82a0f4c60 100644
--- a/src/test/ui/issues/issue-28776.mir.stderr
+++ b/src/test/ui/issues/issue-28776.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `std::ptr::write` is unsafe and requires unsafe function or block
   --> $DIR/issue-28776.rs:7:5
    |
 LL |     (&ptr::write)(1 as *mut _, 42);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `std::ptr::write`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/issues/issue-28776.thir.stderr b/src/test/ui/issues/issue-28776.thir.stderr
index 1d470fb5e0f..bb82a0f4c60 100644
--- a/src/test/ui/issues/issue-28776.thir.stderr
+++ b/src/test/ui/issues/issue-28776.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `std::ptr::write` is unsafe and requires unsafe function or block
   --> $DIR/issue-28776.rs:7:5
    |
 LL |     (&ptr::write)(1 as *mut _, 42);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `std::ptr::write`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/issues/issue-3080.mir.stderr b/src/test/ui/issues/issue-3080.mir.stderr
index f395c30b815..b1401b9d393 100644
--- a/src/test/ui/issues/issue-3080.mir.stderr
+++ b/src/test/ui/issues/issue-3080.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `X::with` is unsafe and requires unsafe function or block
   --> $DIR/issue-3080.rs:10:5
    |
 LL |     X(()).with();
-   |     ^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^ call to unsafe function `X::with`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/issues/issue-3080.thir.stderr b/src/test/ui/issues/issue-3080.thir.stderr
index f395c30b815..b1401b9d393 100644
--- a/src/test/ui/issues/issue-3080.thir.stderr
+++ b/src/test/ui/issues/issue-3080.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `X::with` is unsafe and requires unsafe function or block
   --> $DIR/issue-3080.rs:10:5
    |
 LL |     X(()).with();
-   |     ^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^ call to unsafe function `X::with`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/issues/issue-5844.mir.stderr b/src/test/ui/issues/issue-5844.mir.stderr
index 6134d6889ff..a4141495fa0 100644
--- a/src/test/ui/issues/issue-5844.mir.stderr
+++ b/src/test/ui/issues/issue-5844.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `issue_5844_aux::rand` is unsafe and requires unsafe function or block
   --> $DIR/issue-5844.rs:8:5
    |
 LL |     issue_5844_aux::rand();
-   |     ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `issue_5844_aux::rand`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/issues/issue-5844.thir.stderr b/src/test/ui/issues/issue-5844.thir.stderr
index 6134d6889ff..0e28e42b928 100644
--- a/src/test/ui/issues/issue-5844.thir.stderr
+++ b/src/test/ui/issues/issue-5844.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `rand` is unsafe and requires unsafe function or block
   --> $DIR/issue-5844.rs:8:5
    |
 LL |     issue_5844_aux::rand();
-   |     ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `rand`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.mir.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.mir.stderr
index 79273a1dcbf..38d45105679 100644
--- a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.mir.stderr
+++ b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.mir.stderr
@@ -1,80 +1,80 @@
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:23:5
    |
 LL |     sse2();
-   |     ^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^ call to function `sse2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:24:5
    |
 LL |     avx_bmi2();
-   |     ^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^ call to function `avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:25:5
    |
 LL |     Quux.avx_bmi2();
-   |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^^^^^^ call to function `Quux::avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:30:5
    |
 LL |     avx_bmi2();
-   |     ^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^ call to function `avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:31:5
    |
 LL |     Quux.avx_bmi2();
-   |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^^^^^^ call to function `Quux::avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:36:5
    |
 LL |     sse2();
-   |     ^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^ call to function `sse2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:37:5
    |
 LL |     avx_bmi2();
-   |     ^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^ call to function `avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:38:5
    |
 LL |     Quux.avx_bmi2();
-   |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^^^^^^ call to function `Quux::avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:44:5
    |
 LL |     sse2();
-   |     ^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^ call to function `sse2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:47:18
    |
 LL | const name: () = sse2();
-   |                  ^^^^^^ call to function with `#[target_feature]`
+   |                  ^^^^^^ call to function `sse2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
index de0b89f46ba..ec10fca96f9 100644
--- a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
+++ b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs
@@ -20,30 +20,30 @@ impl Quux {
 }
 
 fn foo() {
-    sse2();              //~ ERROR call to function with `#[target_feature]` is unsafe
-    avx_bmi2();          //~ ERROR call to function with `#[target_feature]` is unsafe
-    Quux.avx_bmi2();     //~ ERROR call to function with `#[target_feature]` is unsafe
+    sse2();              //~ ERROR call to function `sse2` with `#[target_feature]` is unsafe
+    avx_bmi2();          //~ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
+    Quux.avx_bmi2();     //~ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
 }
 
 #[target_feature(enable = "sse2")]
 fn bar() {
-    avx_bmi2();          //~ ERROR call to function with `#[target_feature]` is unsafe
-    Quux.avx_bmi2();     //~ ERROR call to function with `#[target_feature]` is unsafe
+    avx_bmi2();          //~ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
+    Quux.avx_bmi2();     //~ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
 }
 
 #[target_feature(enable = "avx")]
 fn baz() {
-    sse2();              //~ ERROR call to function with `#[target_feature]` is unsafe
-    avx_bmi2();          //~ ERROR call to function with `#[target_feature]` is unsafe
-    Quux.avx_bmi2();     //~ ERROR call to function with `#[target_feature]` is unsafe
+    sse2();              //~ ERROR call to function `sse2` with `#[target_feature]` is unsafe
+    avx_bmi2();          //~ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe
+    Quux.avx_bmi2();     //~ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe
 }
 
 #[target_feature(enable = "avx")]
 #[target_feature(enable = "bmi2")]
 fn qux() {
-    sse2();              //~ ERROR call to function with `#[target_feature]` is unsafe
+    sse2();              //~ ERROR call to function `sse2` with `#[target_feature]` is unsafe
 }
 
-const name: () = sse2(); //~ ERROR call to function with `#[target_feature]` is unsafe
+const name: () = sse2(); //~ ERROR call to function `sse2` with `#[target_feature]` is unsafe
 
 fn main() {}
diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.thir.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.thir.stderr
index 79273a1dcbf..38d45105679 100644
--- a/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.thir.stderr
+++ b/src/test/ui/rfcs/rfc-2396-target_feature-11/safe-calls.thir.stderr
@@ -1,80 +1,80 @@
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:23:5
    |
 LL |     sse2();
-   |     ^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^ call to function `sse2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:24:5
    |
 LL |     avx_bmi2();
-   |     ^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^ call to function `avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:25:5
    |
 LL |     Quux.avx_bmi2();
-   |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^^^^^^ call to function `Quux::avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:30:5
    |
 LL |     avx_bmi2();
-   |     ^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^ call to function `avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:31:5
    |
 LL |     Quux.avx_bmi2();
-   |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^^^^^^ call to function `Quux::avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:36:5
    |
 LL |     sse2();
-   |     ^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^ call to function `sse2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:37:5
    |
 LL |     avx_bmi2();
-   |     ^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^ call to function `avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:38:5
    |
 LL |     Quux.avx_bmi2();
-   |     ^^^^^^^^^^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^^^^^^^^^^ call to function `Quux::avx_bmi2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:44:5
    |
 LL |     sse2();
-   |     ^^^^^^ call to function with `#[target_feature]`
+   |     ^^^^^^ call to function `sse2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
-error[E0133]: call to function with `#[target_feature]` is unsafe and requires unsafe function or block
+error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block
   --> $DIR/safe-calls.rs:47:18
    |
 LL | const name: () = sse2();
-   |                  ^^^^^^ call to function with `#[target_feature]`
+   |                  ^^^^^^ call to function `sse2` with `#[target_feature]`
    |
    = note: can only be called if the required target features are available
 
diff --git a/src/test/ui/threads-sendsync/issue-43733.mir.stderr b/src/test/ui/threads-sendsync/issue-43733.mir.stderr
index 8dc0e75f1af..897a0e45911 100644
--- a/src/test/ui/threads-sendsync/issue-43733.mir.stderr
+++ b/src/test/ui/threads-sendsync/issue-43733.mir.stderr
@@ -1,16 +1,16 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `std::thread::__FastLocalKeyInner::<T>::get` is unsafe and requires unsafe function or block
   --> $DIR/issue-43733.rs:19:5
    |
 LL |     __KEY.get(Default::default)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `std::thread::__FastLocalKeyInner::<T>::get`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/issue-43733.rs:22:42
+error[E0133]: call to unsafe function `std::thread::LocalKey::<T>::new` is unsafe and requires unsafe function or block
+  --> $DIR/issue-43733.rs:24:42
    |
 LL | static FOO: std::thread::LocalKey<Foo> = std::thread::LocalKey::new(__getit);
-   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `std::thread::LocalKey::<T>::new`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/threads-sendsync/issue-43733.rs b/src/test/ui/threads-sendsync/issue-43733.rs
index 9926ed09bb4..f5e10ec4ecb 100644
--- a/src/test/ui/threads-sendsync/issue-43733.rs
+++ b/src/test/ui/threads-sendsync/issue-43733.rs
@@ -16,11 +16,14 @@ static __KEY: std::thread::__FastLocalKeyInner<Foo> = std::thread::__FastLocalKe
 static __KEY: std::thread::__OsLocalKeyInner<Foo> = std::thread::__OsLocalKeyInner::new();
 
 fn __getit(_: Option<&mut Option<RefCell<String>>>) -> std::option::Option<&'static Foo> {
-    __KEY.get(Default::default) //~ ERROR call to unsafe function is unsafe
+    __KEY.get(Default::default)
+    //[mir]~^ ERROR call to unsafe function `std::thread::__FastLocalKeyInner::<T>::get` is unsafe
+    //[thir]~^^ ERROR call to unsafe function `__FastLocalKeyInner::<T>::get` is unsafe
 }
 
 static FOO: std::thread::LocalKey<Foo> = std::thread::LocalKey::new(__getit);
-//~^ ERROR call to unsafe function is unsafe
+//[mir]~^ ERROR call to unsafe function `std::thread::LocalKey::<T>::new` is unsafe
+//[thir]~^^ ERROR call to unsafe function `LocalKey::<T>::new` is unsafe
 
 fn main() {
     FOO.with(|foo| println!("{}", foo.borrow()));
diff --git a/src/test/ui/threads-sendsync/issue-43733.thir.stderr b/src/test/ui/threads-sendsync/issue-43733.thir.stderr
index 8dc0e75f1af..98f46c90ce0 100644
--- a/src/test/ui/threads-sendsync/issue-43733.thir.stderr
+++ b/src/test/ui/threads-sendsync/issue-43733.thir.stderr
@@ -1,16 +1,16 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `__FastLocalKeyInner::<T>::get` is unsafe and requires unsafe function or block
   --> $DIR/issue-43733.rs:19:5
    |
 LL |     __KEY.get(Default::default)
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `__FastLocalKeyInner::<T>::get`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/issue-43733.rs:22:42
+error[E0133]: call to unsafe function `LocalKey::<T>::new` is unsafe and requires unsafe function or block
+  --> $DIR/issue-43733.rs:24:42
    |
 LL | static FOO: std::thread::LocalKey<Foo> = std::thread::LocalKey::new(__getit);
-   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function `LocalKey::<T>::new`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs b/src/test/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs
index 8baef433410..84704a21137 100644
--- a/src/test/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs
+++ b/src/test/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs
@@ -1,7 +1,6 @@
 // run-pass
 // no-prefer-dynamic
 // ignore-emscripten no threads support
-
 static mut HIT: bool = false;
 
 struct Foo;
diff --git a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
index 163c101772c..23d7a8bb17a 100644
--- a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
+++ b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
@@ -1,8 +1,8 @@
-error: call to unsafe function is unsafe and requires unsafe block (error E0133)
+error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133)
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:12:5
    |
 LL |     unsf();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `unsf`
    |
 note: the lint level is defined here
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9
@@ -39,11 +39,11 @@ note: the lint level is defined here
 LL | #![deny(unused_unsafe)]
    |         ^^^^^^^^^^^^^
 
-error: call to unsafe function is unsafe and requires unsafe block (error E0133)
+error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133)
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:27:5
    |
 LL |     unsf();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `unsf`
    |
 note: the lint level is defined here
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:25:8
@@ -113,19 +113,19 @@ note: the lint level is defined here
 LL |     #[allow(unsafe_op_in_unsafe_fn)]
    |             ^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe block
+error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:76:5
    |
 LL |     unsf();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `unsf`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe function or block
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:80:9
    |
 LL |         unsf();
-   |         ^^^^^^ call to unsafe function
+   |         ^^^^^^ call to unsafe function `unsf`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs
index 7ca714b85c2..aedb27a38da 100644
--- a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs
+++ b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs
@@ -10,7 +10,7 @@ static mut VOID: () = ();
 
 unsafe fn deny_level() {
     unsf();
-    //~^ ERROR call to unsafe function is unsafe and requires unsafe block
+    //~^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block
     *PTR;
     //~^ ERROR dereference of raw pointer is unsafe and requires unsafe block
     VOID = ();
@@ -25,7 +25,7 @@ unsafe fn deny_level() {
 #[deny(warnings)]
 unsafe fn warning_level() {
     unsf();
-    //~^ ERROR call to unsafe function is unsafe and requires unsafe block
+    //~^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block
     *PTR;
     //~^ ERROR dereference of raw pointer is unsafe and requires unsafe block
     VOID = ();
@@ -74,10 +74,10 @@ unsafe fn nested_allow_level() {
 
 fn main() {
     unsf();
-    //~^ ERROR call to unsafe function is unsafe and requires unsafe block
+    //~^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block
     #[allow(unsafe_op_in_unsafe_fn)]
     {
         unsf();
-        //~^ ERROR call to unsafe function is unsafe and requires unsafe function or block
+        //~^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe function or block
     }
 }
diff --git a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
index ad87690bb52..35243e7687e 100644
--- a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
+++ b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
@@ -1,8 +1,8 @@
-error: call to unsafe function is unsafe and requires unsafe block (error E0133)
+error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133)
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:12:5
    |
 LL |     unsf();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `unsf`
    |
 note: the lint level is defined here
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9
@@ -39,11 +39,11 @@ note: the lint level is defined here
 LL | #![deny(unused_unsafe)]
    |         ^^^^^^^^^^^^^
 
-error: call to unsafe function is unsafe and requires unsafe block (error E0133)
+error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133)
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:27:5
    |
 LL |     unsf();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `unsf`
    |
 note: the lint level is defined here
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:25:8
@@ -101,19 +101,19 @@ LL | unsafe fn nested_allow_level() {
 LL |         unsafe { unsf() }
    |         ^^^^^^ unnecessary `unsafe` block
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe block
+error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:76:5
    |
 LL |     unsf();
-   |     ^^^^^^ call to unsafe function
+   |     ^^^^^^ call to unsafe function `unsf`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe function or block
   --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:80:9
    |
 LL |         unsf();
-   |         ^^^^^^ call to unsafe function
+   |         ^^^^^^ call to unsafe function `unsf`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/unsafe/unsafe-const-fn.mir.stderr b/src/test/ui/unsafe/unsafe-const-fn.mir.stderr
index 3031be720f0..6c6879f3a8b 100644
--- a/src/test/ui/unsafe/unsafe-const-fn.mir.stderr
+++ b/src/test/ui/unsafe/unsafe-const-fn.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `dummy` is unsafe and requires unsafe function or block
   --> $DIR/unsafe-const-fn.rs:10:18
    |
 LL | const VAL: u32 = dummy(0xFFFF);
-   |                  ^^^^^^^^^^^^^ call to unsafe function
+   |                  ^^^^^^^^^^^^^ call to unsafe function `dummy`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/unsafe/unsafe-const-fn.thir.stderr b/src/test/ui/unsafe/unsafe-const-fn.thir.stderr
index 3031be720f0..6c6879f3a8b 100644
--- a/src/test/ui/unsafe/unsafe-const-fn.thir.stderr
+++ b/src/test/ui/unsafe/unsafe-const-fn.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `dummy` is unsafe and requires unsafe function or block
   --> $DIR/unsafe-const-fn.rs:10:18
    |
 LL | const VAL: u32 = dummy(0xFFFF);
-   |                  ^^^^^^^^^^^^^ call to unsafe function
+   |                  ^^^^^^^^^^^^^ call to unsafe function `dummy`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/unsafe/unsafe-fn-called-from-safe.mir.stderr b/src/test/ui/unsafe/unsafe-fn-called-from-safe.mir.stderr
index 1d6fa4cbf40..0abe86489eb 100644
--- a/src/test/ui/unsafe/unsafe-fn-called-from-safe.mir.stderr
+++ b/src/test/ui/unsafe/unsafe-fn-called-from-safe.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/unsafe-fn-called-from-safe.rs:7:5
    |
 LL |     f();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/unsafe/unsafe-fn-called-from-safe.rs b/src/test/ui/unsafe/unsafe-fn-called-from-safe.rs
index df12e441516..37b5c92587c 100644
--- a/src/test/ui/unsafe/unsafe-fn-called-from-safe.rs
+++ b/src/test/ui/unsafe/unsafe-fn-called-from-safe.rs
@@ -4,5 +4,5 @@
 unsafe fn f() { return; }
 
 fn main() {
-    f(); //~ ERROR call to unsafe function is unsafe
+    f(); //~ ERROR call to unsafe function `f` is unsafe
 }
diff --git a/src/test/ui/unsafe/unsafe-fn-called-from-safe.thir.stderr b/src/test/ui/unsafe/unsafe-fn-called-from-safe.thir.stderr
index 1d6fa4cbf40..0abe86489eb 100644
--- a/src/test/ui/unsafe/unsafe-fn-called-from-safe.thir.stderr
+++ b/src/test/ui/unsafe/unsafe-fn-called-from-safe.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/unsafe-fn-called-from-safe.rs:7:5
    |
 LL |     f();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/unsafe/unsafe-fn-used-as-value.mir.stderr b/src/test/ui/unsafe/unsafe-fn-used-as-value.mir.stderr
index b08a7109dda..7cdf614089c 100644
--- a/src/test/ui/unsafe/unsafe-fn-used-as-value.mir.stderr
+++ b/src/test/ui/unsafe/unsafe-fn-used-as-value.mir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/unsafe-fn-used-as-value.rs:8:5
    |
 LL |     x();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior
 
diff --git a/src/test/ui/unsafe/unsafe-fn-used-as-value.rs b/src/test/ui/unsafe/unsafe-fn-used-as-value.rs
index 2af0786617b..883a9f96d7b 100644
--- a/src/test/ui/unsafe/unsafe-fn-used-as-value.rs
+++ b/src/test/ui/unsafe/unsafe-fn-used-as-value.rs
@@ -5,5 +5,5 @@ unsafe fn f() { return; }
 
 fn main() {
     let x = f;
-    x();    //~ ERROR call to unsafe function is unsafe
+    x(); //~ ERROR call to unsafe function `f` is unsafe
 }
diff --git a/src/test/ui/unsafe/unsafe-fn-used-as-value.thir.stderr b/src/test/ui/unsafe/unsafe-fn-used-as-value.thir.stderr
index b08a7109dda..7cdf614089c 100644
--- a/src/test/ui/unsafe/unsafe-fn-used-as-value.thir.stderr
+++ b/src/test/ui/unsafe/unsafe-fn-used-as-value.thir.stderr
@@ -1,8 +1,8 @@
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block
   --> $DIR/unsafe-fn-used-as-value.rs:8:5
    |
 LL |     x();
-   |     ^^^ call to unsafe function
+   |     ^^^ call to unsafe function `f`
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior