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

MCP: repr(align(ptr)) #35

Closed
Lokathor opened this issue Jul 12, 2020 · 3 comments
Closed

MCP: repr(align(ptr)) #35

Lokathor opened this issue Jul 12, 2020 · 3 comments
Assignees
Labels
charter-needed A project proposal that has been approved as a new project group, but no charter has been written. major-change Major change proposal T-lang

Comments

@Lokathor
Copy link

The AtomicPtr type needs three lines of cfg_attr just to try and say what it really wants to say, "I am aligned to the size of a pointer". This is slightly silly, and what's worse it's actually a little error prone because if the pointer width were ever smaller (unlikely) or larger (not impossible) then suddenly none of the cfg_attr would apply and not only would it not have the right alignment it wouldn't even have repr(C), which could make other code that assumes AtomicPtr has repr(C) also suddenly be UB.

Conclusion the align() attribute should allow a value of ptr to request pointer alignment for your type in a "blessed" portable way.

@Lokathor Lokathor added T-lang major-change Major change proposal labels Jul 12, 2020
@rustbot
Copy link
Collaborator

rustbot commented Jul 12, 2020

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@Mark-Simulacrum Mark-Simulacrum added major-change Major change proposal and removed major-change Major change proposal labels Jul 12, 2020
@rust-lang rust-lang deleted a comment from rustbot Jul 12, 2020
@nikomatsakis nikomatsakis added this to Major Change Proposals (Incoming) in Lang Team Jul 20, 2020
@scottmcm scottmcm self-assigned this Jul 20, 2020
@nikomatsakis nikomatsakis added the charter-needed A project proposal that has been approved as a new project group, but no charter has been written. label Jul 28, 2020
@nikomatsakis
Copy link
Contributor

Since @scottmcm has assigned themselves as liaison, the next step here is to author a charter.

@Lokathor
Copy link
Author

Can do, though I'll wait for the PR that has the charter template in it to actually merge first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
charter-needed A project proposal that has been approved as a new project group, but no charter has been written. major-change Major change proposal T-lang
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants