mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Update fixed tests
This commit is contained in:
parent
e837df8479
commit
244d8e37f1
3 changed files with 21 additions and 18 deletions
|
@ -1495,6 +1495,20 @@ fn main(f: Foo) {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn internal_or() {
|
||||
check_diagnostics(
|
||||
r#"
|
||||
fn main() {
|
||||
enum Either { A(bool), B }
|
||||
match Either::B {
|
||||
//^^^^^^^^^ Missing match arm
|
||||
Either::A(true | false) => (),
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
mod false_negatives {
|
||||
//! The implementation of match checking here is a work in progress. As we roll this out, we
|
||||
//! prefer false negatives to false positives (ideally there would be no false positives). This
|
||||
|
@ -1518,21 +1532,6 @@ fn main() {
|
|||
11..20 => (),
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn internal_or() {
|
||||
// We do not currently handle patterns with internal `or`s.
|
||||
check_diagnostics(
|
||||
r#"
|
||||
fn main() {
|
||||
enum Either { A(bool), B }
|
||||
match Either::B {
|
||||
Either::A(true | false) => (),
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2418,13 +2418,15 @@ fn infer_const_params() {
|
|||
|
||||
#[test]
|
||||
fn infer_inner_type() {
|
||||
check_infer(r#"
|
||||
check_infer(
|
||||
r#"
|
||||
fn foo() {
|
||||
struct S { field: u32 }
|
||||
let s = S { field: 0 };
|
||||
let f = s.field;
|
||||
}
|
||||
"#, expect![[r#"
|
||||
"#,
|
||||
expect![[r#"
|
||||
9..89 '{ ...eld; }': ()
|
||||
47..48 's': S
|
||||
51..65 'S { field: 0 }': S
|
||||
|
@ -2432,5 +2434,6 @@ fn infer_inner_type() {
|
|||
75..76 'f': u32
|
||||
79..80 's': S
|
||||
79..86 's.field': u32
|
||||
"#]]);
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -654,6 +654,7 @@ fn main() {
|
|||
let test = "test";
|
||||
//^^^^ &str
|
||||
let test = InnerStruct {};
|
||||
//^^^^ InnerStruct
|
||||
|
||||
let test = unresolved();
|
||||
|
||||
|
|
Loading…
Reference in a new issue