Skip to content
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

Tracking Issue for offset_of_slice #126151

Open
4 tasks
RalfJung opened this issue Jun 8, 2024 · 0 comments
Open
4 tasks

Tracking Issue for offset_of_slice #126151

RalfJung opened this issue Jun 8, 2024 · 0 comments
Labels
B-experimental Blocker: In-tree experiment; RFC pending or unneeded. B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-offset_of_slice `#![feature(offset_of_slice)]` S-tracking-needs-to-bake Status: The implementation is "complete" but it needs time to bake. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

RalfJung commented Jun 8, 2024

The feature gate for the issue is #![feature(offset_of_slice)].

This is a tracking issue for allowing offset_of to determine the offset of unsized fields whose tail is a slice, and hence their alignment and their offset is statically known.

Steps

Implementation history

@RalfJung RalfJung added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Jun 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 9, 2024
…-errors

offset_of: allow (unstably) taking the offset of slice tail fields

Fields of type `[T]` have a statically known offset, so there is no reason to forbid them in `offset_of!`. This PR adds the `offset_of_slice` feature to allow them.

I created a tracking issue: rust-lang#126151.
@fmease fmease added T-lang Relevant to the language team, which will review and decide on the PR/issue. F-offset_of_slice `#![feature(offset_of_slice)]` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. B-unstable Blocker: Implemented in the nightly compiler and unstable. B-experimental Blocker: In-tree experiment; RFC pending or unneeded. S-tracking-needs-to-bake Status: The implementation is "complete" but it needs time to bake. labels Jun 9, 2024
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Jul 7, 2024
The container doesn't have to be sized, but the field must be sized (at
least until rust-lang#126151 is stable).
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 7, 2024
…=Nilstrieb

Describe Sized requirements for mem::offset_of

The container doesn't have to be sized, but the field must be sized (at least until rust-lang#126151 is stable).
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jul 7, 2024
Rollup merge of rust-lang#127354 - nicholasbishop:bishop-sized-doc, r=Nilstrieb

Describe Sized requirements for mem::offset_of

The container doesn't have to be sized, but the field must be sized (at least until rust-lang#126151 is stable).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-experimental Blocker: In-tree experiment; RFC pending or unneeded. B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-offset_of_slice `#![feature(offset_of_slice)]` S-tracking-needs-to-bake Status: The implementation is "complete" but it needs time to bake. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants