Skip to content

Tracking Issue for offset_of_slice #126151

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

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

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, not yet approved or unneeded (requires FCP to stabilize). B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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: An issue tracking the progress of sth. like the implementation of an RFC 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, not yet approved or unneeded (requires FCP to stabilize). 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).
@nikomatsakis nikomatsakis moved this to Exploration in Lang team features Feb 21, 2025
@nikomatsakis nikomatsakis moved this from Exploration to Needs champion in Lang team features Feb 21, 2025
@nikomatsakis nikomatsakis moved this from Needs champion to Exploration in Lang team features Mar 5, 2025
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, not yet approved or unneeded (requires FCP to stabilize). B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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
Status: Exploration
Development

No branches or pull requests

2 participants