rust-lang / rust-lang/stdarch

Now-safe `cpuid` triggers `unused_unsafe`

Open
#1,990 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
694
Forks
336
Avg merge
5d 14h
Merged PRs (30d)
9

Description

@joshtriplett wrote in https://github.com/rust-lang/rust/pull/146560#issuecomment-3357108322:

That said, counterproposal: rather than a target feature, can we transition to cpuid being universally safe (using the mechanisms we normally use to move something from unsafe to safe without provoking widespread warnings about unused unsafe)?

cpuid currently triggers unused_unsafe (see https://github.com/rust-osdev/x86_64/pull/575). Is this intentional?

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

Start by reviewing the linked Rust pull-request comment and x86_64 pull request #575, then inspect the stdarch entry point for cpuid and how unused_unsafe is triggered. Done means establishing whether the warning is intentional and documenting or changing the behavior so the transition to safe cpuid is handled consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.