You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
assertion failure in trans_alt when combining if, nested patterns #3121
;RUST_LOG=rustc=0 rustc ~/tmp/pat-bug-in-trans.rs
rust: task failed at 'Assertion m.len() > 0u || is_some(chk) failed', /Users/nmatsakis/versioned/rust-gold/src/rustc/middle/trans/alt.rs:431
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /Users/nmatsakis/versioned/rust-gold/src/rustc/driver/rustc.rs:264
rust: domain main @0x7f8d99800010 root task failed
rust: task failed at 'killed', /Users/nmatsakis/versioned/rust-gold/src/libcore/task.rs:520
The problem has to do with the if, something in the logic there gets a bit confused.
I have a fix for this; running tests. Basically, enter_default needs to know whether a pattern has a guard, and not consider a guarded pattern to be a default.
Activity
catamorphism commentedon Aug 7, 2012
This looks very similar to #2869
catamorphism commentedon Dec 8, 2012
I have a fix for this; running tests. Basically,
enter_defaultneeds to know whether a pattern has a guard, and not consider a guarded pattern to be a default.catamorphism commentedon Dec 8, 2012
Oops, it's not as simple as that. Still working on it.
graydon commentedon Dec 18, 2012
Bumping this since it can always be worked around. Should fix but non blocking.
pnkfelix commentedon Mar 22, 2013
Not critical for 0.6; de-milestoning
catamorphism commentedon May 7, 2013
Nominating for milestone 5, production-ready. I have an old branch that partially fixes it, but it needs more work.
graydon commentedon Jun 13, 2013
reproduced, and people run into it often, sure
graydon commentedon Jun 13, 2013
accepted for production-ready milestone
jasom commentedon Jul 16, 2013
Is this fixed in 0.7? I think I've run into it recently. Is there a workaround?
pnkfelix commentedon Jul 16, 2013
@jasom: combine the caes with the same patterns, moving their
ifs to the right-hand side of the pattern?Don't treat guarded patterns as default patterns
msullivan commentedon Aug 9, 2013
I think I have a pretty good idea of how to fix this, although it seems a little subtle/hacky.
Fix interaction between default matches and guards. Closes rust-lang#…
Auto merge of rust-lang#3121 - rust-lang:rustup-2023-10-14, r=saethlin
Merge rust-lang#3121