-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Enforce even more the code blocks attributes check through rustdoc #71670
Enforce even more the code blocks attributes check through rustdoc #71670
Conversation
I would expect this to apply to more than just markdown tests (e.g. for us to set it when doc-testing std, etc.). Is there a reason you've not done that? If that's just by accident, then I'd recommend setting this via RUSTDOCFLAGS. (I guess we'd also need to add it to |
Fine by me! |
edeeb71
to
62dc5c6
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
62dc5c6
to
ad1d46a
Compare
Updated! |
Does rustdoc not support the rustc syntax of I would also like to move the deny in builder.rs to somewhere in here: Line 1145 in 2f517ce
|
ad1d46a
to
1fab9c0
Compare
Updated! |
Hm, I think the lint name has been updated since then to be plural but r=me with that fixed. |
Ah the PR got merged already? Updating then! |
1fab9c0
to
72199f0
Compare
@Mark-Simulacrum Any idea what's going in:
? I tested locally and the option works just as expected. Is it using an older rustc/rustdoc version? |
Oh, yeah, right -- we're checking that |
72199f0
to
3dc8544
Compare
src/bootstrap/builder.rs
Outdated
@@ -725,7 +725,11 @@ impl<'a> Builder<'a> { | |||
.env("CFG_RELEASE_CHANNEL", &self.config.channel) | |||
.env("RUSTDOC_REAL", self.rustdoc(compiler)) | |||
.env("RUSTDOC_CRATE_VERSION", self.rust_version()) | |||
.env("RUSTC_BOOTSTRAP", "1"); | |||
.env("RUSTC_BOOTSTRAP", "1") | |||
.arg("-Dinvalid_codeblock_attributes"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be -D...
but rather -W
, with -Dwarnings
upgrading that only when --deny=warnings
or equivalent is passed to x.py.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer as I provided here.
Still not working with the new lint. :'( |
Yeah, #74395 will need to land first. |
@Mark-Simulacrum I'll trust you on this one: I set the lint to warning level by default. I really hope it is set to deny when running in CI. :) |
src/bootstrap/builder.rs
Outdated
} | ||
rustdocflags.arg("-Winvalid_codeblock_attributes"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this moved outside of the InTree block? We should still only specify this for in-tree crates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woups, my bad.
9a39545
to
5f6c079
Compare
I think it's now ready @Mark-Simulacrum. :) |
@bors r+ rollup=iffy since this denies a new lint (and could have conflicts with things introducing errors for that lint) |
📌 Commit 5f6c079 has been approved by |
…ttribute-check, r=Mark-Simulacrum Enforce even more the code blocks attributes check through rustdoc `rustdoc` now has a lint which allows it to warn if a code block attribute is malformated (which can end up in bad situations, even more in case of testing examples!). Now it'll fail if such a situation is encountered when testing markdown code blocks examples. r? @Mark-Simulacrum
…arth Rollup of 18 pull requests Successful merges: - rust-lang#71670 (Enforce even more the code blocks attributes check through rustdoc) - rust-lang#73930 (Make some Option methods const) - rust-lang#74009 (Fix MinGW `run-make-fulldeps` tests) - rust-lang#74056 (Add Arguments::as_str().) - rust-lang#74169 (Stop processing unreachable blocks when solving dataflow) - rust-lang#74251 (Teach bootstrap about target files vs target triples) - rust-lang#74288 (Fix src/test/run-make/static-pie/test-aslr.rs) - rust-lang#74300 (Use intra-doc links in core::iter module) - rust-lang#74364 (add lazy normalization regression tests) - rust-lang#74368 (Add CSS tidy check) - rust-lang#74394 (Remove leftover from emscripten fastcomp support) - rust-lang#74411 (Don't assign `()` to `!` MIR locals) - rust-lang#74416 (Use an UTF-8 locale for the linker.) - rust-lang#74424 (Move hir::Place to librustc_middle/hir) - rust-lang#74428 (docs: better demonstrate that None values are skipped as many times a…) - rust-lang#74438 (warn about uninitialized multi-variant enums) - rust-lang#74440 (Fix Arc::as_ptr docs) - rust-lang#74452 (intra-doc links: resolve modules in the type namespace) Failed merges: r? @ghost
rustdoc
now has a lint which allows it to warn if a code block attribute is malformated (which can end up in bad situations, even more in case of testing examples!). Now it'll fail if such a situation is encountered when testing markdown code blocks examples.r? @Mark-Simulacrum