-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Introduce the beginning of a THIR unsafety checker #83129
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
Conversation
This comment has been minimized.
This comment has been minimized.
|
Wow, you can't use |
6026907 to
401b7c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack! Just saw this. Will review Asap =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great start! I left a few nits.
|
I implemented the changes you requested. |
4135a1b to
04a8451
Compare
This comment has been minimized.
This comment has been minimized.
04a8451 to
ed8ceb1
Compare
This comment has been minimized.
This comment has been minimized.
ed8ceb1 to
c3b4648
Compare
This comment has been minimized.
This comment has been minimized.
c3b4648 to
cf97a40
Compare
This comment has been minimized.
This comment has been minimized.
cf97a40 to
b29e409
Compare
This comment has been minimized.
This comment has been minimized.
b29e409 to
f8662fc
Compare
This comment has been minimized.
This comment has been minimized.
f8662fc to
985fb4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, @LeSeulArtichaut! See my comment below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad! Everything looks good.
|
@bors r+ |
|
📌 Commit 985fb4c has been approved by |
|
☀️ Test successful - checks-actions |
…nikomatsakis Check for inline assembly in THIR unsafeck rust-lang#83129 was merged recently and added a THIR unsafe checker. This adds a check for inline assembly. (and this is 2x simpler than the MIR version, which has to check for `asm` and `llvm_asm` in two separate spots!) see also rust-lang/project-thir-unsafeck#7
…=oli-obk Check for union field accesses in THIR unsafeck see also rust-lang#85259, rust-lang#83129, rust-lang/project-thir-unsafeck#7 r? `@LeSeulArtichaut`
This poses the foundations for the THIR unsafety checker, so that it can be implemented incrementally:
Visitorfor the THIR (which will definitely need some tweaking in the future)-Zthir-unsafeckflag which tells the compiler to use THIR unsafeck instead of MIR unsafeckThis uses a very simple query design, where bodies are unsafety-checked on a body per body basis. This however has some big flaws:
I had intended to fix these problems in follow-up PRs since they are always gated under the
-Zthir-unsafeckflag (which is explicitely noted to be unsound).r? @nikomatsakis
cc rust-lang/project-thir-unsafeck#3 rust-lang/project-thir-unsafeck#7