parent
499484f56d
commit
2128d31a41
@ -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) => {
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user