diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index 3ca6cf0399797..250ad80f5af6c 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -66,7 +66,7 @@ impl<'a, 'tcx> EffectCheckVisitor<'a, 'tcx> { struct_span_err!( self.tcx.sess, span, E0133, "{} requires unsafe function or block", description) - .span_label(span, &format!("unsafe call requires unsafe function or block")) + .span_label(span, &description) .emit(); } UnsafeBlock(block_id) => { diff --git a/src/test/compile-fail/E0133.rs b/src/test/compile-fail/E0133.rs index b8a4476fc5967..f60d9a5083f6f 100644 --- a/src/test/compile-fail/E0133.rs +++ b/src/test/compile-fail/E0133.rs @@ -13,5 +13,5 @@ unsafe fn f() { return; } fn main() { f(); //~^ ERROR E0133 - //~| NOTE unsafe call requires unsafe function or block + //~| NOTE call to unsafe function } diff --git a/src/test/compile-fail/issue-28776.rs b/src/test/compile-fail/issue-28776.rs index 52b0eba96cbdf..4a36bc88fa7d9 100644 --- a/src/test/compile-fail/issue-28776.rs +++ b/src/test/compile-fail/issue-28776.rs @@ -13,5 +13,5 @@ use std::ptr; fn main() { (&ptr::write)(1 as *mut _, 42); //~^ ERROR E0133 - //~| NOTE unsafe call requires unsafe function or block + //~| NOTE call to unsafe function } diff --git a/src/test/compile-fail/trait-safety-fn-body.rs b/src/test/compile-fail/trait-safety-fn-body.rs index 0df7ee8cabed2..65732a8ff69e5 100644 --- a/src/test/compile-fail/trait-safety-fn-body.rs +++ b/src/test/compile-fail/trait-safety-fn-body.rs @@ -20,7 +20,7 @@ unsafe impl UnsafeTrait for *mut isize { // Unsafe actions are not made legal by taking place in an unsafe trait: *self += 1; //~^ ERROR E0133 - //~| NOTE unsafe call requires unsafe function or block + //~| NOTE dereference of raw pointer } } diff --git a/src/test/compile-fail/unsafe-const-fn.rs b/src/test/compile-fail/unsafe-const-fn.rs index 174939b09009c..91e16592be472 100644 --- a/src/test/compile-fail/unsafe-const-fn.rs +++ b/src/test/compile-fail/unsafe-const-fn.rs @@ -18,7 +18,7 @@ const unsafe fn dummy(v: u32) -> u32 { const VAL: u32 = dummy(0xFFFF); //~^ ERROR E0133 -//~| NOTE unsafe call requires unsafe function or block +//~| NOTE call to unsafe function fn main() { assert_eq!(VAL, 0xFFFF0000);