mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 03:38:29 +00:00
Merge #8392
8392: Add space after lifetime in expand macro r=edwin0cheng a=sharksforarms When a lifetime is followed by an ident, this lead to invalid syntax. This adds a whitespace between the lifetime and the identifier. Noticed this here: https://github.com/simrat39/rust-tools.nvim/issues/2#issuecomment-814551847 Co-authored-by: Emmanuel Thompson <eet6646@gmail.com>
This commit is contained in:
commit
ad50f5007f
@ -103,6 +103,9 @@ fn insert_whitespaces(syn: SyntaxNode) -> String {
|
|||||||
format!("\n{}}}", " ".repeat(indent))
|
format!("\n{}}}", " ".repeat(indent))
|
||||||
}
|
}
|
||||||
R_CURLY => format!("}}\n{}", " ".repeat(indent)),
|
R_CURLY => format!("}}\n{}", " ".repeat(indent)),
|
||||||
|
LIFETIME_IDENT if is_next(|it| it == IDENT, true) => {
|
||||||
|
format!("{} ", token.text().to_string())
|
||||||
|
}
|
||||||
T![;] => format!(";\n{}", " ".repeat(indent)),
|
T![;] => format!(";\n{}", " ".repeat(indent)),
|
||||||
T![->] => " -> ".to_string(),
|
T![->] => " -> ".to_string(),
|
||||||
T![=] => " = ".to_string(),
|
T![=] => " = ".to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user