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!(
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) => {

View File

@ -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
}

View File

@ -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
}

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:
*self += 1;
//~^ 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);
//~^ ERROR E0133
//~| NOTE unsafe call requires unsafe function or block
//~| NOTE call to unsafe function
fn main() {
assert_eq!(VAL, 0xFFFF0000);