]> git.lizzy.rs Git - rust.git/blob - tests/ui/binding/ambiguity-item.rs
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / binding / ambiguity-item.rs
1 // Identifier pattern referring to an ambiguity item is an error (issue #46079).
2
3 mod m {
4     pub fn f() {}
5 }
6 use m::*;
7
8 mod n {
9     pub fn f() {}
10 }
11 use n::*; // OK, no conflict with `use m::*;`
12
13 fn main() {
14     let v = f; //~ ERROR `f` is ambiguous
15     match v {
16         f => {} //~ ERROR `f` is ambiguous
17         mut f => {} // OK, unambiguously a fresh binding due to `mut`
18     }
19 }