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

unsafe: Add UnsafeCheck visitor #1410

Merged
merged 4 commits into from
Jul 27, 2022
Merged

Conversation

CohenArthur
Copy link
Member

This visitor takes care of checking for unsafe expressions in safe
contexts. This first iteration reports the dereferencing of raw
pointers.

@CohenArthur CohenArthur mentioned this pull request Jul 22, 2022
11 tasks
@CohenArthur CohenArthur force-pushed the unsafe-visitor branch 3 times, most recently from c13b255 to 6b14b56 Compare July 26, 2022 13:44
This visitor takes care of checking for unsafe expressions in safe
contexts. This first iteration reports the dereferencing of raw
pointers.
@philberty philberty removed the request for review from ndrwnaguib July 27, 2022 11:39
@philberty philberty added this to the Const Generics milestone Jul 27, 2022
Co-authored-by: philberty <philip.herron@embecosm.com>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Minor nit that in_unsafe_context could be const but you can fix in the next patches. Another minor nit is I would have made the unsafe context a separate class but there is no need to do that right now.

}

bool
UnsafeChecker::is_unsafe_context ()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be const

@CohenArthur
Copy link
Member Author

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 27, 2022

Build succeeded:

@bors bors bot merged commit d94d5b1 into Rust-GCC:master Jul 27, 2022
@CohenArthur CohenArthur deleted the unsafe-visitor branch July 27, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants