Closed
Description
enum Foo { A }
mod bar {
pub fn normal(x: ::Foo) {
use A;
match x {
A => {}
}
}
pub fn wrong(x: ::Foo) {
match x {
::A => {}
}
}
}
fn main() { bar::normal(A); bar::wrong(A); }
global-path-match.rs:11:13: 11:16 warning: unused variable: `A`, #[warn(unused_variable)] on by default
global-path-match.rs:11 ::A => {}
^~~
global-path-match.rs:11:13: 11:16 warning: variable names should start with a lowercase character, #[warn(uppercase_variables)] on by default
global-path-match.rs:11 ::A => {}
^~~
That is, it's not obeying the global part of the path and instead just creating a variable with the name A
.