File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments