Skip to content

doctests don't print warnings by default #3938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Susurrus opened this issue Apr 21, 2017 · 7 comments
Closed

doctests don't print warnings by default #3938

Susurrus opened this issue Apr 21, 2017 · 7 comments

Comments

@Susurrus
Copy link
Contributor

Running cargo test runs doctests by default, and shows warnings for regular code, but not for the doctests themselves. This can be enabled by running cargo test -- --nocapture. I'd like to have warnings also show in our CI tests, even for doctests, but setting -- --nocapture shows all the output which we don't want (and can't control, because they come from the underlying libraries complaining about our tests that are supposed to fail).

I'd think having warnings on for doctests by default would be good, but that wouldn't be backwards compatible. Maybe a --doctest-warnings option could be added in lieu of that?

@alexcrichton
Copy link
Member

I believe this is a bug for rustdoc, not cargo?

@alexcrichton
Copy link
Member

er didn't mean to close yet

@Susurrus
Copy link
Contributor Author

Sure, is rustdoc an external crate? I didn't see it under rust-lang so I figured it was part of cargo. Where should I file tickets for this? Also, should this ticket stay open if the default behavior of rustdoc might change?

@alexcrichton
Copy link
Member

Oh it's just a portion of the rust-lang/rust repository

@Susurrus
Copy link
Contributor Author

Should I file this issue with rust or rfcs then?

@alexcrichton
Copy link
Member

Oh just in rust-lang/rust is fine, likely no need for an rfc

@Susurrus
Copy link
Contributor Author

Closing in lieu of rust-lang/rust#41574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants