From 15f9453a260ffc035ea3797c6939b1f61acd3e6d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 2 Dec 2020 10:44:19 +0100 Subject: [PATCH] Remove check keyword identifier check from rustdoc --- src/librustdoc/clean/mod.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index cd2700be5a741..a3c28be313792 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -169,19 +169,7 @@ impl Clean 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; } }