Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e9d49b2
Fix suggestions for `&a: T` parameters
WaffleLapkin Jun 10, 2022
2411692
Make preconditions of `check_pat_ref` & `borrow_pat_suggestion` clearer
WaffleLapkin Jun 13, 2022
451e030
Improve suggestion wording
WaffleLapkin Jun 13, 2022
dc2977e
check for inferred params in a clearer way
WaffleLapkin Jun 13, 2022
33ccd76
Remove trailing whitespace
WaffleLapkin Jun 13, 2022
a752f82
Ignore impl items because they can be duplicated in case of generic impl
GuillaumeGomez Jun 13, 2022
99cd9ca
Add regression test for #97986
GuillaumeGomez Jun 13, 2022
8a8404b
Inline `const_eval_select`
tmiasko Jun 13, 2022
df9fea2
Fix expand/collapse on source viewer sidebar folders
GuillaumeGomez Jun 14, 2022
a70c14a
Add GUI test for sidebar items expand/collapse
GuillaumeGomez Jun 14, 2022
5028d20
Add regression test for #93775
JohnTitor Jun 15, 2022
9aa1ccd
Fix `cfg(not)` and `cfg(all)` causing Rustdoc stab to disappear
SpriteOvO Jun 14, 2022
713578b
Exclude cfg "doc" and "doctest" from feature `doc_auto_cfg`
SpriteOvO Jun 14, 2022
2a8abe6
Rollup merge of #97964 - WaffleLapkin:fix_borrow_par_suggestions, r=c…
GuillaumeGomez Jun 15, 2022
046ff35
Rollup merge of #98053 - GuillaumeGomez:fix-generic-impl-json-ice, r=…
GuillaumeGomez Jun 15, 2022
143fa5e
Rollup merge of #98059 - tmiasko:inline-const-eval-select, r=Amanieu
GuillaumeGomez Jun 15, 2022
ca3b4c6
Rollup merge of #98092 - GuillaumeGomez:fix-sidebar-items-expand-coll…
GuillaumeGomez Jun 15, 2022
bb3d1ad
Rollup merge of #98108 - SpriteOvO:doc_auto_cfg-feature-rmv-fix, r=no…
GuillaumeGomez Jun 15, 2022
0a29cad
Rollup merge of #98135 - JohnTitor:issue-93022-93775, r=compiler-errors
GuillaumeGomez Jun 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Exclude cfg "doc" and "doctest" from feature doc_auto_cfg
  • Loading branch information
SpriteOvO committed Jun 15, 2022
commit 713578b82791523afa62803f02a9fc7eef2c3368
5 changes: 4 additions & 1 deletion src/librustdoc/visit_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
})
.collect::<Vec<_>>()
})
.chain([Cfg::Cfg(sym::test, None)].into_iter())
.chain(
[Cfg::Cfg(sym::test, None), Cfg::Cfg(sym::doc, None), Cfg::Cfg(sym::doctest, None)]
.into_iter(),
)
.collect();

self.cx.cache.exact_paths = self.exact_paths;
Expand Down
25 changes: 15 additions & 10 deletions src/test/rustdoc/doc-auto-cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,34 @@
#![crate_name = "foo"]

// @has foo/fn.foo.html
// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-doctest'
#[cfg(not(doctest))]
// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-meowmeow'
#[cfg(not(meowmeow))]
pub fn foo() {}

// @has foo/fn.bar.html
// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc'
// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow'
// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test'
#[cfg(any(test, doc))]
// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc'
// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doctest'
#[cfg(any(meowmeow, test, doc, doctest))]
pub fn bar() {}

// @has foo/fn.appear_1.html
// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc'
// @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(doc, not(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"]' 'doc'
// @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(doc, all(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"]' 'doc'
#[cfg(any(doc, all()))]
// @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