mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 14:24:08 +00:00
Use path to refer to constants in cross-crate pattern tests
This commit is contained in:
parent
e68a5c6800
commit
532ba46402
@ -3,11 +3,10 @@
|
||||
#![warn(indirect_structural_match)]
|
||||
|
||||
extern crate consts;
|
||||
use consts::*;
|
||||
|
||||
fn main() {
|
||||
match None {
|
||||
SOME => panic!(),
|
||||
consts::SOME => panic!(),
|
||||
//~^ must be annotated with `#[derive(PartialEq, Eq)]`
|
||||
//~| must be annotated with `#[derive(PartialEq, Eq)]`
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
|
||||
--> $DIR/cross-crate-fail.rs:10:9
|
||||
--> $DIR/cross-crate-fail.rs:9:9
|
||||
|
|
||||
LL | SOME => panic!(),
|
||||
| ^^^^
|
||||
LL | consts::SOME => panic!(),
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
|
||||
--> $DIR/cross-crate-fail.rs:10:9
|
||||
--> $DIR/cross-crate-fail.rs:9:9
|
||||
|
|
||||
LL | SOME => panic!(),
|
||||
| ^^^^
|
||||
LL | consts::SOME => panic!(),
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -4,11 +4,11 @@
|
||||
#![warn(indirect_structural_match)]
|
||||
|
||||
extern crate consts;
|
||||
use consts::*;
|
||||
use consts::CustomEq;
|
||||
|
||||
fn main() {
|
||||
match Some(CustomEq) {
|
||||
NONE => panic!(),
|
||||
consts::NONE => panic!(),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user