Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/librustdoc/passes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ pub(crate) const DEFAULT_PASSES: &[ConditionalPass] = &[
ConditionalPass::always(COLLECT_TRAIT_IMPLS),
ConditionalPass::always(CHECK_DOC_TEST_VISIBILITY),
ConditionalPass::always(CHECK_DOC_CFG),
ConditionalPass::always(COLLECT_INTRA_DOC_LINKS),
ConditionalPass::always(STRIP_ALIASED_NON_LOCAL),
ConditionalPass::new(STRIP_HIDDEN, WhenNotDocumentHidden),
ConditionalPass::new(STRIP_PRIVATE, WhenNotDocumentPrivate),
ConditionalPass::new(STRIP_PRIV_IMPORTS, WhenDocumentPrivate),
ConditionalPass::always(COLLECT_INTRA_DOC_LINKS),
ConditionalPass::always(PROPAGATE_DOC_CFG),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now, could you move the PROPAGATE_DOC_CFG pass somewhere above the STRIP_* ones to address #138907 (comment) and revert the change to tests/rustdoc-ui/invalid-cfg.rs you made in #138907 (i.e., make it private again and add an explanation) or do you want to do it in another PR?

My open PR #146529 is kinda blocked cuz I wanted to wait for all of these fixes ^^'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed elsewhere, it's gonna be done in a separate PR

ConditionalPass::always(PROPAGATE_STABILITY),
ConditionalPass::always(RUN_LINTS),
Expand Down
14 changes: 14 additions & 0 deletions tests/rustdoc-ui/intra-doc/hidden-check.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This test ensures that `doc(hidden)` items intra-doc links are checked whereas private
// items are ignored.

//@ compile-flags: -Zunstable-options --document-hidden-items

#![deny(rustdoc::broken_intra_doc_links)]

/// [not::exist]
//~^ ERROR unresolved link to `not::exist`
#[doc(hidden)]
pub struct X;

/// [not::exist]
struct Y;
14 changes: 14 additions & 0 deletions tests/rustdoc-ui/intra-doc/hidden-check.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: unresolved link to `not::exist`
--> $DIR/hidden-check.rs:8:6
|
LL | /// [not::exist]
| ^^^^^^^^^^ no item named `not` in scope
|
note: the lint level is defined here
--> $DIR/hidden-check.rs:6:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

14 changes: 14 additions & 0 deletions tests/rustdoc-ui/intra-doc/private-check.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This test ensures that private items intra-doc links are checked whereas `doc(hidden)`
// items are ignored.

//@ compile-flags: -Zunstable-options --document-private-items

#![deny(rustdoc::broken_intra_doc_links)]

/// [not::exist]
#[doc(hidden)]
pub struct X;

/// [not::exist]
//~^ ERROR unresolved link to `not::exist`
struct Y;
14 changes: 14 additions & 0 deletions tests/rustdoc-ui/intra-doc/private-check.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: unresolved link to `not::exist`
--> $DIR/private-check.rs:12:6
|
LL | /// [not::exist]
| ^^^^^^^^^^ no item named `not` in scope
|
note: the lint level is defined here
--> $DIR/private-check.rs:6:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

2 changes: 1 addition & 1 deletion tests/rustdoc-ui/issues/issue-91713.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Default passes for rustdoc:
collect-trait-impls
check_doc_test_visibility
check-doc-cfg
collect-intra-doc-links
strip-aliased-non-local
strip-hidden (when not --document-hidden-items)
strip-private (when not --document-private-items)
strip-priv-imports (when --document-private-items)
collect-intra-doc-links
propagate-doc-cfg
propagate-stability
run-lints
Expand Down
Loading