mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
add test
This commit is contained in:
parent
7c8c28ce96
commit
167fe5fd7c
1 changed files with 76 additions and 0 deletions
|
@ -326,6 +326,17 @@ fn f() {}
|
||||||
// endregion
|
// endregion
|
||||||
fn g() {}
|
fn g() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn let_statements() {
|
||||||
|
let x = 42;
|
||||||
|
let mut y = x;
|
||||||
|
let Foo {
|
||||||
|
..
|
||||||
|
} = Foo { x };
|
||||||
|
if let None = Some(x) {}
|
||||||
|
_ = ();
|
||||||
|
let _ = g();
|
||||||
|
}
|
||||||
"#,
|
"#,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
[
|
[
|
||||||
|
@ -651,6 +662,71 @@ fn g() {}
|
||||||
),
|
),
|
||||||
deprecated: false,
|
deprecated: false,
|
||||||
},
|
},
|
||||||
|
StructureNode {
|
||||||
|
parent: None,
|
||||||
|
label: "let_statements",
|
||||||
|
navigation_range: 641..655,
|
||||||
|
node_range: 638..798,
|
||||||
|
kind: SymbolKind(
|
||||||
|
Function,
|
||||||
|
),
|
||||||
|
detail: Some(
|
||||||
|
"fn()",
|
||||||
|
),
|
||||||
|
deprecated: false,
|
||||||
|
},
|
||||||
|
StructureNode {
|
||||||
|
parent: Some(
|
||||||
|
26,
|
||||||
|
),
|
||||||
|
label: "x",
|
||||||
|
navigation_range: 668..669,
|
||||||
|
node_range: 664..675,
|
||||||
|
kind: SymbolKind(
|
||||||
|
Local,
|
||||||
|
),
|
||||||
|
detail: None,
|
||||||
|
deprecated: false,
|
||||||
|
},
|
||||||
|
StructureNode {
|
||||||
|
parent: Some(
|
||||||
|
26,
|
||||||
|
),
|
||||||
|
label: "mut y",
|
||||||
|
navigation_range: 684..689,
|
||||||
|
node_range: 680..694,
|
||||||
|
kind: SymbolKind(
|
||||||
|
Local,
|
||||||
|
),
|
||||||
|
detail: None,
|
||||||
|
deprecated: false,
|
||||||
|
},
|
||||||
|
StructureNode {
|
||||||
|
parent: Some(
|
||||||
|
26,
|
||||||
|
),
|
||||||
|
label: "Foo { .. }",
|
||||||
|
navigation_range: 703..725,
|
||||||
|
node_range: 699..738,
|
||||||
|
kind: SymbolKind(
|
||||||
|
Local,
|
||||||
|
),
|
||||||
|
detail: None,
|
||||||
|
deprecated: false,
|
||||||
|
},
|
||||||
|
StructureNode {
|
||||||
|
parent: Some(
|
||||||
|
26,
|
||||||
|
),
|
||||||
|
label: "_",
|
||||||
|
navigation_range: 788..789,
|
||||||
|
node_range: 784..796,
|
||||||
|
kind: SymbolKind(
|
||||||
|
Local,
|
||||||
|
),
|
||||||
|
detail: None,
|
||||||
|
deprecated: false,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue