Don't panic when an external crate can't be resolved
This isn't actually a bug, it can occur when rustdoc tries to resolve a crate that isn't used in the main code.
This commit is contained in:
parent
3ffea60dd5
commit
7edd1810b4
3 changed files with 24 additions and 5 deletions
5
src/test/rustdoc-ui/intra-doc/unused-extern-crate.rs
Normal file
5
src/test/rustdoc-ui/intra-doc/unused-extern-crate.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// compile-flags: --extern zip=whatever.rlib
|
||||
#![deny(broken_intra_doc_links)]
|
||||
/// See [zip] crate.
|
||||
//~^ ERROR unresolved
|
||||
pub struct ArrayZip;
|
||||
15
src/test/rustdoc-ui/intra-doc/unused-extern-crate.stderr
Normal file
15
src/test/rustdoc-ui/intra-doc/unused-extern-crate.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: unresolved link to `zip`
|
||||
--> $DIR/unused-extern-crate.rs:3:10
|
||||
|
|
||||
LL | /// See [zip] crate.
|
||||
| ^^^ no item named `zip` in scope
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/unused-extern-crate.rs:2:9
|
||||
|
|
||||
LL | #![deny(broken_intra_doc_links)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue