Rust allows to make links in documentation in the form
/// link to structure [Foo](foo::Foo) in crate foo
To make this work the linked crate should be in dependencies section in Cargo.toml:
[dependencies]
foo = "1.0"
What to do if I want to make such link, but do not want to make my crate dependent on foo
? For tests and examples this is achieved by dev-dependencies option in Cargo.toml:
[dev-dependencies]
foo = "1.0"
But this doesn't work for building documentation with cargo doc
.