mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
feat: Implement default-field-values
This commit is contained in:
parent
35b55fd67f
commit
7de0b2e75a
33 changed files with 647 additions and 31 deletions
|
|
@ -1232,6 +1232,21 @@ fn f() {
|
|||
let (_, _, _, ..) = (true, 42);
|
||||
// ^^^^^^^^^^^^^ error: expected (bool, i32), found (bool, i32, {unknown})
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn diagnostics_inside_field_default_expr() {
|
||||
check_diagnostics(
|
||||
r#"
|
||||
struct Foo {
|
||||
foo: i32 = {
|
||||
let x = false;
|
||||
x
|
||||
// ^ error: expected i32, found bool
|
||||
},
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue