mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 03:07:25 +00:00

rustdoc will not try to do intra-doc linking if the "path" of a link looks too much like a "real url". however, only inline links ([text](url)) can actually contain a url, other types of links (reference links, shortcut links) contain a *reference* which is later resolved to an actual url. the "path" in this case cannot be a url, and therefore it should not be skipped due to looking like a url. Co-authored-by: Michael Howell <michael@notriddle.com>
32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
error: unresolved link to `example.com`
|
|
--> $DIR/bad-intra-doc.rs:6:29
|
|
|
|
|
LL | /// this is not a link to [`example.com`]
|
|
| ^^^^^^^^^^^ no item named `example.com` in scope
|
|
|
|
|
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
|
|
note: the lint level is defined here
|
|
--> $DIR/bad-intra-doc.rs:2:9
|
|
|
|
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: unresolved link to `Foo.bar`
|
|
--> $DIR/bad-intra-doc.rs:10:33
|
|
|
|
|
LL | /// attempted link to method: [`Foo.bar()`]
|
|
| ^^^^^^^^^ no item named `Foo.bar` in scope
|
|
|
|
|
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
|
|
|
|
error: unresolved link to `Bar`
|
|
--> $DIR/bad-intra-doc.rs:12:38
|
|
|
|
|
LL | /// classic broken intra-doc link: [`Bar`]
|
|
| ^^^ no item named `Bar` in scope
|
|
|
|
|
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
|
|
|
|
error: aborting due to 3 previous errors
|
|
|