On 08/17/2012 01:32 AM, Peter Hull wrote:
Just for my benefit, in Nathan's example:

match myfoo {
   bar => /* ... stuff ... */
}

where bar is not an enum, is bar now an exact synonym for myfoo?

Yes.


If so, maybe the compiler could warn that you probably didn't want to
do such a simple 1:1 binding? And maybe if you did want this binding,
you could suppress the warning by putting (bar), which is reminiscent
of a 1-element tuple, otherwise disallowed.


This would be a useful warning, though perhaps some of the other suggested warnings would also catch this error.

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

Reply via email to