Skip to content

Note in no-mutable-refs in consts is confusing #2074

@ehuss

Description

@ehuss

This note is a bit confusing since it does not relate back to what we said above about why these references are disallowed.

It should probably also say that this is sound to allow because it take an unsafe block to create a mutable reference to such a static, and that unsafe block carries the obligation of ensuring that no unsound aliasing will occur, Furthermore, the problem regarding "is there a new instance of the pointee for every use of the const or not" does not come up since unambiguously, these references all point to S.

Originally posted by @RalfJung in #2058

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions