How to deal with crates which docs can not be built?


#1

I have a large project and some of it dependencies has a mime_guess dependency. I can’t build the documentation because of this package:

Documenting mime_guess v1.8.3
error: couldn't read "/usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/mime_guess-1.8.3/src/mime_types_generated.rs": No such file or directory (os error 2)
  --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/mime_guess-1.8.3/src/lib.rs:16:1
   |
16 | include!("mime_types_generated.rs");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: Could not document `mime_guess`.

Of course, I may simply run cargo doc --no-deps but I don’t need such kind of docs. As a workaround I’d love to have a capability of excluding this crate. So what options do I have? I’d like to keep the documentation build for all projects except for this one.


#2

The problem fixed there: https://github.com/rust-lang/cargo/pull/5071