We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This complies ok:
struct A(int); impl A { unsafe fn a(&self) -> int { **self } } trait B { unsafe fn b(&self) -> int; } impl B for A { unsafe fn b(&self) -> int { **self } } fn main() { let _ = A(1).a(); let _ = A(1).b(); unsafe { let _ = A(1).a(); let _ = A(1).b(); } }
With this warning:
unsafe-methods.rs:19:4: 22:5 warning: unnecessary `unsafe` block [-W unused-unsafe (default)] unsafe-methods.rs:19 unsafe { unsafe-methods.rs:20 let _ = A(1).a(); unsafe-methods.rs:21 let _ = A(1).b(); unsafe-methods.rs:22 }
Yikes.
The text was updated successfully, but these errors were encountered:
Woops, this is a duplicate of #3080
Sorry, something went wrong.
Update to stop unsolicited copying and mark methods as unsafe
eef03c3
No branches or pull requests
This complies ok:
With this warning:
Yikes.
The text was updated successfully, but these errors were encountered: