Skip to content

Commit f5b789b

Browse files
committed
Add failing test case for issue 11100
1 parent 67f3b51 commit f5b789b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

crates/ide_assists/src/handlers/add_missing_impl_members.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,47 @@ struct Foo(usize);
938938
impl FooB for Foo {
939939
$0fn foo< 'lt>(& 'lt self){}
940940
941+
}
942+
"#,
943+
)
944+
}
945+
946+
#[test]
947+
fn macro_trait_dyn_absolute_path() {
948+
// https://github.com/rust-analyzer/rust-analyzer/issues/11100
949+
check_assist(
950+
add_missing_impl_members,
951+
r#"
952+
macro_rules! foo {
953+
() => {
954+
trait MacroTrait {
955+
fn trait_method(_: &dyn ::core::marker::Sized);
956+
}
957+
}
958+
}
959+
foo!();
960+
struct Foo;
961+
962+
impl MacroTrait for Foo {
963+
$0
964+
}
965+
"#,
966+
r#"
967+
macro_rules! foo {
968+
() => {
969+
trait MacroTrait {
970+
fn trait_method(_: &dyn ::core::marker::Sized);
971+
}
972+
}
973+
}
974+
foo!();
975+
struct Foo;
976+
977+
impl MacroTrait for Foo {
978+
fn trait_method(_: &dyn ::core::marker::Sized) {
979+
${0:todo!()}
980+
}
981+
941982
}
942983
"#,
943984
)

0 commit comments

Comments
 (0)