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

New lint: unsafe trait becomes safe #250

Closed
Tracked by #5
obi1kenobi opened this issue Dec 27, 2022 · 0 comments
Closed
Tracked by #5

New lint: unsafe trait becomes safe #250

obi1kenobi opened this issue Dec 27, 2022 · 0 comments
Assignees
Labels
A-lint Area: new or existing lint E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue.

Comments

@obi1kenobi
Copy link
Owner

This is the opposite direction of #231, and perhaps surprisingly this is also a breaking change since unsafe impl is not allowed for safe traits.

Implementing an unsafe trait requires an unsafe impl block, but safe traits cannot be implemented with an unsafe impl block. https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html#implementing-an-unsafe-trait

Needs schema additions to expose whether the trait is unsafe:
https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc_json_types/struct.Trait.html
https://github.com/obi1kenobi/trustfall-rustdoc-adapter/blob/0b1f021c22aab6e48f38156e52c7b8331447149a/src/rustdoc_schema.graphql#L382

@obi1kenobi obi1kenobi added A-lint Area: new or existing lint E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue. labels Dec 27, 2022
@staniewzki staniewzki self-assigned this Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: new or existing lint E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: Mentorship is available for this issue.
Projects
None yet
Development

No branches or pull requests

2 participants