Skip to content

Commit caff0ba

Browse files
Stop considering _ as a keyword
1 parent bc84246 commit caff0ba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/librustdoc/html/highlight.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,11 @@ impl<'a> Iterator for TokenIter<'a> {
785785

786786
/// Classifies into identifier class; returns `None` if this is a non-keyword identifier.
787787
fn get_real_ident_class(text: &str, allow_path_keywords: bool) -> Option<Class> {
788-
let ignore: &[&str] =
789-
if allow_path_keywords { &["self", "Self", "super", "crate"] } else { &["self", "Self"] };
788+
let ignore: &[&str] = if allow_path_keywords {
789+
&["self", "Self", "super", "crate", "_"]
790+
} else {
791+
&["self", "Self", "_"]
792+
};
790793
if ignore.contains(&text) {
791794
return None;
792795
}

0 commit comments

Comments
 (0)