Skip to content

Conversation

@chenyukang
Copy link
Member

@chenyukang chenyukang commented Nov 20, 2025

Fixes #147648

@rustbot
Copy link
Collaborator

rustbot commented Nov 20, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 Nov 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 20, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
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

Comment on lines 76 to 78
if tcx.def_span(parent).from_expansion()
&& let Some(macro_def_id) = tcx.def_span(parent).ctxt().outer_expn_data().macro_def_id
&& !macro_def_id.is_local()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why parent and not def_id?
Should this use tcx.def_span(parent).in_external_macro(tcx.sess.source_map())?

Copy link
Member Author

Choose a reason for hiding this comment

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

use def_id will remove the warning for this testcase:
https://github.com/chenyukang/rust/blob/f943606503b142b24edb2b20f77f1eb737fb9ed2/tests/ui/proc-macro/attributes-included.rs#L17
yeah, tcx.def_span(parent).in_external_macro(tcx.sess.source_map()) is simpler.

@chenyukang chenyukang force-pushed the yukang-fix-unused_assignments-macro-gen-147648 branch from 0f7c6a0 to c21d817 Compare November 21, 2025 03:58
@rust-log-analyzer

This comment has been minimized.

@chenyukang chenyukang force-pushed the yukang-fix-unused_assignments-macro-gen-147648 branch from c21d817 to f943606 Compare November 21, 2025 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nightly unused_assignments false positives for miette::Diagnostic fields

5 participants