Skip to content

Commit

Permalink
Rollup merge of rust-lang#35818 - wdv4758h:E0133-label, r=Aatch
Browse files Browse the repository at this point in the history
Fix label messages for E0133

Issue rust-lang#35789
  • Loading branch information
Jonathan Turner authored Aug 20, 2016
2 parents 53a09ac + 2128d31 commit b458295
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/librustc/middle/effect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/E0133.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-28776.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/trait-safety-fn-body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/unsafe-const-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b458295

Please sign in to comment.