Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: rustdoc-ui: Add issue-74134, replacing test/rustdoc/issue-74134-*
As per the discussion in PR #74147, the 4 individual tests are replaced by a single one. The test is expanded to cover all 4 public/private cases, each with and without --document-private-items.
- Loading branch information
1 parent
c8b16cd
commit 689e360
Showing
6 changed files
with
36 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
warning: `[PrivateType]` public documentation for `public_item` links to a private item | ||
--> $DIR/issue-74134.rs:19:10 | ||
| | ||
LL | /// [`PrivateType`] | ||
| ^^^^^^^^^^^^^ this item is private | ||
| | ||
= note: `#[warn(intra_doc_link_resolution_failure)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// revisions: public private | ||
// [private]compile-flags: --document-private-items | ||
// check-pass | ||
|
||
// There are 4 cases here: | ||
// 1. public item -> public type: no warning | ||
// 2. public item -> private type: warning, if --document-private-items is not passed | ||
// 3. private item -> public type: no warning | ||
// 4. private item -> private type: no warning | ||
// All 4 cases are tested with and without --document-private-items. | ||
// | ||
// Case 4 without --document-private-items is the one described in issue #74134. | ||
|
||
struct PrivateType; | ||
pub struct PublicType; | ||
|
||
pub struct Public { | ||
/// [`PublicType`] | ||
/// [`PrivateType`] | ||
//[public]~^ WARNING `[PrivateType]` public documentation for `public_item` links to a private item | ||
pub public_item: u32, | ||
|
||
/// [`PublicType`] | ||
/// [`PrivateType`] | ||
private_item: u32, | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.