diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2022-01-06 16:38:25 +0200 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2022-01-06 16:38:25 +0200 |
| commit | e14d9208f5910d27c964ea306da8bd834251b162 (patch) | |
| tree | d86dd7440854c8031803a41e9eb490800e75a73a | |
| parent | 5c47eb6bf8c048bdda55549aaae82529d24b8e55 (diff) | |
| download | rust-e14d9208f5910d27c964ea306da8bd834251b162.tar.gz rust-e14d9208f5910d27c964ea306da8bd834251b162.zip | |
Move pretty-printing test out of assist
| -rw-r--r-- | crates/ide/src/expand_macro.rs | 19 | ||||
| -rw-r--r-- | crates/ide_assists/src/handlers/add_missing_impl_members.rs | 41 |
2 files changed, 19 insertions, 41 deletions
diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs index 69d2454cf7c..32dbd9070b9 100644 --- a/crates/ide/src/expand_macro.rs +++ b/crates/ide/src/expand_macro.rs @@ -307,6 +307,25 @@ fn main() { } #[test] + fn macro_expand_with_dyn_absolute_path() { + check( + r#" +macro_rules! foo { + () => {fn f<T>(_: &dyn ::std::marker::Copy) {}}; +} + +fn main() { + let res = fo$0o!(); +} +"#, + expect![[r#" + foo + fn f<T>(_: &dyn ::std::marker::Copy){} + "#]], + ); + } + + #[test] fn macro_expand_derive() { check( r#" 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 b6af72cbac5..a10eca10d11 100644 --- a/crates/ide_assists/src/handlers/add_missing_impl_members.rs +++ b/crates/ide_assists/src/handlers/add_missing_impl_members.rs @@ -942,45 +942,4 @@ 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!()} - } - -} -"#, - ) - } } |
