signalapp / libsignal

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.
GNU Affero General Public License v3.0
3.08k stars 362 forks source link

make doctests fail on any warnings #466

Closed cosmicexplorer closed 2 years ago

cosmicexplorer commented 2 years ago

This is a useful setting to have on. We only have one doctest right now (for ProtocolAddress::new()), but this is useful when adding documentation in the constituent PRs of #467.

jrose-signal commented 2 years ago

I'm leery of this for the same reason we don't use deny(warnings): it makes it harder to use different compiler releases (even if this one doesn't affect downstream clients the same way). Is there a way to set this from the command line instead, so we can put it in our CI config but leave local builds alone?

cosmicexplorer commented 2 years ago

I totally hadn't considered how similar this is to deny(warnings) in general, and it's not clear how rustdoc can be made to read from cargo config, since #[doc] attributes do not seem to obviously have a way to be set except in the source code itself (looking at https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html#showing-warnings-in-doctests). I think I'll close this for now as I have had a lot of difficulty trying to figure this out and there doesn't seem to be a lot of benefit from it.