File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ mod m {
28
28
}
29
29
30
30
fn g ( ) {
31
- use m:: aha;
31
+ use self :: m:: aha;
32
32
let r = match ( 0 , 0 ) {
33
33
( 0 , aha) => 0 ,
34
34
//~^ ERROR static constant in pattern should be all caps
@@ -37,7 +37,22 @@ fn g() {
37
37
assert ! ( r == 1 ) ;
38
38
}
39
39
40
+ mod n {
41
+ pub static OKAY : int = 8 ;
42
+ }
43
+
44
+ fn h ( ) {
45
+ use not_okay = self :: n:: OKAY ;
46
+ let r = match ( 0 , 0 ) {
47
+ ( 0 , not_okay) => 0 ,
48
+ //~^ ERROR static constant in pattern should be all caps
49
+ ( x, y) => 1 + x + y,
50
+ } ;
51
+ assert ! ( r == 1 ) ;
52
+ }
53
+
40
54
fn main ( ) {
41
55
f ( ) ;
42
56
g ( ) ;
57
+ h ( ) ;
43
58
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ mod m {
38
38
}
39
39
40
40
fn g ( ) {
41
- use AHA = m:: aha;
41
+ use AHA = self :: m:: aha;
42
42
let r = match ( 0 , 0 ) {
43
43
( 0 , AHA ) => 0 ,
44
44
( x, y) => 1 + x + y,
@@ -53,12 +53,12 @@ fn g() {
53
53
54
54
fn h ( ) {
55
55
let r = match ( 0 , 0 ) {
56
- ( 0 , m:: aha) => 0 ,
56
+ ( 0 , self :: m:: aha) => 0 ,
57
57
( x, y) => 1 + x + y,
58
58
} ;
59
59
assert ! ( r == 1 ) ;
60
60
let r = match ( 0 , 7 ) {
61
- ( 0 , m:: aha) => 0 ,
61
+ ( 0 , self :: m:: aha) => 0 ,
62
62
( x, y) => 1 + x + y,
63
63
} ;
64
64
assert ! ( r == 0 ) ;
You can’t perform that action at this time.
0 commit comments