mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
complete full struct in enum varaint
This commit is contained in:
parent
67920f7975
commit
748567cba5
2 changed files with 43 additions and 4 deletions
|
@ -671,6 +671,45 @@ fn main() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn varaiant_with_struct() {
|
||||
check_empty(
|
||||
r#"
|
||||
pub struct YoloVariant {
|
||||
pub f: usize
|
||||
}
|
||||
|
||||
pub enum HH {
|
||||
Yolo(YoloVariant),
|
||||
}
|
||||
|
||||
fn brr() {
|
||||
let t = HH::Yolo(Y$0);
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
en HH
|
||||
fn brr() fn()
|
||||
st YoloVariant
|
||||
st YoloVariant {…} YoloVariant { f: usize }
|
||||
bt u32
|
||||
kw crate::
|
||||
kw false
|
||||
kw for
|
||||
kw if
|
||||
kw if let
|
||||
kw loop
|
||||
kw match
|
||||
kw return
|
||||
kw self::
|
||||
kw true
|
||||
kw unsafe
|
||||
kw while
|
||||
kw while let
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn return_unit_block() {
|
||||
cov_mark::check!(return_unit_block);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue