[DO NOT MERGE] Add a crater lint for issue 145739
I took some weird hack that expands the following macro call
format_args!("{x} {x}");
into
{
super let args = (&x,);
super let args = [format_argument::new_display(args.0)];
// `&x` is for getting the information of captured parameter,
// and the units have the same spans with actual parmeter occurrences, which can be used for lints
let __issue_145739 = (&x, (), ());
unsafe {
format_arguments::new(b"\xc0\x01 \xc8\x00\x00\x01\n\x00",
&args)
}
}
and then look for those let stmt with __issue_145739 later in the late lint pass.
It's because in early lint, we don't have much information other than AST, while in late lint, we have quite much information but not for AST 😂 So I have to leave some information about AST before executing late lint - macro expansion - and I think this would be okay as this lint will be used only for crater runs
The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
[TIMING:end] tool::ToolBuild { build_compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu, tool: "tidy", path: "src/tools/tidy", mode: ToolBootstrap, source_type: InTree, extra_features: [], allow_features: "", cargo_args: [], artifact_kind: Binary } -- 11.373
[TIMING:end] tool::Tidy { compiler: Compiler { stage: 0, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 0.000
fmt check
Diff in /checkout/compiler/rustc_lint/src/issue_145739.rs:4:
use rustc_session::{declare_lint, declare_lint_pass};
use rustc_span::symbol::sym;
-use crate::{LateContext, LateLintPass, LintContext, lints::Issue145738Diag};
+use crate::lints::Issue145738Diag;
+use crate::{LateContext, LateLintPass, LintContext};
declare_lint! {
pub ISSUE_145739,
fmt: checked 6567 files
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
fmt check
fmt: checked 6567 files
tidy check
tidy [rustdoc_json (src)]: `rustdoc-json-types` modified, checking format version
tidy [fluent_alphabetical (compiler)]: /checkout/compiler/rustc_lint/messages.ftl: message `lint_variant_size_differences` appears before `lint_issue_145739`, but is alphabetically later than it. Run `./x.py test tidy --bless` to sort the file correctly
tidy [fluent_alphabetical (compiler)]: FAIL
tidy: Skipping binary file check, read-only filesystem
tidy: The following check failed: fluent_alphabetical (compiler)
Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools-bin/rust-tidy /checkout /checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/cargo /checkout/obj/build 4 yarn` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1594:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1285:29
Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Build completed unsuccessfully in 0:00:49
local time: Mon Nov 24 22:58:31 UTC 2025
network time: Mon, 24 Nov 2025 22:58:31 GMT
##[error]Process completed with exit code 1.
The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
##[group]Running stage2 lint-docs (stage1 -> stage2, aarch64-unknown-linux-gnu)
error: did not find doc lines for lint `issue_145739` in /checkout/compiler/rustc_lint/src/issue_145739.rs
This error was generated by the lint-docs tool.
This tool extracts documentation for lints from the source code and places
them in the rustc book. See the declare_lint! documentation
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/macro.declare_lint.html
for an example of the format of documentation this tool expects.
To re-run these tests, run: ./x.py test --keep-stage=0 src/tools/lint-docs
The --keep-stage flag should be used if you have already built the compiler
and are only modifying the doc comments to avoid rebuilding the compiler.
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools-bin/lint-docs --build-rustc-stage 1 --src /checkout/compiler --out /checkout/obj/build/aarch64-unknown-linux-gnu/md-doc/rustc/src/lints --rustc /checkout/obj/build/aarch64-unknown-linux-gnu/stage1/bin/rustc --rustc-target aarch64-unknown-linux-gnu --validate` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1594:23
Executed at: src/bootstrap/src/core/build_steps/doc.rs:1392:13
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:39:14
local time: Mon Nov 24 23:50:08 UTC 2025
network time: Mon, 24 Nov 2025 23:50:09 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"
I have a crater permission by https://github.com/rust-lang/team/pull/2038 but I'm not sure is this okay to run as I've never done it before 😅
I have a crater permission by rust-lang/team#2038 but I'm not sure is this okay to run as I've never done it before 😅
Yes, it's fine (that's why r-a got crater permissions), I can assist (or at least try to assist) with the crater incantation if you need help.
You can do smaller experimental batches for these too (before doing a full crater), e.g. pick top-50 or top-100 crates.
The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)
Click to see the possible cause of the failure (guessed by this bot)
[TIMING:start] test::LintDocs { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu }
[TIMING:start] doc::RustcBook { build_compiler: Compiler { stage: 1, host: aarch64-unknown-linux-gnu, forced_compiler: false }, target: aarch64-unknown-linux-gnu, validate: true }
Generating lint docs (aarch64-unknown-linux-gnu)
##[group]Running stage2 lint-docs (stage1 -> stage2, aarch64-unknown-linux-gnu)
error: failed to test example in lint docs for `issue_145739` in /checkout/compiler/rustc_lint/src/issue_145739.rs:10: lint docs should contain the line `### Example`
This error was generated by the lint-docs tool.
This tool extracts documentation for lints from the source code and places
them in the rustc book. See the declare_lint! documentation
https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/macro.declare_lint.html
for an example of the format of documentation this tool expects.
To re-run these tests, run: ./x.py test --keep-stage=0 src/tools/lint-docs
The --keep-stage flag should be used if you have already built the compiler
and are only modifying the doc comments to avoid rebuilding the compiler.
Bootstrap failed while executing `--stage 2 test --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage1-tools-bin/lint-docs --build-rustc-stage 1 --src /checkout/compiler --out /checkout/obj/build/aarch64-unknown-linux-gnu/md-doc/rustc/src/lints --rustc /checkout/obj/build/aarch64-unknown-linux-gnu/stage1/bin/rustc --rustc-target aarch64-unknown-linux-gnu --validate` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1599:23
Executed at: src/bootstrap/src/core/build_steps/doc.rs:1392:13
Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:40:10
local time: Tue Nov 25 03:32:05 UTC 2025
network time: Tue, 25 Nov 2025 03:32:05 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"
Yes, it's fine (that's why r-a got crater permissions), I can assist (or at least try to assist) with the crater incantation if you need help.
Thanks! But this is not really a rust-analyzer side crate run, BTW 😅
You can do smaller experimental batches for these too (before doing a full crater), e.g. pick top-50 or top-100 crates.
Sounds like a good experiment to start with. But this branch currently fails on a CI lint for doc comments - doc requirements for new lints are stricter than I thought 😅 - though it succeeds on bootstraps and tests. Would it be okay to do crater run in current status?
Thanks! But this is not really a rust-analyzer side crate run
(I'm aware, this is a compiler side crater run :D)
But this branch currently fails on a CI lint for doc comments - doc requirements for new lints are stricter than I thought 😅 - though it succeeds on bootstraps and tests. Would it be okay to do crater run in current status?
Crater runs only need to build, they don't need to pass all style checks or full tests. We can still give this a try, we can even just cherry-pick say 10 crates as a trial run, then check if crater can work.
Only requirement is for a default try job to succeed:
@bors try
:hourglass: Trying commit f38ea06bd48ea586a78c2ccba44a64a48fe492c0 with merge 59a256151e578f525a26127f2c3e3a6c7e2982ca…
To cancel the try build, run the command @bors try cancel.
Workflow: https://github.com/rust-lang/rust/actions/runs/19660644600
:sunny: Try build successful (CI)
Build commit: 59a256151e578f525a26127f2c3e3a6c7e2982ca (59a256151e578f525a26127f2c3e3a6c7e2982ca, parent: c871d09d1cc32a649f4c5177bb819646260ed120)
@craterbot run mode=check-only crates=top-10
:ok_hand: Experiment pr-149291 created and queued.
:robot: Automatically detected try build 59a256151e578f525a26127f2c3e3a6c7e2982ca
:mag: You can check out the queue and this experiment's details.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
Bumping priority because this is just a top-10 run to smoke-test the lint.
@craterbot name=pr-149291 p=1
:memo: Configuration of the pr-149291 experiment changed.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:construction: Experiment pr-149291 is now running
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:tada: Experiment pr-149291 is completed!
:bar_chart: 0 regressed and 0 fixed (10 total)
:bar_chart: 0 spurious results on the retry-regessed-list.txt, consider a retry[^1] if this is a significant amount.
:newspaper: Open the summary report.
:warning: If you notice any spurious failure please add them to the denylist!
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
[^1]: re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149291/retry-regressed-list.txt
@craterbot check
:ok_hand: Experiment pr-149291-1 created and queued.
:robot: Automatically detected try build 59a256151e578f525a26127f2c3e3a6c7e2982ca
:mag: You can check out the queue and this experiment's details.
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:construction: Experiment pr-149291-1 is now running
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
:tada: Experiment pr-149291-1 is completed!
:bar_chart: 2 regressed and 6 fixed (744711 total)
:bar_chart: 2011 spurious results on the retry-regessed-list.txt, consider a retry[^1] if this is a significant amount.
:newspaper: Open the summary report.
:warning: If you notice any spurious failure please add them to the denylist!
:information_source: Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
[^1]: re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149291-1/retry-regressed-list.txt
So, this lint caught https://github.com/multiversx/mx-sdk-rs/blob/813927c03a7b512a3c6ef9a15690eaf87872cc5c/framework/meta-lib/src/tools/rustc_version_warning.rs#L19-L30, called formatting upon consts with type ::semver::Version, which contains ::semver::Identifier with a custom destructor as a nested field (Version.pre.identifier). This won't be affected anyway.
But there are 1000 < OOMed regressions and I'm not sure of them. I guess this lint shouldn't demand lots of extra memory 🤔
How did the qroc crate suddenly start compiling in this crater run?
Well, this changes nothing other than this
{
super let args = (&add(1, 2),);
super let args = [format_argument::new_display(args.0)];
+ let __issue_145739 = (&add(1, 2), ());
unsafe {
format_arguments::new(..)
}
}
So maybe due to other changes related to proc-macro or nameres between this and the last crater run?
Edit) I'm quite ignorant on crater, but seems that crater compares things from base to PR, so the results would be the pure regressions in this PR. I'll look into this more 🤔
qroc is built and run without errors both on 1.91.1 stable and rustc 1.93.0-nightly (29a69716f 2025-11-10). I guess the failed compilation on the base might be originated from some perl or other side issues as qroc runs the perl binary and parses its output into tokenstream, and it doesn't error out on empty file.
This is what looks suspicious to me. Exactly the same counts and all failures are OOMs 🤔
Maybe the base revision or the crater run for it was a bit flaky. I'll try another run with rebase if I can't find anything spurious
:umbrella: The latest upstream changes (presumably #149701) made this pull request unmergeable. Please resolve the merge conflicts.
@bors try
:hourglass: Trying commit ab866ccef6db8e6d87bc0049e17aea6868c903e6 with merge f393e920342ceb7ad171c4c84886bae0c180965d…
To cancel the try build, run the command @bors try cancel.
Workflow: https://github.com/rust-lang/rust/actions/runs/20007566754