rustdoc doesn't gate unstable library features
Open
Nobody has claimed this yet.
A-stability
C-bug
T-rustdoc
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Found thanks to https://github.com/rust-lang/rust/issues/153879.
Reproducer
The following invocation exits with code 0 despite LaneCount being gated behind unstable library feature portable_simd:
rustdoc +1.94 <(echo 'use std::simd::LaneCount;') --crate-type=lib -Aunused
rustc on the other hand correctly rejects this code (of course):
rustc +1.94 <(echo 'use std::simd::LaneCount;') --crate-type=lib -Aunused
error[E0658]: use of unstable library feature `portable_simd`
--> /proc/self/fd/11:1:5
|
1 | use std::simd::LaneCount;
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #86656 <https://github.com/rust-lang/rust/issues/86656> for more information
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the rustdoc reproducer and the corresponding rustc command to confirm their differing behavior. Trace rustdoc's handling of unstable library features and compare it with rustc's rejection path; done means rustdoc rejects the LaneCount example with the appropriate unstable-feature error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100