Repository navigation
Expose regular argument attributes in rustc_public - #163242
nihalpasham wants to merge 4 commits into
Conversation
|
Thanks for the pull request, and welcome! The Rust Project has assigned @makai410 (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| .expect("Expected ComplexFn signature") | ||
| .fn_ptr_abi() | ||
| .expect("Expected ComplexFn ABI"); |
There was a problem hiding this comment.
(I think that would be... okay to do unwrap() here, though... nvm, it doesn't matter :P)
There was a problem hiding this comment.
Yeah, unwrap() would be fine here too but just for the extra context, I kept expect().
| non_null: true, | ||
| read_only: false, | ||
| no_free: false, | ||
| pointee_size: 0, |
There was a problem hiding this comment.
Curious why this was changed to 0? I saw that it was 4 before and passed CI
There was a problem hiding this comment.
This came up in the CI run, which failed with actual 0, expected 4.
After some digging, I found that [#158863] had landed since I opened this PR and changed this for non-Freeze shared references like &Cell<u32>. The cell is still 4 bytes, but rustc now reports zero because extra speculative reads aren’t safe here.
Figured I’d just update the expectation to match.
|
☔ The latest upstream changes (presumably #163970) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Add
ArgAttributes::regular()andArgAttributeFlagsso consumers can read the argument flags already computed by rustc. The conversion preserves all ten flags, including the overlapping capture flags.Clarifies what
pointee_sizeguarantees at function entry and return, and howno_freeaffects rustc's emission of LLVM dereferenceability attributes.Fixes rust-lang/rustc_public#132.
r? @makai410