-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustdoc: add #[allow(unused)] to every doctest #45764
Conversation
r? @frewsxcv (rust_highfive has picked a reviewer for you, use r? to override) |
Some CI failures regarding playground. The
|
It looks like As for the playground ones, it seems like the playground links also use this code to assemble the run links, so i'll need to update those tests to include the new attribute. |
also modify the order crate attributes are applied, to have a better order of how things can override lints, either per-crate or per-test
9db6bca
to
ce2768a
Compare
I've force-pushed to address the test failures. |
Perfect, thanks! @bors: r+ |
📌 Commit ce2768a has been approved by |
…ts, r=GuillaumeGomez rustdoc: add #[allow(unused)] to every doctest More information in rust-lang#45750 - this is behavior that was documented but not actually implemented. I also reordered how outer attributes are applied to doctests. Previously, attributes from `#![doc(test(attr(...)))]` would be applied *after* attributes from within the test itself, meaning if a doctest tried to override lints that would be set crate-wide, it wouldn't work at all. This gives a better scope of how lints can be applied. Closes rust-lang#45750
…ts, r=GuillaumeGomez rustdoc: add #[allow(unused)] to every doctest More information in rust-lang#45750 - this is behavior that was documented but not actually implemented. I also reordered how outer attributes are applied to doctests. Previously, attributes from `#![doc(test(attr(...)))]` would be applied *after* attributes from within the test itself, meaning if a doctest tried to override lints that would be set crate-wide, it wouldn't work at all. This gives a better scope of how lints can be applied. Closes rust-lang#45750
…ol, r=frewsxcv rustdoc book: talk about #![doc(test(no_crate_inject))] and #![doc(test(attr(...)))] While investigating rust-lang#45750 i noticed that `#![doc(test(attr(...)))]` wasn't documented at all. Since this is useful for making your examples follow the same coding guidelines as your code, i wanted to add it to the Rustdoc Book. I also added `#![doc(test(no_crate_inject))]` since it's used in the same place and might be useful for macro-heavy crates. I added mentions for these to "The `doc` attribute" as well as "Documentation tests" since it's useful information in both places. Technically the step reordering in the second commit is gated on rust-lang#45764, since before that lands attributes from the doctest come before the ones from `#![doc(test(attr(...)))]`.
More information in #45750 - this is behavior that was documented but not actually implemented.
I also reordered how outer attributes are applied to doctests. Previously, attributes from
#![doc(test(attr(...)))]
would be applied after attributes from within the test itself, meaning if a doctest tried to override lints that would be set crate-wide, it wouldn't work at all. This gives a better scope of how lints can be applied.Closes #45750