-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Make some lint doctests compatible with --stage=0
#130353
Conversation
rustbot has assigned @michaelwoerister. Use |
I originally did things the other way in #130345, but when splitting this off into its own PR it occurred to me that this way is nicer. |
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.
Oh right, this is indeed unfortunate...
Thanks! |
Make some lint doctests compatible with `--stage=0` Currently, running `x test compiler --stage=0` (with `rust.parallel-compiler=false` to avoid other problems) results in two failures, because these lint doctests aren't compatible with the current stage0 compiler. In theory, the more “correct” solution would be to wrap the opening triple-backtick line in `#[cfg_attr(not(bootstrap), doc = "..."]`. However, that causes a few practical problems: - `tidy` doesn't understand that syntax, and miscounts the number of backticks in the comment block. - `lint-docs` doesn't understand that syntax, and thinks it's trying to declare the lint name. - Working around the above problems would cause more work and more confusion for whoever does the next bootstrap beta bump. So instead this PR adds some bootstrap gates inside the individual doctests, which end up producing the desired behaviour, and are straightforward to remove.
Rollup of 6 pull requests Successful merges: - rust-lang#130042 (properly handle EOF in BufReader::peek) - rust-lang#130061 (Add `NonNull` convenience methods to `Box` and `Vec`) - rust-lang#130202 (set `download-ci-llvm = true` by default on "library" and "tools" profiles) - rust-lang#130214 (MaybeUninit::zeroed: mention that padding is not zeroed) - rust-lang#130353 (Make some lint doctests compatible with `--stage=0`) - rust-lang#130370 (unstable-book: `trait_upcasting` example should not have `#![allow(incomplete_features)]`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 6 pull requests Successful merges: - rust-lang#130042 (properly handle EOF in BufReader::peek) - rust-lang#130061 (Add `NonNull` convenience methods to `Box` and `Vec`) - rust-lang#130202 (set `download-ci-llvm = true` by default on "library" and "tools" profiles) - rust-lang#130214 (MaybeUninit::zeroed: mention that padding is not zeroed) - rust-lang#130353 (Make some lint doctests compatible with `--stage=0`) - rust-lang#130370 (unstable-book: `trait_upcasting` example should not have `#![allow(incomplete_features)]`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130353 - Zalathar:lint-zero, r=jieyouxu Make some lint doctests compatible with `--stage=0` Currently, running `x test compiler --stage=0` (with `rust.parallel-compiler=false` to avoid other problems) results in two failures, because these lint doctests aren't compatible with the current stage0 compiler. In theory, the more “correct” solution would be to wrap the opening triple-backtick line in `#[cfg_attr(not(bootstrap), doc = "..."]`. However, that causes a few practical problems: - `tidy` doesn't understand that syntax, and miscounts the number of backticks in the comment block. - `lint-docs` doesn't understand that syntax, and thinks it's trying to declare the lint name. - Working around the above problems would cause more work and more confusion for whoever does the next bootstrap beta bump. So instead this PR adds some bootstrap gates inside the individual doctests, which end up producing the desired behaviour, and are straightforward to remove.
Currently, running
x test compiler --stage=0
(withrust.parallel-compiler=false
to avoid other problems) results in two failures, because these lint doctests aren't compatible with the current stage0 compiler.In theory, the more “correct” solution would be to wrap the opening triple-backtick line in
#[cfg_attr(not(bootstrap), doc = "..."]
. However, that causes a few practical problems:tidy
doesn't understand that syntax, and miscounts the number of backticks in the comment block.lint-docs
doesn't understand that syntax, and thinks it's trying to declare the lint name.So instead this PR adds some bootstrap gates inside the individual doctests, which end up producing the desired behaviour, and are straightforward to remove.