1 An associated const has been referenced in a pattern.
3 Erroneous code example:
6 enum EFoo { A, B, C, D }
12 fn test<A: Foo>(arg: EFoo) {
21 `const` and `static` mean different things. A `const` is a compile-time
22 constant, an alias for a literal value. This property means you can match it
23 directly within a pattern.
25 The `static` keyword, on the other hand, guarantees a fixed location in memory.
26 This does not always mean that the value is constant. For example, a global
27 mutex can be declared `static` as well.
29 If you want to match against a `static`, consider using a guard instead:
32 static FORTY_TWO: i32 = 42;
35 Some(x) if x == FORTY_TWO => {}