about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYoung-Flash <dongyang@apache.org>2024-01-03 20:07:53 +0800
committerYoung-Flash <dongyang@apache.org>2024-01-03 20:07:53 +0800
commit1a9b1b8cccdffa6d91c0ebec773ff433abd64128 (patch)
tree1c2bcc41b02de0f9ee0c62ac1531daa0471f3226
parent099c3204a2dbdc500baf1cd60c1647741c133724 (diff)
downloadrust-1a9b1b8cccdffa6d91c0ebec773ff433abd64128.tar.gz
rust-1a9b1b8cccdffa6d91c0ebec773ff433abd64128.zip
test: add test case for TupleField
-rw-r--r--crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs15
1 files changed, 15 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 074b8b79328..65e2a018477 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
@@ -468,6 +468,21 @@ enum Foo {
 }
 "#,
         );
+        check_assist(
+            extract_struct_from_enum_variant,
+            r#"
+enum Foo {
+    Nil(Box$0<Self>, Arc<Box<Self>>),
+}
+"#,
+            r#"
+struct Nil(Box<Foo>, Arc<Box<Foo>>);
+
+enum Foo {
+    Nil(Nil),
+}
+"#,
+        );
     }
 
     #[test]