Hi,
Here is a strange bug I came across:
use m::EntityType;
mod m {
pub enum EntityType {
Type1,
Type2,
}
}
fn do_match(t1: EntityType, t2: EntityType) {
match (t1, t2) {
(Type1, Type1) => (),
(Type2, Type2) => (),
(Type1, Type2) => (),
(Type2, Type1) => (),
}
}
fn main() {}
This code fails to compile with:
<anon>:12:17: 12:22 error: identifier `Type1` is bound more than once in the same pattern
<anon>:12 (Type1, Type1) => (),
^~~~~
<anon>:13:17: 13:22 error: identifier `Type2` is bound more than once in the same pattern
<anon>:13 (Type2, Type2) => (),
^~~~~
error: aborting due to 2 previous errors
playpen: application terminated with error code 101
But it works if we remove the mod block and the use statement, thus putting EntityType in the same namespace.
Tested on master
Hi,
Here is a strange bug I came across:
This code fails to compile with:
But it works if we remove the mod block and the use statement, thus putting EntityType in the same namespace.
Tested on master