Change:
Context: CC
Thanks for opening this issue! Someone from the rustdoc team will try to get back to it whenever possible.
It doesn't look too difficult. I'm going to try to make a PR for it myself, and I'll update here with or without progress.
Even better! :smile: I'll assign you to the issue in the meantime then.

Discussion:
}), }, MetaItemKind::List(ref items) => { <ins> let orig_len = items.len(); </ins> let sub_cfgs = items.iter().filter_map(|i| Cfg::parse_nested(i, exclude).transpose()); let ret = match name { sym::all => sub_cfgs.fold(Ok(Cfg::True), |x, y| Ok(x? & y?)), sym::any => sub_cfgs.fold(Ok(Cfg::False), |x, y| Ok(x? | y?)), sym::not => { <del> let mut sub_cfgs = sub_cfgs.collect::<Vec<_>>(); if sub_cfgs.len() == 1 { Ok(!sub_cfgs.pop().unwrap()?) </del> <ins> if orig_len == 1 { let mut sub_cfgs = sub_cfgs.collect::<Vec<_>>(); if sub_cfgs.len() == 1 { Ok(!sub_cfgs.pop().unwrap()?) } else { return Ok(None); } </ins> } else { Err(InvalidCfgError { msg: "expected 1 cfg-pattern", span: cfg.span }) }

impl ops::BitOrAssign for Cfg { fn bitor_assign(&mut self, other: Cfg) { match (self, other) { <del> (&mut Cfg::True, _) | (_, Cfg::False) => {} (s, Cfg::True) => *s = Cfg::True, </del> <ins> (Cfg::True, _) | (_, Cfg::False) | (_, Cfg::True) => {} </ins> (s @ &mut Cfg::False, b) => *s = b, (&mut Cfg::Any(ref mut a), Cfg::Any(ref mut b)) => { for c in b.drain(..) {

x = word_cfg("test"); x |= Cfg::True; <del> assert_eq!(x, Cfg::True); </del> <ins> assert_eq!(x, word_cfg("test")); </ins> x = word_cfg("test2"); x |= Cfg::False;

}) .collect::<Vec<_>>() }) <del> .chain([Cfg::Cfg(sym::test, None)].into_iter()) </del> <ins> .chain( [Cfg::Cfg(sym::test, None), Cfg::Cfg(sym::doc, None), Cfg::Cfg(sym::doctest, None)] .into_iter(), ) </ins> .collect(); self.cx.cache.exact_paths = self.exact_paths;

#![feature(doc_auto_cfg)] #![crate_name = "foo"] // @has foo/fn.foo.html <del> // @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-doctest' #[cfg(not(doctest))] </del> <ins> // @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-meowmeow' #[cfg(not(meowmeow))] </ins> pub fn foo() {} // @has foo/fn.bar.html <del> // @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' </del> <ins> // @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' </ins> // @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test' <del> #[cfg(any(test, doc))] </del> <ins> // @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' // @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doctest' #[cfg(any(meowmeow, test, doc, doctest))] </ins> pub fn bar() {} <ins> // @has foo/fn.appear_1.html // @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' // @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' // @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-test' #[cfg(any(meowmeow, doc, not(test)))] pub fn appear_1() {} // issue #98065 // @has foo/fn.appear_2.html // @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' // @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' // @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test' #[cfg(any(meowmeow, doc, all(test)))] pub fn appear_2() {} // issue #98065 // @has foo/fn.appear_3.html // @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow' // @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc' #[cfg(any(meowmeow, doc, all()))] pub fn appear_3() {} // issue #98065 </ins>