81 questions
0
votes
1
answer
113
views
How to set a Rust module to be public only for doctests?
I have a public API and a private one. The public API depends on the private one internally. I want to make the private API only public for doctests, so that I can test it directly.
I tried doing it ...
0
votes
0
answers
216
views
How to make `cargo doc` docs output to `/docs` directory (for GH pages)?
GitHub will create a web page for your repository using the GitHub Pages feature, but only if a suitable webpage (i.e. index.html) is in either the root directory (/) or in /docs. When you build ...
3
votes
1
answer
178
views
Rust doctests fail, but I have no doctests (or even doc comments)
cargo test is failing for my crate due to failed doctests. The thing is, I have no doctests. I even went through and deleted all of my doc comments and I get the same error.
The error message is ...
0
votes
0
answers
22
views
Rust doctests fails results in signal: 5, SIGTRAP: trace/breakpoint trap [duplicate]
I'm new to Rust and implementing a list library for familiarisation. So far the normal unit tests run correctly, but when I started writing doc tests, they resulted in what seems to be a runtime error....
3
votes
0
answers
148
views
How do I enable compilation of code that would otherwise be compiled out when running Rust doctests?
Suppose I have a crate that contains a module that's compiled only when a certain feature is enabled (and I do not want to enable that feature by default). However, I also want its documentation to be ...
0
votes
0
answers
70
views
Rustdoc: Add non-rust source file
I'd like to provide my Pest grammar file in documentation generated by rustdoc. All .rs files get their corresponding html in doc/src/cratename, but I cannot found any option to add files with other ...
0
votes
0
answers
192
views
How do I open rust doc on a virtual machine
using vscode to ssh archlinux on vmware station pro.
How to open the rust-doc in local browser?
aftercargo doc --open
WINDOWS reminded me that I needed to use the new app to open this vscode-remote ...
2
votes
1
answer
474
views
How can I prevent "cargo doc" from exporting pub(crate) items
I am trying to generate rustdoc for only my public facing API. I would like this to include pub but not pub(crate) items.
Is there a way to indicate this without having to exclude each item ...
2
votes
1
answer
145
views
How to hide Statics and Functions generated by the lazy_static crate from cargo doc?
I was documenting a module for a rust project that contains 2 lazy_static macro invocations and when evaluating the documentation generated by cargo doc I saw that there was a bunch of Structs, ...
4
votes
0
answers
2k
views
How to make cargo doc warn about missing documentation for public functions in module in a binary crate?
When I add #![warn(missing_docs)] to my main.rs the only warning that it gives me is that the that there is no documentation for the crate (as it should), but I would like that the modules in my ...
1
vote
1
answer
2k
views
How to link to a specific section in Rust documentation
Suppose I place a header in the documentation for a Rust module, src/module_a/mod.rs:
# Header
Some text.
I know how to link to this header from other parts of src/module_a/mod.rs using standard ...
0
votes
0
answers
45
views
Autogenerated noise in rustdoc when `--document-private-items`
When generating rustdoc with --document-private-items for my binary, it creates tons of unintended noise such as can be seen in the images below.
It seems that these are generated by slog::info macro (...
1
vote
1
answer
519
views
Idiomatic way to repeat a paragraph in rustdoc
I am finally taking some time to properly document my first Rust library and I would like to keep my doc as idiomatic as possible. In my library, there are two classes (I will call them Alpha and Beta ...
2
votes
1
answer
239
views
Rustdoc bring module into scope?
I am writing a documentation for crate and I noticed I am having lot's references like this:
/// A struct [`MyStruct`][`modA::subB::subC::MyStruct`] is very beautiful.
Is there a way to bring module ...
2
votes
1
answer
432
views
How to make rustdoc link to private item from submodule?
I am documenting my binary project that is split to multiple submodules. I have two files in src/:
// src/main.rs
//! # My Lovely Crate
//!
//! I can reference [`sub::Public`].
//! But, can't ...