Unnamed repository; edit this file 'description' to name the repository.
Fix spacing for LIFETIME_IDENT near keywords and literals in test output
Tadeo Kondrak 10 months ago
parent a7c0953 · commit 12226b7
-rw-r--r--crates/hir-def/src/macro_expansion_tests/mbe.rs2
-rw-r--r--crates/hir-def/src/macro_expansion_tests/mbe/regression.rs2
-rw-r--r--crates/hir-def/src/macro_expansion_tests/mod.rs12
3 files changed, 12 insertions, 4 deletions
diff --git a/crates/hir-def/src/macro_expansion_tests/mbe.rs b/crates/hir-def/src/macro_expansion_tests/mbe.rs
index ef93a2a790..c6d901ec93 100644
--- a/crates/hir-def/src/macro_expansion_tests/mbe.rs
+++ b/crates/hir-def/src/macro_expansion_tests/mbe.rs
@@ -2046,7 +2046,7 @@ macro_rules! m {
($($x:expr)'a*) => (stringify!($($x)'b*));
}
fn f() {
- let _ = stringify!(0 'b1 'b2);
+ let _ = stringify!(0 'b 1 'b 2);
}
"#]],
);
diff --git a/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs b/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs
index 2cc3ca8c75..e2022c7967 100644
--- a/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs
+++ b/crates/hir-def/src/macro_expansion_tests/mbe/regression.rs
@@ -784,7 +784,7 @@ macro_rules! delegate_impl {
}
}
}
-impl <> Data for &'amut G where G: Data {}
+impl <> Data for &'a mut G where G: Data {}
"#]],
);
}
diff --git a/crates/hir-def/src/macro_expansion_tests/mod.rs b/crates/hir-def/src/macro_expansion_tests/mod.rs
index b532156091..15b31c1e7e 100644
--- a/crates/hir-def/src/macro_expansion_tests/mod.rs
+++ b/crates/hir-def/src/macro_expansion_tests/mod.rs
@@ -308,8 +308,16 @@ fn pretty_print_macro_expansion(
{
" "
}
- (IDENT, _) if curr_kind.is_keyword(Edition::CURRENT) => " ",
- (_, IDENT) if prev_kind.is_keyword(Edition::CURRENT) => " ",
+ (IDENT | LIFETIME_IDENT, _)
+ if curr_kind.is_keyword(Edition::CURRENT) || curr_kind.is_literal() =>
+ {
+ " "
+ }
+ (_, IDENT | LIFETIME_IDENT)
+ if prev_kind.is_keyword(Edition::CURRENT) || prev_kind.is_literal() =>
+ {
+ " "
+ }
(T![>], IDENT) => " ",
(T![>], _) if curr_kind.is_keyword(Edition::CURRENT) => " ",
(T![->], _) | (_, T![->]) => " ",