Skip to content

Commit e14d920

Browse files
committed
Move pretty-printing test out of assist
1 parent 5c47eb6 commit e14d920

File tree

2 files changed

+19
-41
lines changed

2 files changed

+19
-41
lines changed

crates/ide/src/expand_macro.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,25 @@ fn main() {
306306
);
307307
}
308308

309+
#[test]
310+
fn macro_expand_with_dyn_absolute_path() {
311+
check(
312+
r#"
313+
macro_rules! foo {
314+
() => {fn f<T>(_: &dyn ::std::marker::Copy) {}};
315+
}
316+
317+
fn main() {
318+
let res = fo$0o!();
319+
}
320+
"#,
321+
expect![[r#"
322+
foo
323+
fn f<T>(_: &dyn ::std::marker::Copy){}
324+
"#]],
325+
);
326+
}
327+
309328
#[test]
310329
fn macro_expand_derive() {
311330
check(

crates/ide_assists/src/handlers/add_missing_impl_members.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -938,47 +938,6 @@ 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-
982941
}
983942
"#,
984943
)

0 commit comments

Comments
 (0)