1
Fork 0
This commit is contained in:
bjorn3 2025-02-08 22:12:13 +00:00
parent 3183b44a1e
commit 1fcae03369
287 changed files with 5888 additions and 4608 deletions

View file

@ -106,11 +106,10 @@ impl<'a> Parser<'a> {
self.parse_path_segments(&mut path.segments, style, None)?;
}
Ok((qself, Path {
segments: path.segments,
span: lo.to(self.prev_token.span),
tokens: None,
}))
Ok((
qself,
Path { segments: path.segments, span: lo.to(self.prev_token.span), tokens: None },
))
}
/// Recover from an invalid single colon, when the user likely meant a qualified path.
@ -485,13 +484,16 @@ impl<'a> Parser<'a> {
error.span_suggestion_verbose(
prev_token_before_parsing.span,
format!("consider removing the `::` here to {}", match style {
PathStyle::Expr => "call the expression",
PathStyle::Pat => "turn this into a tuple struct pattern",
_ => {
return;
format!(
"consider removing the `::` here to {}",
match style {
PathStyle::Expr => "call the expression",
PathStyle::Pat => "turn this into a tuple struct pattern",
_ => {
return;
}
}
}),
),
"",
Applicability::MaybeIncorrect,
);