abi: add AddressSpace field to Primitive::Pointer #107248
Merged
bors merged 3 commits intorust-lang:masterfrom Jan 26, 2023
Merged
abi: add AddressSpace field to Primitive::Pointer #107248bors merged 3 commits intorust-lang:masterfrom
bors merged 3 commits intorust-lang:masterfrom
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.
Collaborator
oli-obk
approved these changes
Jan 24, 2023
Contributor
oli-obk
left a comment
There was a problem hiding this comment.
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)
Contributor
|
@bors r+ |
Collaborator
Collaborator
|
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
Contributor
|
@bors r+ |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 25, 2023
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`
This was referenced Jan 25, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 26, 2023
…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
RalfJung
reviewed
Jan 29, 2023
| pub size: Size, | ||
| pub align: Align, | ||
| pub safe: Option<PointerKind>, | ||
| pub address_space: AddressSpace, |
Member
There was a problem hiding this comment.
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)
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Jan 31, 2023
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`
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Jan 31, 2023
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``
4 tasks
bjorn3
pushed a commit
to bjorn3/rust
that referenced
this pull request
Feb 9, 2023
…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
4 tasks
qinheping
added a commit
to qinheping/kani
that referenced
this pull request
Mar 9, 2023
(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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
...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