Skip to content

Commit 2dd8629

Browse files
Stop considering _ as a keyword
1 parent 47075ae commit 2dd8629

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/html/highlight.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc_data_structures::fx::FxIndexMap;
1515
use rustc_lexer::{Cursor, FrontmatterAllowed, LiteralKind, TokenKind};
1616
use rustc_span::BytePos;
1717
use rustc_span::edition::Edition;
18-
use rustc_span::symbol::Symbol;
18+
use rustc_span::symbol::{Symbol, kw};
1919

2020
use super::format;
2121
use crate::clean::PrimitiveType;
@@ -1333,7 +1333,7 @@ impl<'src> Classifier<'src> {
13331333

13341334
fn is_keyword(symbol: Symbol) -> bool {
13351335
// FIXME(#148221): Don't hard-code the edition. The classifier should take it as an argument.
1336-
symbol.is_reserved(|| Edition::Edition2024)
1336+
symbol != kw::Underscore && symbol.is_reserved(|| Edition::Edition2024)
13371337
}
13381338

13391339
fn generate_link_to_def(

0 commit comments

Comments
 (0)