Skip to content

Tracking issue for pref_align_of intrinsic #91971

Closed
@RalfJung

Description

@RalfJung

This intrinsic returns the "preferred" alignment of a type, which can be different from the minimal alignment exposed via mem::align_of. It is not currently exposed through any wrapper method, but can still be accessed by unstable code using the intrinsics or core_intrinsics features.

See #90877 for why it cannot be removed; the short summary is some code is actually using it. So let's have a place to centralize discussion about the intrinsics. (This is not a regular tracking issue because there is no associated feature gate, but close enough I think.)

It would be good to figure out what the "preferred alignment" actually is used for, e.g. there doesn't seem to be consensus on the question whether it is ever relevant for ABI or UB, or whether it is merely a hint used by the compiler to align some globals more than it has to.

Metadata

Metadata

Labels

A-intrinsicsArea: IntrinsicsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-design-concernsStatus: There are blocking design concerns.S-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.T-langRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions