forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't process
[]
and ()
in intra-doc links
These caused several false positives when documenting rustc, which means there will likely be many more false positives in the rest of the ecosystem.
- Loading branch information
Showing
4 changed files
with
109 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#![deny(broken_intra_doc_links)] | ||
// These are links that could reasonably expected to work, but don't. | ||
|
||
// `[]` isn't supported because it had too many false positives. | ||
//! [X]([T]::not_here) | ||
//! [Y](&[]::not_here) | ||
//! [X]([]::not_here) | ||
//! [Y]([T;N]::not_here) | ||
// These don't work because markdown syntax doesn't allow it. | ||
//! [[T]::rotate_left] //~ ERROR unresolved link to `T` | ||
//! [&[]::not_here] | ||
//![Z]([T; N]::map) //~ ERROR unresolved link to `Z` | ||
//! [`[T; N]::map`] | ||
//! [[]::map] | ||
//! [Z][] //~ ERROR unresolved link to `Z` | ||
//! | ||
//! [Z]: [T; N]::map //~ ERROR unresolved link to `Z` | ||
// `()` isn't supported because it had too many false positives. | ||
//! [()::not_here] | ||
//! [X]((,)::not_here) | ||
//! [(,)::not_here] | ||
// FIXME: Associated items on some primitives aren't working, because the impls | ||
// are part of the compiler instead of being part of the source code. | ||
//! [unit::eq] //~ ERROR unresolved | ||
//! [tuple::eq] //~ ERROR unresolved | ||
//! [fn::eq] //~ ERROR unresolved | ||
//! [never::eq] //~ ERROR unresolved | ||
// FIXME(#78800): This breaks because it's a blanket impl | ||
// (I think? Might break for other reasons too.) | ||
//! [reference::deref] //~ ERROR unresolved |
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,69 @@ | ||
error: unresolved link to `T` | ||
--> $DIR/non-path-primitives.rs:11:7 | ||
| | ||
LL | //! [[T]::rotate_left] | ||
| ^ no item named `T` in scope | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/non-path-primitives.rs:1:9 | ||
| | ||
LL | #![deny(broken_intra_doc_links)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` | ||
|
||
error: unresolved link to `Z` | ||
--> $DIR/non-path-primitives.rs:13:5 | ||
| | ||
LL | //![Z]([T; N]::map) | ||
| ^ no item named `Z` in scope | ||
| | ||
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` | ||
|
||
error: unresolved link to `Z` | ||
--> $DIR/non-path-primitives.rs:16:6 | ||
| | ||
LL | //! [Z][] | ||
| ^ no item named `Z` in scope | ||
| | ||
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` | ||
|
||
error: unresolved link to `Z` | ||
--> $DIR/non-path-primitives.rs:18:6 | ||
| | ||
LL | //! [Z]: [T; N]::map | ||
| ^ no item named `Z` in scope | ||
| | ||
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` | ||
|
||
error: unresolved link to `unit::eq` | ||
--> $DIR/non-path-primitives.rs:27:6 | ||
| | ||
LL | //! [unit::eq] | ||
| ^^^^^^^^ the builtin type `unit` has no associated item named `eq` | ||
|
||
error: unresolved link to `tuple::eq` | ||
--> $DIR/non-path-primitives.rs:28:6 | ||
| | ||
LL | //! [tuple::eq] | ||
| ^^^^^^^^^ the builtin type `tuple` has no associated item named `eq` | ||
|
||
error: unresolved link to `fn::eq` | ||
--> $DIR/non-path-primitives.rs:29:6 | ||
| | ||
LL | //! [fn::eq] | ||
| ^^^^^^ the builtin type `fn` has no associated item named `eq` | ||
|
||
error: unresolved link to `never::eq` | ||
--> $DIR/non-path-primitives.rs:30:6 | ||
| | ||
LL | //! [never::eq] | ||
| ^^^^^^^^^ the builtin type `never` has no associated item named `eq` | ||
|
||
error: unresolved link to `reference::deref` | ||
--> $DIR/non-path-primitives.rs:34:6 | ||
| | ||
LL | //! [reference::deref] | ||
| ^^^^^^^^^^^^^^^^ the builtin type `reference` has no associated item named `deref` | ||
|
||
error: aborting due to 9 previous errors | ||
|
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