about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-01-06 10:48:54 +0000
committerGitHub <noreply@github.com>2022-01-06 10:48:54 +0000
commitc1d3b7a91ac84eaa8c7fd10834cbecbcd93610be (patch)
tree54bb7338505056f20f2cfe78d73c726282412302
parent2e33bf23c94e7053eb657d1a318bd1b66cabec95 (diff)
parentc90c88b083f2d7422882134999fca2a632152a46 (diff)
downloadrust-c1d3b7a91ac84eaa8c7fd10834cbecbcd93610be.tar.gz
rust-c1d3b7a91ac84eaa8c7fd10834cbecbcd93610be.zip
Merge #11207
11207: Always put a space after impl in macro pretty-printing r=Veykril a=jplatte

… regardless of whether the next symbol is punctuation or not.

Followup to #11200.

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
-rw-r--r--crates/ide/src/expand_macro.rs8
-rw-r--r--crates/ide_db/src/helpers/insert_whitespace_into_node.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs
index 949744c01b2..69d2454cf7c 100644
--- a/crates/ide/src/expand_macro.rs
+++ b/crates/ide/src/expand_macro.rs
@@ -319,7 +319,7 @@ struct Foo {}
 "#,
             expect![[r#"
                 Clone
-                impl< >core::clone::Clone for Foo< >{}
+                impl < >core::clone::Clone for Foo< >{}
 
             "#]],
         );
@@ -337,7 +337,7 @@ struct Foo {}
 "#,
             expect![[r#"
                 Copy
-                impl< >core::marker::Copy for Foo< >{}
+                impl < >core::marker::Copy for Foo< >{}
 
             "#]],
         );
@@ -354,9 +354,9 @@ struct Foo {}
 "#,
             expect![[r#"
                 Copy, Clone
-                impl< >core::marker::Copy for Foo< >{}
+                impl < >core::marker::Copy for Foo< >{}
 
-                impl< >core::clone::Clone for Foo< >{}
+                impl < >core::clone::Clone for Foo< >{}
 
             "#]],
         );
diff --git a/crates/ide_db/src/helpers/insert_whitespace_into_node.rs b/crates/ide_db/src/helpers/insert_whitespace_into_node.rs
index 9d31966cea6..d59f13b9a1c 100644
--- a/crates/ide_db/src/helpers/insert_whitespace_into_node.rs
+++ b/crates/ide_db/src/helpers/insert_whitespace_into_node.rs
@@ -88,7 +88,7 @@ pub fn insert_ws_into(syn: SyntaxNode) -> SyntaxNode {
             LIFETIME_IDENT if is_next(|it| is_text(it), true) => {
                 mods.push(do_ws(after, tok));
             }
-            AS_KW | DYN_KW => {
+            AS_KW | DYN_KW | IMPL_KW => {
                 mods.push(do_ws(after, tok));
             }
             T![;] => {