Strangly [E0275]: overflow evaluating the requirement
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the snippet with rand = "0.10.3", then compare it with the turbofish variant random::<i32> to see where inference fails. The error comes from the StandardUniform: Distribution<T> bound on RngExt::random in rand's src/rng.rs, so trace how the trait solver reports overflow for that bound. Done means the diagnostic names the unresolved type and gives a usable hint, which the issue's placeholder desired output does not yet specify.
Written by the indexing model from the issue text.
Description
Code
fn foo() {
rand::RngExt::random(&mut rand::rng())%50i32;
}
Current output
error[E0275]: overflow evaluating the requirement `StandardUniform: rand::distr::Distribution<_>`
--> src/lib.rs:2:5
|
2 | rand::RngExt::random(&mut rand::rng())%50i32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `rand::RngExt::random`
--> /home/lrne/.cargo/registry/src/rsproxy.cn-e3de039b2554c837/rand-0.10.3/src/rng.rs:95:26
|
56 | pub trait RngExt: Rng {
...
93 | fn random<T>(&mut self) -> T
94 | where
95 | StandardUniform: Distribution<T>,
| ^^^^^^^^^^^^^^^ required by this bound in `RngExt::random`
Desired output
Some types, generics, bounds diagnostics...
Rationale and extra context
rand = "0.10.3"
Other cases
fn foo() {
rand::RngExt::random::<i32>(&mut rand::rng())%50i32;
}
Rust Version
rustc 1.101.0-nightly (7df81381d 2026-10-14)
binary: rustc
commit-hash: 7df81381d027710708209f36b98d11b1c88f8d2e
commit-date: 2026-10-14
host: aarch64-unknown-linux-gnu
release: 1.101.0-nightly
LLVM version: 23.1.3
Anything else?
No response
- Dominant language
- Rust
- Stars
- 121k
- Forks
- 17.3k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 531
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from rust-lang/rust
-
A-run-make relnotes relnotes-needs-review relnotes-tracking-issue T-lang T-libs
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
relnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-libs
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
A-LLVM O-Arm O-UEFI O-x86_64 relnotes relnotes-needs-review relnotes-tracking-issue T-compiler
Difficulty 1/5 Under an hour Newbie friendliness 72/100
rust-lang/rust#165504 · 1 comment ·
Maintainers usually reply within 1 day
-
relnotes relnotes-tracking-issue T-libs
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
unclear wording in vec macroPossibly taken @Suhird claimed this 5 days ago. OpenA-docs A-slice-vec T-libs
Difficulty 1/5 1-3 hours Newbie friendliness 70/100
rust-lang/rust#165360 · 6 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
bytecodealliance/rustix#1736 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
longbridge/gpui-kit#3871 ·
Maintainers usually reply within 1 day
-
area:models enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 84/100
servo/rust-smallvec#864 ·