Path patterns are patterns that refer either to constant values or to structs or enum variants that have no fields.
Unqualified path patterns can refer to:
enum variants, structs, constants, associated constants
Qualified path patterns can only refer to associated constants.
I created this example for this:
mod m { pub mod n { pub const CONST: i32 = 1; pub struct S; pub enum E { V, } pub struct A; impl A { pub const ASSOC_CONST: i32 = 2; } }}fn main() { let v = 10; match v { m::n::CONST => (), m::n::A::ASSOC_CONST => (), _ => (), } let v = m::n::S {}; match v { m::n::S {} => (), } let v = m::n::E::V; match v { m::n::E::V => (), }}
And it compiles without an issue even though I use qualified path patterns. Shouldn't this fail for anything but associated constants in the example?