Skip to content

Conversation

@ShoyuVanilla
Copy link
Member

@ShoyuVanilla ShoyuVanilla commented Nov 24, 2025

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

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 24, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@theemathas theemathas added the needs-crater This change needs a crater run to check for possible breakage in the ecosystem. label Nov 24, 2025
@rust-log-analyzer

This comment has been minimized.

@ShoyuVanilla
Copy link
Member Author

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 😅

@jieyouxu
Copy link
Member

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.

@rust-log-analyzer

This comment has been minimized.

@ShoyuVanilla
Copy link
Member Author

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?

@jieyouxu
Copy link
Member

Thanks! But this is not really a rust-analyzer side crate run

(I'm aware, this is a compiler side crater run :D)

@jieyouxu
Copy link
Member

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.

@jieyouxu
Copy link
Member

Only requirement is for a default try job to succeed:

@bors try

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 25, 2025
@rust-bors
Copy link

rust-bors bot commented Nov 25, 2025

☀️ Try build successful (CI)
Build commit: 59a2561 (59a256151e578f525a26127f2c3e3a6c7e2982ca, parent: c871d09d1cc32a649f4c5177bb819646260ed120)

@ShoyuVanilla ShoyuVanilla changed the title [DO NOT MERGE] Add a crater lint for #145739 [DO NOT MERGE] Add a crater lint for issue 145739 Nov 25, 2025
@ShoyuVanilla
Copy link
Member Author

@craterbot run mode=check-only crates=top-10

@craterbot
Copy link
Collaborator

👌 Experiment pr-149291 created and queued.
🤖 Automatically detected try build 59a2561
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 25, 2025
@joshtriplett
Copy link
Member

Bumping priority because this is just a top-10 run to smoke-test the lint.

@craterbot name=pr-149291 p=1

@craterbot
Copy link
Collaborator

📝 Configuration of the pr-149291 experiment changed.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🚧 Experiment pr-149291 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149291 is completed!
📊 0 regressed and 0 fixed (10 total)
📊 0 spurious results on the retry-regessed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149291/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Nov 26, 2025
@ShoyuVanilla
Copy link
Member Author

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-149291-1 created and queued.
🤖 Automatically detected try build 59a2561
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 26, 2025
@craterbot
Copy link
Collaborator

🚧 Experiment pr-149291-1 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149291-1 is completed!
📊 2 regressed and 6 fixed (744711 total)
📊 2011 spurious results on the retry-regessed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149291-1/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 4, 2025
@ShoyuVanilla
Copy link
Member Author

ShoyuVanilla commented Dec 4, 2025

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 🤔

@theemathas
Copy link
Contributor

How did the qroc crate suddenly start compiling in this crater run?

@ShoyuVanilla
Copy link
Member Author

ShoyuVanilla commented Dec 4, 2025

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 🤔

@ShoyuVanilla
Copy link
Member Author

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.

image

This is what looks suspicious to me. Exactly the same counts and all failures are OOMs 🤔

@ShoyuVanilla
Copy link
Member Author

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

@bors
Copy link
Collaborator

bors commented Dec 6, 2025

☔ The latest upstream changes (presumably #149701) made this pull request unmergeable. Please resolve the merge conflicts.

@ShoyuVanilla
Copy link
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 7, 2025
[DO NOT MERGE] Add a crater lint for issue 145739
@rust-log-analyzer
Copy link
Collaborator

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.

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:1612:23
Executed at: src/bootstrap/src/core/build_steps/doc.rs:1414:13

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:42:24
  local time: Sun Dec  7 17:56:38 UTC 2025
  network time: Sun, 07 Dec 2025 17:56:39 GMT
##[error]Process completed with exit code 1.

@rust-bors
Copy link

rust-bors bot commented Dec 7, 2025

☀️ Try build successful (CI)
Build commit: f393e92 (f393e920342ceb7ad171c4c84886bae0c180965d, parent: 1d6c526bb010900bc1fd4c45c4ef0307b5150583)

@ShoyuVanilla
Copy link
Member Author

@craterbot
Copy link
Collaborator

👌 Experiment pr-149291-2 created and queued.
🤖 Automatically detected try build f393e92
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-crater This change needs a crater run to check for possible breakage in the ecosystem. S-waiting-on-crater Status: Waiting on a crater run to be completed. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants