Skip to content

feature(const_ptr_write) is broken #86236

@AaronKutch

Description

@AaronKutch

As of a very recent nightly (rustc 1.54.0-nightly (0a8629bff 2021-06-11)), it appears to me that feature(const_ptr_write) is no longer working and broke my code. Sample code:

#![feature(const_ptr_write)]
const unsafe fn ex(x: *mut usize) {
    unsafe {
        x.write(0);
    }
}
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
 --> src/lib.rs:5:9
  |
5 |         x.write(0);
  |         ^^^^^^^^^^

I see a tracking issue for many other pointer operations such as const_ptr_read, but strangely a tracking issue for const_ptr_write is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions