`u32::max` / `u32::min` require `OpCapability U8`
Open
Nobody has claimed this yet.
bug
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
u32::max / u32::min cannot be used as they require OpCapability U8. They should just work out of the box.
Workaround: use u32::clamp() instead.
It's the Ordering enum. it has #[repr(i8)] (with -1, 0, +1 values)
Maybe we should special case the Ordering enum to be a u32?
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 reproducing the u32::max and u32::min capability error and compare it with the u32::clamp() workaround. Trace how the Ordering enum and its #[repr(i8)] values affect capability requirements; done means the max and min operations work without requiring OpCapability U8.
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
- Mostly clear
- Newbie friendliness
- 35/100