-
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
Duplicate errors for overflowing division / remainder #69020
Labels
A-const-eval
Area: Constant evaluation (MIR interpretation)
C-bug
Category: This is a bug.
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
jonas-schievink
added
A-const-eval
Area: Constant evaluation (MIR interpretation)
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Feb 10, 2020
Basically the same issue also leads to duplicate errors for use std::i32;
pub trait Foo {
const N: i32;
}
impl<T: Foo> Foo for Vec<T> {
const N: i32 = -i32::MIN + T::N;
} shows
Here, the cause is that even in release builds, |
estebank
added
the
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
label
Feb 10, 2020
This was referenced Feb 10, 2020
jumbatm
added a commit
to jumbatm/rust
that referenced
this issue
Apr 2, 2020
Make sure we check the case where the generic operand comes first, in case any future changes make this ordering matter.
jumbatm
added a commit
to jumbatm/rust
that referenced
this issue
Apr 2, 2020
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this issue
Apr 3, 2020
…RalfJung Extend rust-lang#69020 test to include reversed operand order. Make sure we still emit if a lint if the generic argument comes first. See rust-lang#70566 (comment). r? @RalfJung
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 3, 2020
Rollup of 6 pull requests Successful merges: - rust-lang#70696 (Extend rust-lang#69020 test to include reversed operand order.) - rust-lang#70706 (Minor cleanup in rustdoc --check-theme) - rust-lang#70725 (Avoid `.unwrap()`s on `.span_to_snippet(...)`s) - rust-lang#70728 (Minor doc improvements on `AllocRef`) - rust-lang#70730 (Fix link in task::Wake docs) - rust-lang#70731 (Minor follow-up after renaming librustc(_middle)) Failed merges: r? @ghost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-const-eval
Area: Constant evaluation (MIR interpretation)
C-bug
Category: This is a bug.
D-verbose
Diagnostics: Too much output caused by a single piece of incorrect code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When there is an overflowing division or remainder operation that const_prop can detect, the error is duplicated in release mode only:
shows
This is because
!overflow_check
istrue
in release mode but divison and remainder still get overflow checks.(This test case already covers the problem, so a fix does not need a new test case, it just needs to adjust the existing test case to no longer expect two
ERROR
per line.)Cc @oli-obk @wesleywiser
The text was updated successfully, but these errors were encountered: