We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
check_doc_keyword
1 parent a6a6d01 commit 9fb0defCopy full SHA for 9fb0def
compiler/rustc_passes/src/check_attr.rs
@@ -1041,11 +1041,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
1041
s <= kw::Union || s == sym::SelfTy
1042
}
1043
1044
- let doc_keyword = meta.value_str().unwrap_or(kw::Empty);
1045
- if doc_keyword == kw::Empty {
1046
- self.doc_attr_str_error(meta, "keyword");
1047
- return;
1048
- }
+ let doc_keyword = match meta.value_str() {
+ Some(value) if value != kw::Empty => value,
+ _ => return self.doc_attr_str_error(meta, "keyword"),
+ };
+
1049
let item_kind = match self.tcx.hir_node(hir_id) {
1050
hir::Node::Item(item) => Some(&item.kind),
1051
_ => None,
0 commit comments