Skip to content

What are our guarantees regarding pointer identity on consts #406

Open
@chorman0773

Description

@chorman0773

We don't currently guarantee that pub const FOO: &'static u32 = &0; has a stable address (same with string literals). This has had some suprising results in the past (I cannot find the miri issue I was looking for). What, if anything, do we want to guarantee with respect to this (and code like pub const FOO: *const u32 = &0 as *const u32;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ptr-eqTopic: pointer equality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions