Skip to content

Fix wrong spans with external macros in the dropping_copy_types lint #145430

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

Merged
merged 1 commit into from
Aug 15, 2025

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Aug 15, 2025

This PR fixes some wrong spans manipulations when external macros are involved.

Specifically we didn't make sure the spans had the same context, which kind-of make our spans manipulations go wrong and produce weird spans. We fix that by making sure they have the same context.

Fixes #145427

@rustbot
Copy link
Collaborator

rustbot commented Aug 15, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 15, 2025
Copy link
Member

@lqd lqd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parfait. r=me once green

@Urgau
Copy link
Member Author

Urgau commented Aug 15, 2025

@bors r=lqd rollup

@bors
Copy link
Collaborator

bors commented Aug 15, 2025

📌 Commit ae4eeb9 has been approved by lqd

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 15, 2025
bors added a commit that referenced this pull request Aug 15, 2025
Rollup of 11 pull requests

Successful merges:

 - #144210 (std: thread: Return error if setting thread stack size fails)
 - #145310 (Reduce usage of `compiler_for` in bootstrap)
 - #145311 (ci: clean windows disk space in background)
 - #145340 (Split codegen backend check step into two and don't run it with `x check compiler`)
 - #145408 (Deduplicate -L search paths)
 - #145412 (Windows: Replace `GetThreadId`+`GetCurrentThread` with `GetCurrentThreadId`)
 - #145413 (bootstrap: Reduce dependencies)
 - #145426 (Fix typos in bootstrap.example.toml)
 - #145430 (Fix wrong spans with external macros in the `dropping_copy_types` lint)
 - #145431 (Enhance UI test output handling for runtime errors)
 - #145448 (Autolabel `src/tools/{rustfmt,rust-analyzer}` changes with `T-{rustfmt,rust-analyzer}`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c97a9c8 into rust-lang:master Aug 15, 2025
10 checks passed
@rustbot rustbot added this to the 1.91.0 milestone Aug 15, 2025
rust-timer added a commit that referenced this pull request Aug 15, 2025
Rollup merge of #145430 - Urgau:drop_forget_useless-145427, r=lqd

Fix wrong spans with external macros in the `dropping_copy_types` lint

This PR fixes some wrong spans manipulations when external macros are involved.

Specifically we didn't make sure the spans had the same context, which kind-of make our spans manipulations go wrong and produce weird spans. We fix that by making sure they have the same context.

Fixes #145427
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

dropping_copy_types lint gives wrong suggestion with format_args!
5 participants