Uh oh!
There was an error while loading. Please reload this page.
rustdoc: add #[allow(unused)] to every doctest - #45764
Conversation
rust-highfive
commented
Nov 4, 2017
r? @frewsxcv (rust_highfive has picked a reviewer for you, use r? to override) |
QuietMisdreavus
commented
Nov 4, 2017
kennytm
commented
Nov 5, 2017
Some CI failures regarding playground. The Details |
QuietMisdreavus
commented
Nov 5, 2017
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
ce2768aCompareQuietMisdreavus
commented
Nov 5, 2017
I've force-pushed to address the test failures. |
GuillaumeGomez
commented
Nov 6, 2017
Perfect, thanks! @bors: r+ |
bors
commented
Nov 6, 2017
📌 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. Closesrust-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. Closesrust-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