Remove check keyword identifier check from rustdoc

This commit is contained in:
Guillaume Gomez 2020-12-02 10:44:19 +01:00
parent 9866136bec
commit 15f9453a26

View File

@ -169,19 +169,7 @@ impl Clean<ExternalCrate> for CrateNum {
for attr in attrs.lists(sym::doc) {
if attr.has_name(sym::keyword) {
if let Some(v) = attr.value_str() {
let k = v.to_string();
if !rustc_lexer::is_ident(&k) {
let sp = get_span(&attr).unwrap_or_else(|| attr.span());
cx.tcx
.sess
.struct_span_err(
sp,
&format!("`{}` is not a valid identifier", v),
)
.emit();
} else {
keyword = Some(k);
}
keyword = Some(v.to_string());
break;
}
}