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
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.

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:"

@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
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.

7 participants