Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_assists/src/handlers/add_missing_impl_members.rs')
-rw-r--r--crates/ide_assists/src/handlers/add_missing_impl_members.rs41
1 files changed, 41 insertions, 0 deletions
diff --git a/crates/ide_assists/src/handlers/add_missing_impl_members.rs b/crates/ide_assists/src/handlers/add_missing_impl_members.rs
index a10eca10d1..b6af72cbac 100644
--- a/crates/ide_assists/src/handlers/add_missing_impl_members.rs
+++ b/crates/ide_assists/src/handlers/add_missing_impl_members.rs
@@ -942,4 +942,45 @@ impl FooB for Foo {
"#,
)
}
+
+ #[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!()}
+ }
+
+}
+"#,
+ )
+ }
}