Skip to content

Commit e493800

Browse files
Remove FIXME comments about Cfg::parse in librustdoc cfg handling
1 parent dd09100 commit e493800

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustdoc/clean/cfg.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ fn handle_auto_cfg_hide_show(
671671
&& let MetaItemKind::List(items) = &item.kind
672672
{
673673
for item in items {
674-
// FIXME: Report in case `Cfg::parse` reports an error?
674+
// No need to report `Cfg::parse` errors, they are already handled in `rustc_passes`
675+
// and tested in `tests/rustdoc-ui/doc-cfg.rs`.
675676
if let Ok(Cfg::Cfg(key, value)) = Cfg::parse(item) {
676677
if is_show {
677678
if let Some(span) = new_hide_attrs.get(&(key, value)) {
@@ -840,6 +841,7 @@ pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator<Item = &'a hir::Attribute>
840841
&& let Some(ident) = attr.ident()
841842
&& matches!(ident.name, sym::cfg | sym::cfg_trace)
842843
&& let Some(attr) = single(attr.meta_item_list()?)
844+
// `cfg` attributes are already checked so no need to check `Cfg::parse` returned value.
843845
&& let Ok(new_cfg) = Cfg::parse(&attr)
844846
{
845847
cfg_info.current_cfg &= new_cfg;

0 commit comments

Comments
 (0)