-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Improve error message for std integer clamp() if min > max #147754
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should instead just improve the default implementation of clamp to have a better error message...
|
The nicer error message requires |
|
r? libs |
|
@bors r+ I think this seems reasonable. I suspect that in 90% of cases just adding |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing ba2142a (parent) -> 5549523 (this PR) Test differencesNo test diffs found Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 554952348a7dd13851f25789f6bb1061f45c4b60 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (5549523): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -1.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.9%, secondary -2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 1.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 470.113s -> 471.938s (0.39%) |
|
We're hitting build errors in Chromium after this change (https://crbug.com/467060286): Specifically caused by the My understanding is that "error: The failure seems sensitive to what flags we pass, like Does this error make sense to anyone? |
|
A search of the rust-lang/compiler-builtins repository shows two calls to |
|
Thanks! Do you have any ideas for how to fix this? Could we somehow make the |
|
Looks like rust-lang/compiler-builtins#1047 will fix things. |
Improve error message for std integer clamp() if min > max For rust-lang#142309: change the error message for `Ord::clamp()` for std integer types if min > max to be more useful. Message is now `min > max. min = {min:?}, max = {max:?}` Also add `#[track_caller]` to `clamp()`
|
Thanks! We were waiting for it to roll. I'll give it a try. |
For #142309: change the error message for
Ord::clamp()for std integer types if min > max to be more useful.Message is now
min > max. min = {min:?}, max = {max:?}Also add
#[track_caller]toclamp()