Fix label messages for E0133

Issue #35789
This commit is contained in:
Chiu-Hsiang Hsu 2016-08-19 11:58:26 +08:00
parent 499484f56d
commit 2128d31a41
5 changed files with 5 additions and 5 deletions

View File

@ -66,7 +66,7 @@ impl<'a, 'tcx> EffectCheckVisitor<'a, 'tcx> {
struct_span_err!( struct_span_err!(
self.tcx.sess, span, E0133, self.tcx.sess, span, E0133,
"{} requires unsafe function or block", description) "{} requires unsafe function or block", description)
.span_label(span, &format!("unsafe call requires unsafe function or block")) .span_label(span, &description)
.emit(); .emit();
} }
UnsafeBlock(block_id) => { UnsafeBlock(block_id) => {

View File

@ -13,5 +13,5 @@ unsafe fn f() { return; }
fn main() { fn main() {
f(); f();
//~^ ERROR E0133 //~^ ERROR E0133
//~| NOTE unsafe call requires unsafe function or block //~| NOTE call to unsafe function
} }

View File

@ -13,5 +13,5 @@ use std::ptr;
fn main() { fn main() {
(&ptr::write)(1 as *mut _, 42); (&ptr::write)(1 as *mut _, 42);
//~^ ERROR E0133 //~^ ERROR E0133
//~| NOTE unsafe call requires unsafe function or block //~| NOTE call to unsafe function
} }

View File

@ -20,7 +20,7 @@ unsafe impl UnsafeTrait for *mut isize {
// Unsafe actions are not made legal by taking place in an unsafe trait: // Unsafe actions are not made legal by taking place in an unsafe trait:
*self += 1; *self += 1;
//~^ ERROR E0133 //~^ ERROR E0133
//~| NOTE unsafe call requires unsafe function or block //~| NOTE dereference of raw pointer
} }
} }

View File

@ -18,7 +18,7 @@ const unsafe fn dummy(v: u32) -> u32 {
const VAL: u32 = dummy(0xFFFF); const VAL: u32 = dummy(0xFFFF);
//~^ ERROR E0133 //~^ ERROR E0133
//~| NOTE unsafe call requires unsafe function or block //~| NOTE call to unsafe function
fn main() { fn main() {
assert_eq!(VAL, 0xFFFF0000); assert_eq!(VAL, 0xFFFF0000);