Skip to content

Fix label messages for E0133 #35818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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