Skip to content

Tracking Issue for making ptr offset methods "const fn" #71499

Closed
@josephlr

Description

@josephlr

The feature gate for this is #![feature(const_ptr_offset)]. Miri has been able to handle this for some time. This feature allows code like:

static FOO: u8 = 42;
static PTR1: *const u8 = &FOO as *const u8;
static PTR2: *const u8 = PTR1.wrapping_offset(1);

Steps (based on #69821)

Unresolved Questions

CC: @RalfJung @oli-obk @rust-lang/wg-const-eval

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions