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

Meeting proposal: Do Vec and Box have an aliasing requirement? #14

Closed
chorman0773 opened this issue Aug 10, 2023 · 2 comments
Closed

Meeting proposal: Do Vec and Box have an aliasing requirement? #14

chorman0773 opened this issue Aug 10, 2023 · 2 comments
Labels
post-meeting-actions The meeting has been held, but some action items remain to be done or moved to be tracked elsewhere

Comments

@chorman0773
Copy link

Summary

This meeting will discuss the aliasing requirements on Vec and Box to see if consensus exists at least as to the question of whether such aliasing requierments exist. If consensus exists that some exist, the meeting may cover what the requirements are to an extent, but the primary focus in on the yes or no question.

Reading

UCG Issue: rust-lang/unsafe-code-guidelines#326

Prior Zulip Topic: https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Making.20Box.20allow.20aliasing

A meeting document will be written up prior to the meeting.

Comment policy

These issues are meant to be used as an "announcements channel" regarding the proposal, and not as a
place to discuss the technical details. Feel free to subscribe to updates. We'll post comments when
reviewing the proposal in meetings or making a scheduling decision. In the meantime, if you have
questions or ideas, ping the proposers on Zulip (or elsewhere).

@chorman0773 chorman0773 added the meeting-proposal Proposal for a discussion topic at a team meeting label Aug 10, 2023
@RalfJung RalfJung changed the title Does Vec and Box have an aliasing requirement. Do Vec and Box have an aliasing requirement. Aug 19, 2023
@RalfJung RalfJung changed the title Do Vec and Box have an aliasing requirement. Meeting proposal: Do Vec and Box have an aliasing requirement. Aug 19, 2023
@RalfJung RalfJung changed the title Meeting proposal: Do Vec and Box have an aliasing requirement. Meeting proposal: Do Vec and Box have an aliasing requirement? Aug 19, 2023
@RalfJung
Copy link
Member

RalfJung commented Sep 24, 2023

@chorman0773 what shall we do with this issue? Could you post a short summary of the discussion?

I don't think we had any concrete post-meeting actions, we kind of came out of it without much of a conclusion.

@RalfJung RalfJung added post-meeting-actions The meeting has been held, but some action items remain to be done or moved to be tracked elsewhere and removed meeting-proposal Proposal for a discussion topic at a team meeting labels Sep 24, 2023
@chorman0773
Copy link
Author

chorman0773 commented Sep 25, 2023

Summary as recorded

Box and Vec are imbued with langauge magic, and their aliasing concerns are major concerns in the ecosystem, with a wide variety of common pain points that the ecosystem runs into (ala StableDeref and similar). With Box, the situation is simple than Vec, as this would be a weakening of guarantees, whereas it would be an addition for Vec.
Answer to question posed: No, we cannot currently answer the question.
Possible solutions to advance on the question:

  • Attributes to opt-out or opt-in to various behaviours, allowing stdlib types to either have or not have aliasing
    constraints without intruding on unsafe code that wants or does not want the constraints.
  • MaybeDangling<Box<T>> could have place-deref behaviour like Box<T>

I'm not sure there's a lot to do from here, except either wait for MaybeDangling or the attribute design, so this issue can probably be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
post-meeting-actions The meeting has been held, but some action items remain to be done or moved to be tracked elsewhere
Projects
None yet
Development

No branches or pull requests

2 participants