Skip to content

Commit 532ba46

Browse files
Use path to refer to constants in cross-crate pattern tests
1 parent e68a5c6 commit 532ba46

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/test/ui/consts/const_in_pattern/cross-crate-fail.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
#![warn(indirect_structural_match)]
44

55
extern crate consts;
6-
use consts::*;
76

87
fn main() {
98
match None {
10-
SOME => panic!(),
9+
consts::SOME => panic!(),
1110
//~^ must be annotated with `#[derive(PartialEq, Eq)]`
1211
//~| must be annotated with `#[derive(PartialEq, Eq)]`
1312

Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
2-
--> $DIR/cross-crate-fail.rs:10:9
2+
--> $DIR/cross-crate-fail.rs:9:9
33
|
4-
LL | SOME => panic!(),
5-
| ^^^^
4+
LL | consts::SOME => panic!(),
5+
| ^^^^^^^^^^^^
66

77
error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
8-
--> $DIR/cross-crate-fail.rs:10:9
8+
--> $DIR/cross-crate-fail.rs:9:9
99
|
10-
LL | SOME => panic!(),
11-
| ^^^^
10+
LL | consts::SOME => panic!(),
11+
| ^^^^^^^^^^^^
1212

1313
error: aborting due to 2 previous errors
1414

src/test/ui/consts/const_in_pattern/cross-crate-pass.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#![warn(indirect_structural_match)]
55

66
extern crate consts;
7-
use consts::*;
7+
use consts::CustomEq;
88

99
fn main() {
1010
match Some(CustomEq) {
11-
NONE => panic!(),
11+
consts::NONE => panic!(),
1212
_ => {}
1313
}
1414
}

0 commit comments

Comments
 (0)