]> git.lizzy.rs Git - rust.git/commitdiff
Add failing test case for issue 11100
authorJonas Platte <jplatte+git@posteo.de>
Wed, 5 Jan 2022 17:04:36 +0000 (18:04 +0100)
committerJonas Platte <jplatte+git@posteo.de>
Wed, 5 Jan 2022 17:04:36 +0000 (18:04 +0100)
crates/ide_assists/src/handlers/add_missing_impl_members.rs

index a10eca10d11946c1b350b0e1189b56c2d91d2de1..b6af72cbac547cdb1bf718ef3d21332c88e4c04b 100644 (file)
@@ -938,6 +938,47 @@ fn foo<'lt>(&'lt self) {}
 impl FooB for Foo {
     $0fn foo< 'lt>(& 'lt self){}
 
+}
+"#,
+        )
+    }
+
+    #[test]
+    fn macro_trait_dyn_absolute_path() {
+        // https://github.com/rust-analyzer/rust-analyzer/issues/11100
+        check_assist(
+            add_missing_impl_members,
+            r#"
+macro_rules! foo {
+    () => {
+        trait MacroTrait {
+            fn trait_method(_: &dyn ::core::marker::Sized);
+        }
+    }
+}
+foo!();
+struct Foo;
+
+impl MacroTrait for Foo {
+    $0
+}
+"#,
+            r#"
+macro_rules! foo {
+    () => {
+        trait MacroTrait {
+            fn trait_method(_: &dyn ::core::marker::Sized);
+        }
+    }
+}
+foo!();
+struct Foo;
+
+impl MacroTrait for Foo {
+    fn trait_method(_: &dyn ::core::marker::Sized) {
+        ${0:todo!()}
+    }
+
 }
 "#,
         )