Skip to content
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

Fails silently: match 1 {1 => 3, 2u => 4} #6209

Closed
ssbr opened this issue May 3, 2013 · 1 comment
Closed

Fails silently: match 1 {1 => 3, 2u => 4} #6209

ssbr opened this issue May 3, 2013 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ssbr
Copy link

ssbr commented May 3, 2013

Putting that code somewhere in a project will result in a failure to build, but (at least in rust 0.6, on windows) no error message.

Consider this shell session in mingw:

$ cat > test_mod.rs
fn main() {match 1 {1 => 3, 2u => 4};}
$ rustc.exe test_mod.rs
$ echo $?
101
$ RUST_LOG=rustc=1,::rt::backtrace rustc.exe test_mod.rs
rust: task failed at 'compare_const_vals: ill-typed comparison', C:\bot\slave\dist-win\build\src\librustc\middle\const_eval.rs:477
rust: domain main @0x459278 root task failed
yjh0502 added a commit to yjh0502/rust that referenced this issue May 22, 2013
bors added a commit that referenced this issue May 23, 2013
Fix issue #6209, and some related issues about constant expression
 - unmatched type between arms
 - unmatched type in range
@bblum bblum closed this as completed Jul 13, 2013
@bblum
Copy link
Contributor

bblum commented Jul 13, 2013

come on bors

flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 3, 2020
…=phansch

Update the existing arithmetic lint

re: rust-lang#6209

Updates the lint to not the error message if RHS of binary operation `/` of `%` is a literal/constant that is not `0` or `-1`, as suggested [here](rust-lang/rust-clippy#6209 (comment))

changelog: Expand [`integer_arithmetic`] to work with RHS literals and constants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants