-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Allow &raw [mut | const]
for union field in safe code
#141469
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
Failed to set assignee to
|
cc @RalfJung |
&raw [mut | const]
for union field in safe
Uh, the unsafety checker is not actually code I know very well, sorry. |
The macros just expand to |
This comment has been minimized.
This comment has been minimized.
I will debug this later today but this is very weird |
b006128
to
43892d3
Compare
This comment has been minimized.
This comment has been minimized.
b60d3ff
to
fc03435
Compare
This comment has been minimized.
This comment has been minimized.
9ccf35d
to
cde9fa0
Compare
@rustbot ready |
Not sure if I shoulded to split this test into separate files |
4024f37
to
23f1767
Compare
&raw [mut | const]
for union field in safe&raw [mut | const]
for union field in safe code
@rfcbot reviewed |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@rfcbot reviewed |
r=me when FCP is over. |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
@bors r=compiler-errors |
…iler-errors Allow `&raw [mut | const]` for union field in safe code fixes rust-lang#141264 r? `@Veykril` Unresolved questions: - [x] Any edge cases? - [x] How this works with rust-analyzer (because all I've did is prevent compiler from emitting error in `&raw` context) (rust-lang/rust-analyzer#19867) - [x] Should we allow `addr_of!` and `addr_of_mut!` as well? In current version they both (`&raw` and `addr_of!`) are allowed (They are the same) - [x] Is chain of union fields is a safe? (Yes)
Rollup of 6 pull requests Successful merges: - #140482 (std::net: update tcp deferaccept delay type to Duration.) - #141469 (Allow `&raw [mut | const]` for union field in safe code) - #144197 (TypeTree support in autodiff) - #146675 (Allow shared access to `Exclusive<T>` when `T: Sync`) - #147113 (Reland "Add LSX accelerated implementation for source file analysis") - #147120 (Fix --extra-checks=spellcheck to prevent cargo install every time) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #141469 - Kivooeo:remove-usnsafegate, r=compiler-errors Allow `&raw [mut | const]` for union field in safe code fixes #141264 r? ``@Veykril`` Unresolved questions: - [x] Any edge cases? - [x] How this works with rust-analyzer (because all I've did is prevent compiler from emitting error in `&raw` context) (rust-lang/rust-analyzer#19867) - [x] Should we allow `addr_of!` and `addr_of_mut!` as well? In current version they both (`&raw` and `addr_of!`) are allowed (They are the same) - [x] Is chain of union fields is a safe? (Yes)
fixes #141264
r? @Veykril
Unresolved questions:
&raw
context) (Allow&raw [mut | const]
for union field rust-analyzer#19867)addr_of!
andaddr_of_mut!
as well? In current version they both (&raw
andaddr_of!
) are allowed (They are the same)