]> git.lizzy.rs Git - rust.git/commitdiff
Fix label messages for E0133
authorChiu-Hsiang Hsu <wdv4758h@gmail.com>
Fri, 19 Aug 2016 03:58:26 +0000 (11:58 +0800)
committerChiu-Hsiang Hsu <wdv4758h@gmail.com>
Fri, 19 Aug 2016 03:58:26 +0000 (11:58 +0800)
Issue #35789

src/librustc/middle/effect.rs
src/test/compile-fail/E0133.rs
src/test/compile-fail/issue-28776.rs
src/test/compile-fail/trait-safety-fn-body.rs
src/test/compile-fail/unsafe-const-fn.rs

index 3ca6cf039979705cc09477902e3912c270daf7d2..250ad80f5af6c98b738cf28c3aa0f3da7c6562c9 100644 (file)
@@ -66,7 +66,7 @@ fn require_unsafe(&mut self, span: Span, description: &str) {
                 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) => {
index b8a4476fc59671b2b5e4f6b769ce5bad5ad9bfd9..f60d9a5083f6fd526c9cdb9a810165b16398069b 100644 (file)
@@ -13,5 +13,5 @@
 fn main() {
     f();
     //~^ ERROR E0133
-    //~| NOTE unsafe call requires unsafe function or block
+    //~| NOTE call to unsafe function
 }
index 52b0eba96cbdf59631f784bc662fe72f14cfc001..4a36bc88fa7d9d7aae7f5ca4daa8f703e0ccd88a 100644 (file)
@@ -13,5 +13,5 @@
 fn main() {
     (&ptr::write)(1 as *mut _, 42);
     //~^ ERROR E0133
-    //~| NOTE unsafe call requires unsafe function or block
+    //~| NOTE call to unsafe function
 }
index 0df7ee8cabed21a4adb3db8a14e1d1962127f669..65732a8ff69e54ac117d0c0a213f728b0931617c 100644 (file)
@@ -20,7 +20,7 @@ fn foo(self) {
         // 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
     }
 }
 
index 174939b09009cbd3ef0bef677506f6a3191146c8..91e16592be4729364d82be8f2b8035f966ac8ea3 100644 (file)
@@ -18,7 +18,7 @@
 
 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);