Skip to content

Commit 06f4690

Browse files
committed
fix tests for check-fast.
1 parent 155857f commit 06f4690

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/test/compile-fail/match-static-const-lc.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod m {
2828
}
2929

3030
fn g() {
31-
use m::aha;
31+
use self::m::aha;
3232
let r = match (0,0) {
3333
(0, aha) => 0,
3434
//~^ ERROR static constant in pattern should be all caps
@@ -37,7 +37,22 @@ fn g() {
3737
assert!(r == 1);
3838
}
3939

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+
4054
fn main () {
4155
f();
4256
g();
57+
h();
4358
}

src/test/run-pass/match-static-const-rename.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mod m {
3838
}
3939

4040
fn g() {
41-
use AHA = m::aha;
41+
use AHA = self::m::aha;
4242
let r = match (0,0) {
4343
(0, AHA) => 0,
4444
(x, y) => 1 + x + y,
@@ -53,12 +53,12 @@ fn g() {
5353

5454
fn h() {
5555
let r = match (0,0) {
56-
(0, m::aha) => 0,
56+
(0, self::m::aha) => 0,
5757
(x, y) => 1 + x + y,
5858
};
5959
assert!(r == 1);
6060
let r = match (0,7) {
61-
(0, m::aha) => 0,
61+
(0, self::m::aha) => 0,
6262
(x, y) => 1 + x + y,
6363
};
6464
assert!(r == 0);

0 commit comments

Comments
 (0)