File tree 2 files changed +33
-1
lines changed
2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -3101,7 +3101,7 @@ impl<'a> Parser<'a> {
3101
3101
}
3102
3102
} ,
3103
3103
_ => {
3104
- if enum_path. segments . len ( ) == 1 {
3104
+ if !enum_path . global && enum_path. segments . len ( ) == 1 {
3105
3105
// it could still be either an enum
3106
3106
// or an identifier pattern, resolve
3107
3107
// will sort it out:
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ deny( warnings) ]
12
+ #![ allow( unused_imports) ]
13
+
14
+ enum Foo { A }
15
+ mod bar {
16
+ pub fn normal ( x : :: Foo ) {
17
+ use A ;
18
+ match x {
19
+ A => { }
20
+ }
21
+ }
22
+ pub fn wrong ( x : :: Foo ) {
23
+ match x {
24
+ :: A => { }
25
+ }
26
+ }
27
+ }
28
+
29
+ pub fn main ( ) {
30
+ bar:: normal ( A ) ;
31
+ bar:: wrong ( A ) ;
32
+ }
You can’t perform that action at this time.
0 commit comments