-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui/deriving/issue-89188-gat-hrtb.rs
test fails with debug assertions enabled
#89639
Comments
The overflowing code is rust/compiler/rustc_trait_selection/src/traits/project.rs Lines 560 to 561 in 5641481
To me, it actually seems like the overflow might be a bug. @jackh726 it looks like you added this code. Is it incorrect for it to be overflowing? |
This is introduced in #86993 with guards like |
Overflowing here is a bug. Given that we haven't seen an index out of bound panics on like 562, I would guess that the actual logic here is correct (so, we underflow, then overflow). I do want to prove to myself that again (and put it in a comment). |
If it is really intended then |
Oh, I think I ran into this as well and thought it was due to a local change I had made violating an invariant. |
Duplicate of #89280? |
no, that issue is in diagnostics, while this one is in trait resolution. I'll try to get to the diagnostics issue next week |
Switch order of terms to prevent overflow Fixes rust-lang#89639 r? `@pnkfelix`
@rustbot label -I-prioritize |
The
ui/deriving/issue-89188-gat-hrtb.rs
test fails due to an arithmetic overflow when debug assertions are enabled.The offending code likely intends to use the explicit wrapping math methods, as the test does pass with the overflow.
The test was implemented in #89341
Backtrace
The text was updated successfully, but these errors were encountered: