rust-lang / rust-lang/libc

Wrapper for volatile fields

Open
#4,130 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S-waiting-on-decision
Dominant language
Rust
Stars
2.6k
Forks
1.3k
Avg merge
1d 22h
Merged PRs (30d)
69

Description

In C, fields can be defined as volatile whereas for Rust it is the accesses. I'm wondering if we should consider wrapping any volatile members in some UnsafeCell-based wrapper to ensure they aren't read by accident.

Unfortunately this is a bit tricky since we can't allow it to be moved by the compiler.

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

The issue does not name a file, entry point, or test. First identify the volatile field definitions affected and investigate the UnsafeCell and move restrictions described; done requires an agreed wrapper design with tests covering the relevant access and movement behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, rust
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.