-
Notifications
You must be signed in to change notification settings - Fork 14k
Use overflow_checks intrinsic so IterRangeFrom yields MAX before panicking in debug
#148703
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
base: master
Are you sure you want to change the base?
Conversation
check overflow after yielding MAX value `0_u8..` will yield `255` and only panic on the subsequent `next()`
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the CTFE machinery Some changes occurred to constck cc @fee1-dead Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Use `overflow_checks` intrinsic so `IterRangeFrom` yields MAX before panicking in debug
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (9714d5d): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -2.3%, secondary -4.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.5%, secondary 2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 475.809s -> 478.419s (0.55%) |
Based on #128666. For your convenience, here is the diff from that PR.
When
overflow_checksare enabled, the following code will output as shownWhich is a change from the current behavior, where it will panic after printing 254.
This behavior was requested by the libs team
r? @Mark-Simulacrum