Skip to content

Commit

Permalink
Fix tools
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Jun 14, 2024
1 parent 19485a6 commit aeba0f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ impl<'src> Classifier<'src> {
| TokenKind::UnknownPrefix
| TokenKind::InvalidPrefix
| TokenKind::InvalidIdent => Class::Ident(self.new_span(before, text)),
TokenKind::Lifetime { .. } => Class::Lifetime,
TokenKind::Lifetime { .. } | TokenKind::RawLifetime => Class::Lifetime,
TokenKind::Eof => panic!("Eof in advance"),
};
// Anything that didn't return above is the simple case where we the
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rustfmt/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ fn force_space_before(tok: &TokenKind) -> bool {
fn ident_like(tok: &Token) -> bool {
matches!(
tok.kind,
TokenKind::Ident(..) | TokenKind::Literal(..) | TokenKind::Lifetime(_)
TokenKind::Ident(..) | TokenKind::Literal(..) | TokenKind::Lifetime(..)
)
}

Expand All @@ -1097,7 +1097,7 @@ fn next_space(tok: &TokenKind) -> SpaceState {
| TokenKind::OpenDelim(_)
| TokenKind::CloseDelim(_) => SpaceState::Never,

TokenKind::Literal(..) | TokenKind::Ident(..) | TokenKind::Lifetime(_) => SpaceState::Ident,
TokenKind::Literal(..) | TokenKind::Ident(..) | TokenKind::Lifetime(..) => SpaceState::Ident,

_ => SpaceState::Always,
}
Expand Down

0 comments on commit aeba0f5

Please sign in to comment.