rust-lang / rust-lang/rust

Tracking Issue for const_volatile

Open
#159,094 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue S-tracking-unimplemented T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(const_volatile)]

This is a tracking issue for volatile operations in const.

Public API
// core::ptr

pub const unsafe fn read_volatile<T>(src: *const T) -> T;
pub const unsafe fn write_volatile<T>(dst: *mut T, src: T);

impl<T> *const T {
  pub const unsafe fn read_volatile(self) -> T;
}

impl<T> *mut T {
  pub const unsafe fn read_volatile(self) -> T;
  pub const unsafe fn write_volatile(self, val: T);
}
Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions
  • None yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

This issue tracks the const_volatile feature and lists the core::ptr API; start by reviewing implementation PR #159092. Follow the feature checklist and stabilization guidance in the issue. Done means the implementation, final comment period, and stabilization PR are complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.