-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix const_err with -(-0.0)
#64063
Fix const_err with -(-0.0)
#64063
Conversation
I'm surprised this change doesn't cause any reduction in duplicate diagnostics... Not sure what's going on. If I'm grepping correctly, we don't have a single test running in debug mode and thus producing double the warnings that release mode does. Can you add a test with |
Super thanks @bors r+ |
📌 Commit a937d8c has been approved by |
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Failed in #64122 (comment), @bors r- |
I'm not sure why the test is failed in |
@@ -0,0 +1,59 @@ | |||
// compile-flags: -C overflow-checks=on -O |
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.
Maybe noopt overwrites this -O
? That would be weird. Also weird that noopt causes fewer diagnostics... I'm not sure what's going on. You can undo the changes unrelated to -(-0.0)
if you want so we can get the PR merged and open an issue about not being able to test noopt properly.
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.
The weird thing is that it happened in issue-8460-const.rs
not issue-8460-const2.rs
. issue-8460-const.rs
has no compile flags.
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.
Oh. That may explain it... not sure what the best thing to do here is. Maybe instead of copying the files we should use the scheme where one test is built in multiple modes? I forget what the appropriate flags are, but incremental has loads of them
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.
Or could we add the -O
flag to issue-8460-const.rs
? The other tests we touch have this flag but that doesn't.
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.
If that solves it, sure
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 added the flag to the test, could we run bors try
?
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.
You can test this locally by setting
Line 355 in b9de4ef
#optimize-tests = true |
config.toml
Unfortunately bors try
won't run the noopt tests, so that's the only way to test
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.
Oh, I didn't know that.
I created config.toml
with optimize-tests = false
and ran x.py test src/test/ui --stage=1 --bless --config config.toml
, the test seems passed.
// We check overflow in debug mode already | ||
// so should only check in release mode. | ||
if !oflo_check | ||
&& prim.layout.ty.is_signed() |
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.
essentially this condition the only needed thing for the fix. The rest is what's causing the CI failure
@bors r+ |
📌 Commit 41deb83 has been approved by |
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Rollup of 11 pull requests Successful merges: - #62848 (Use unicode-xid crate instead of libcore) - #63774 (Fix `window.hashchange is not a function`) - #63930 (Account for doc comments coming from proc macros without spans) - #64003 (place: Passing `align` = `layout.align.abi`, when also passing `layout`) - #64030 (Fix unlock ordering in SGX synchronization primitives) - #64041 (use TokenStream rather than &[TokenTree] for built-in macros) - #64051 (Add x86_64-linux-kernel target) - #64063 (Fix const_err with `-(-0.0)`) - #64083 (Point at appropriate arm on type error on if/else/match with one non-! arm) - #64100 (Fix const eval bug breaking run-pass tests in Miri) - #64157 (Opaque type locations in error message for clarity.) Failed merges: r? @ghost
Fixes #64059
r? @oli-obk