We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
check_doc_keyword
1 parent 0ed6c61 commit e306244Copy full SHA for e306244
compiler/rustc_passes/src/check_attr.rs
@@ -1024,11 +1024,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
1024
s <= kw::Union || s == sym::SelfTy
1025
}
1026
1027
- let doc_keyword = meta.value_str().unwrap_or(kw::Empty);
1028
- if doc_keyword == kw::Empty {
1029
- self.doc_attr_str_error(meta, "keyword");
1030
- return;
1031
- }
+ let doc_keyword = match meta.value_str() {
+ Some(value) if value != kw::Empty => value,
+ _ => return self.doc_attr_str_error(meta, "keyword"),
+ };
+
1032
let item_kind = match self.tcx.hir_node(hir_id) {
1033
hir::Node::Item(item) => Some(&item.kind),
1034
_ => None,
0 commit comments