Unnamed repository; edit this file 'description' to name the repository.
add test case for nested generic arg with `Self`
| -rw-r--r-- | crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs b/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs index 3aa3069a23..9f81fd932f 100644 --- a/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs +++ b/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs @@ -467,6 +467,23 @@ enum Foo { } "#, ); + check_assist( + extract_struct_from_enum_variant, + r#" +enum Foo { + Bar $0{ node: Box<Self>, a: Arc<Box<Self>> }, + Nil, +} +"#, + r#" +struct Bar{ node: Box<Foo>, a: Arc<Box<Foo>> } + +enum Foo { + Bar(Bar), + Nil, +} +"#, + ); } #[test] |