forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#77276 - GuillaumeGomez:reexported-item-lints,…
… r=jyn514,ollie27 Warn on broken intra-doc links added to cross-crate re-exports This emits `broken_intra_doc_links` for docs applied to pub use statements that point to external items and are inlined. Does not address rust-lang#77200 - any existing broken links from the original crate will not show warnings. r? `@jyn514`
- Loading branch information
Showing
12 changed files
with
95 additions
and
19 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
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
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
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
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
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
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
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,4 @@ | ||
#![crate_name = "intra_doc_broken"] | ||
|
||
/// [not_found] | ||
pub fn foo() {} |
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,8 @@ | ||
// aux-build:intra-doc-broken.rs | ||
// check-pass | ||
|
||
#![deny(broken_intra_doc_links)] | ||
|
||
extern crate intra_doc_broken; | ||
|
||
pub use intra_doc_broken::foo; |
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,5 @@ | ||
#![deny(broken_intra_doc_links)] | ||
|
||
/// [aloha] | ||
//~^ ERROR unresolved link to `aloha` | ||
pub use std::task::RawWakerVTable; |
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,15 @@ | ||
error: unresolved link to `aloha` | ||
--> $DIR/pub-export-lint.rs:3:6 | ||
| | ||
LL | /// [aloha] | ||
| ^^^^^ no item named `aloha` in scope | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/pub-export-lint.rs:1:9 | ||
| | ||
LL | #![deny(broken_intra_doc_links)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` | ||
|
||
error: aborting due to previous error | ||
|
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,9 @@ | ||
#![crate_name = "foo"] | ||
|
||
// @!has 'foo/index.html' '//code' 'pub use self::i32;' | ||
// @has 'foo/index.html' '//tr[@class="module-item"]' 'i32' | ||
// @has 'foo/i32/index.html' | ||
pub use std::i32; | ||
// @!has 'foo/index.html' '//code' 'pub use self::string::String;' | ||
// @has 'foo/index.html' '//tr[@class="module-item"]' 'String' | ||
pub use std::string::String; |