fix: flyimport triggers on enum variant declarations

This commit is contained in:
zhoufan 2021-11-14 12:16:21 +08:00
parent 766b52b598
commit 5666046ec9
4 changed files with 38 additions and 0 deletions

View file

@ -1012,3 +1012,34 @@ use self as Str$0;
expect![[r#""#]],
);
}
#[test]
fn flyimport_enum_variant() {
check(
r#"
mod foo {
pub struct Barbara;
}
enum Foo {
Barba$0()
}
}"#,
expect![[r#""#]],
);
check(
r#"
mod foo {
pub struct Barbara;
}
enum Foo {
Barba(Barba$0)
}
}"#,
expect![[r#"
st Barbara (use foo::Barbara)
"#]],
)
}