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:
Joshua Nelson 2020-12-25 19:04:50 -05:00
parent 3ffea60dd5
commit 7edd1810b4
3 changed files with 24 additions and 5 deletions

View file

@ -0,0 +1,5 @@
// compile-flags: --extern zip=whatever.rlib
#![deny(broken_intra_doc_links)]
/// See [zip] crate.
//~^ ERROR unresolved
pub struct ArrayZip;

View 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