-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
abi: add AddressSpace field to Primitive::Pointer #107248
Conversation
there were fixmes for this already i am about to remove is_ptr (since callers need to properly distinguish between pointers in different address spaces), so might as well do this at the same time
...and remove it from `PointeeInfo`, which isn't meant for this. There are still various places (marked with FIXMEs) that assume all pointers have the same size and alignment. Fixing this requires parsing non-default address spaces in the data layout string, which will be done in a followup.
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.
looks like that snippet about GlobalAlloc is only ever used once. A bit surprising, but maybe we'll see more of it if we end up teaching const eval about address spaces (it already kind of has some of them implicitly)
@bors r+ |
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
@bors r+ |
abi: add AddressSpace field to Primitive::Pointer ...and remove it from `PointeeInfo`, which isn't meant for this. There are still various places (marked with FIXMEs) that assume all pointers have the same size and alignment. Fixing this requires parsing non-default address spaces in the data layout string (and various other changes), which will be done in a followup. (That is, if it's actually worth it to support multiple different pointer sizes. There is a lot of code that would be affected by that.) Fixes rust-lang#106367 r? `@oli-obk` cc `@Patryk27`
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#106407 (Improve proc macro attribute diagnostics) - rust-lang#106960 (Teach parser to understand fake anonymous enum syntax) - rust-lang#107085 (Custom MIR: Support binary and unary operations) - rust-lang#107086 (Print PID holding bootstrap build lock on Linux) - rust-lang#107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`) - rust-lang#107204 (suggest qualifying bare associated constants) - rust-lang#107248 (abi: add AddressSpace field to Primitive::Pointer ) - rust-lang#107272 (Implement ObjectSafe and WF in the new solver) - rust-lang#107285 (Implement `Generator` and `Future` in the new solver) - rust-lang#107286 (ICE in new solver if we see an inference variable) - rust-lang#107313 (Add Style Team Triagebot config) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
@@ -1468,7 +1461,6 @@ pub struct PointeeInfo { | |||
pub size: Size, | |||
pub align: Align, | |||
pub safe: Option<PointerKind>, | |||
pub address_space: AddressSpace, |
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.
Awesome, thanks a ton. :)
Note to self: add a comment to PointeeInfo
stating that this is for optimization purposes only and safe to ignore by backends (as suggested by @eddyb)
PointeeInfo is advisory only rust-lang#107248 fixed PointeeInfo being used in ways that don't actually work. Hopefully this comments helps avoid such issues in the future. Cc `@eddyb`
PointeeInfo is advisory only rust-lang#107248 fixed PointeeInfo being used in ways that don't actually work. Hopefully this comments helps avoid such issues in the future. Cc ``@eddyb``
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#106407 (Improve proc macro attribute diagnostics) - rust-lang#106960 (Teach parser to understand fake anonymous enum syntax) - rust-lang#107085 (Custom MIR: Support binary and unary operations) - rust-lang#107086 (Print PID holding bootstrap build lock on Linux) - rust-lang#107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`) - rust-lang#107204 (suggest qualifying bare associated constants) - rust-lang#107248 (abi: add AddressSpace field to Primitive::Pointer ) - rust-lang#107272 (Implement ObjectSafe and WF in the new solver) - rust-lang#107285 (Implement `Generator` and `Future` in the new solver) - rust-lang#107286 (ICE in new solver if we see an inference variable) - rust-lang#107313 (Add Style Team Triagebot config) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
(GeneratorWitnessMIR) Compute generator saved locals on MIR rust-lang/rust#101692 (ParamEnv) InstCombine away intrinsic validity assertions rust-lang/rust#105582 (Primitive::Pointer) abi: add AddressSpace field to Primitive::Pointer rust-lang/rust#107248
(GeneratorWitnessMIR) Compute generator saved locals on MIR rust-lang/rust#101692 (ParamEnv) InstCombine away intrinsic validity assertions rust-lang/rust#105582 (Primitive::Pointer) abi: add AddressSpace field to Primitive::Pointer rust-lang/rust#107248
...and remove it from
PointeeInfo
, which isn't meant for this.There are still various places (marked with FIXMEs) that assume all pointers
have the same size and alignment. Fixing this requires parsing non-default
address spaces in the data layout string (and various other changes),
which will be done in a followup.
(That is, if it's actually worth it to support multiple different pointer sizes.
There is a lot of code that would be affected by that.)
Fixes #106367
r? @oli-obk
cc @Patryk27