Skip to content
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

Incorrect label messages for missing unsafe blocks #35789

Closed
petrochenkov opened this issue Aug 18, 2016 · 3 comments
Closed

Incorrect label messages for missing unsafe blocks #35789

petrochenkov opened this issue Aug 18, 2016 · 3 comments

Comments

@petrochenkov
Copy link
Contributor

Label message always mention "unsafe call", even when nothing is actually called.
It should duplicate the main message instead, or use some paraphrase of it.

fn main() {
    *(0 as *const u8);
}
error[E0133]: dereference of raw pointer requires unsafe function or block
 --> <anon>:2:5
  |
2 |     *(0 as *const u8);
  |     ^^^^^^^^^^^^^^^^^ unsafe call requires unsafe function or block

error: aborting due to previous error

cc #35565 @wdv4758h @jonathandturner

@wdv4758h
Copy link
Contributor

How about this :

error[E0133]: dereference of raw pointer requires unsafe function or block
 --> <anon>:2:5
  |
2 |     *(0 as *const u8);
  |     ^^^^^^^^^^^^^^^^^ dereference of raw pointer

error: aborting due to previous error
error[E0133]: call to unsafe function requires unsafe function or block
  --> src/test/compile-fail/E0133.rs:14:5
   |
14 |     f(); //~ ERROR E0133
   |     ^^^ call to unsafe function

error: aborting due to previous error

wdv4758h added a commit to wdv4758h/rust that referenced this issue Aug 19, 2016
@wdv4758h
Copy link
Contributor

@jonathandturner I've made a PR, please check the error messages again :)

sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 19, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 19, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 20, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 20, 2016
@wdv4758h
Copy link
Contributor

Fix in #35818, should be closed.

@sanxiyn sanxiyn closed this as completed Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants