We already *do* do this, but not for guards because that's not possible.

On Sun, Jun 1, 2014 at 12:02 AM, Tommi <[email protected]> wrote:
> Would it be possible to get a compile-time error for a `match` branch that 
> can never be reached due to a previous branch encompassing it. For example, 
> for the middle branch here:
>
> let n = 0;
> match n {
>     x if x < 2 => (),
>     x if x < 1 => (),
>     _ => ()
> }
>
> If this is a too complicated a problem in the general case, then perhaps 
> there could be warnings for some (implementation defined) simple cases.
>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev



-- 
http://octayn.net/
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to