Skip to content

When error from local macro, include macro def span - #161051

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
estebank:macro_backtrace
Sep 21, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
estebank:macro_backtrace

Conversation

@estebank

Copy link
Copy Markdown
Contributor
  • mention -Zmacro-backtrace only for non-local macros
  • include span for local macro encompassing error

@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

rustc_errors::emitter was changed

cc @Muscraft

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 13, 2026
@rustbot

rustbot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

r? @adwinwhite

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 18 candidates

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Sep 19, 2026
@rustbot

rustbot commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Sep 19, 2026
@estebank
estebank force-pushed the macro_backtrace branch 3 times, most recently from 05444dc to 6df7b96 Compare September 19, 2026 21:46
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

- mention `-Zmacro-backtrace` only for non-local macros
- include span for local macro encompassing error
@adwinwhite

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit f1e9e5e has been approved by adwinwhite

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Sep 21, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 21, 2026
…hite

When error from local macro, include macro def span

- mention `-Zmacro-backtrace` only for non-local macros
- include span for local macro encompassing error
rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
Rollup of 15 pull requests

Successful merges:

 - #161051 (When error from local macro, include macro def span)
 - #162750 (add case mapping fast paths for Latin-1)
 - #162831 (Do not continue past `rustc_resolve` when encountering duplicated items)
 - #162835 (rustdoc: account for nested parens and split text events in bare urls lint)
 - #163044 (Report runtime range endpoints for runtime values)
 - #163062 (Use x30 register name with LLVM 23+)
 - #158102 (When compiling without a specified `--edition`, emit a note)
 - #162984 (Windows: don't error if `access_mode` is set on `OpenOptions`)
 - #163005 (Avoid unreachable integer underflow check in `CStr::count_bytes()`)
 - #163019 (Prepare for the introduction of forced keywords (`k#`))
 - #163020 (Dir: fix fallback impl for remove_dir)
 - #163047 (Use verbose suggestion for `mut binding` instead of `&mut binding`)
 - #163075 (Fix ArgAttributes mismatches in ABI UI tests for LoongArch64 and RiscV64)
 - #163079 (enable `f128` from `u64`/`i64` test)
 - #163082 (Remove `TypeChecker::root_cx`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 21, 2026
…hite

When error from local macro, include macro def span

- mention `-Zmacro-backtrace` only for non-local macros
- include span for local macro encompassing error
rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #161051 (When error from local macro, include macro def span)
 - #161629 (Streamline `StateDiffCollector`)
 - #162750 (add case mapping fast paths for Latin-1)
 - #162831 (Do not continue past `rustc_resolve` when encountering duplicated items)
 - #162835 (rustdoc: account for nested parens and split text events in bare urls lint)
 - #162952 (Depend on lockfiles to prevent GC of the current session)
 - #163044 (Report runtime range endpoints for runtime values)
 - #163062 (Use x30 register name with LLVM 23+)
 - #158102 (When compiling without a specified `--edition`, emit a note)
 - #162939 (Declare multi-kind constants for MacroKinds)
 - #162984 (Windows: don't error if `access_mode` is set on `OpenOptions`)
 - #163005 (Avoid unreachable integer underflow check in `CStr::count_bytes()`)
 - #163019 (Prepare for the introduction of forced keywords (`k#`))
 - #163020 (Dir: fix fallback impl for remove_dir)
 - #163047 (Use verbose suggestion for `mut binding` instead of `&mut binding`)
 - #163075 (Fix ArgAttributes mismatches in ABI UI tests for LoongArch64 and RiscV64)
 - #163079 (enable `f128` from `u64`/`i64` test)
 - #163082 (Remove `TypeChecker::root_cx`)
@rust-bors

rust-bors Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit f1e9e5e with merge 9dc0b07...

Workflow: https://github.com/rust-lang/rust/actions/runs/35576979212

rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
When error from local macro, include macro def span

- mention `-Zmacro-backtrace` only for non-local macros
- include span for local macro encompassing error
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors yield
Yielding to enclosing rollup

@rust-bors

rust-bors Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #163095.

rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #161051 (When error from local macro, include macro def span)
 - #161629 (Streamline `StateDiffCollector`)
 - #162750 (add case mapping fast paths for Latin-1)
 - #162831 (Do not continue past `rustc_resolve` when encountering duplicated items)
 - #162835 (rustdoc: account for nested parens and split text events in bare urls lint)
 - #162952 (Depend on lockfiles to prevent GC of the current session)
 - #163044 (Report runtime range endpoints for runtime values)
 - #163062 (Use x30 register name with LLVM 23+)
 - #163091 (miri subtree update)
 - #162939 (Declare multi-kind constants for MacroKinds)
 - #162984 (Windows: don't error if `access_mode` is set on `OpenOptions`)
 - #163005 (Avoid unreachable integer underflow check in `CStr::count_bytes()`)
 - #163019 (Prepare for the introduction of forced keywords (`k#`))
 - #163020 (Dir: fix fallback impl for remove_dir)
 - #163041 (Be more explicit on suggestion type without changing how they are rendered)
 - #163047 (Use verbose suggestion for `mut binding` instead of `&mut binding`)
 - #163075 (Fix ArgAttributes mismatches in ABI UI tests for LoongArch64 and RiscV64)
 - #163079 (enable `f128` from `u64`/`i64` test)
 - #163082 (Remove `TypeChecker::root_cx`)
@rust-bors
rust-bors Bot merged commit 848ef40 into rust-lang:main Sep 21, 2026
13 of 14 checks passed
rust-bors Bot pushed a commit that referenced this pull request Sep 21, 2026
Rollup merge of #161051 - estebank:macro_backtrace, r=adwinwhite

When error from local macro, include macro def span

- mention `-Zmacro-backtrace` only for non-local macros
- include span for local macro encompassing error
@rustbot rustbot added this to the 1.100.0 milestone Sep 21, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

Note

This PR was benchmarked as part of triage of its containing rollup: triage URL.

Finished benchmarking commit (57e3e66): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 0.5%] 8
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) 0.3% [0.2%, 0.5%] 8

Max RSS (memory usage)

This perf run didn't have relevant results for this metric.

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: missing data
Artifact size: 408.93 MiB -> 408.98 MiB (0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Sep 21, 2026
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Sep 22, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#161051 (When error from local macro, include macro def span)
 - rust-lang/rust#161629 (Streamline `StateDiffCollector`)
 - rust-lang/rust#162750 (add case mapping fast paths for Latin-1)
 - rust-lang/rust#162831 (Do not continue past `rustc_resolve` when encountering duplicated items)
 - rust-lang/rust#162835 (rustdoc: account for nested parens and split text events in bare urls lint)
 - rust-lang/rust#162952 (Depend on lockfiles to prevent GC of the current session)
 - rust-lang/rust#163044 (Report runtime range endpoints for runtime values)
 - rust-lang/rust#163062 (Use x30 register name with LLVM 23+)
 - rust-lang/rust#163091 (miri subtree update)
 - rust-lang/rust#162939 (Declare multi-kind constants for MacroKinds)
 - rust-lang/rust#162984 (Windows: don't error if `access_mode` is set on `OpenOptions`)
 - rust-lang/rust#163005 (Avoid unreachable integer underflow check in `CStr::count_bytes()`)
 - rust-lang/rust#163019 (Prepare for the introduction of forced keywords (`k#`))
 - rust-lang/rust#163020 (Dir: fix fallback impl for remove_dir)
 - rust-lang/rust#163041 (Be more explicit on suggestion type without changing how they are rendered)
 - rust-lang/rust#163047 (Use verbose suggestion for `mut binding` instead of `&mut binding`)
 - rust-lang/rust#163075 (Fix ArgAttributes mismatches in ABI UI tests for LoongArch64 and RiscV64)
 - rust-lang/rust#163079 (enable `f128` from `u64`/`i64` test)
 - rust-lang/rust#163082 (Remove `TypeChecker::root_cx`)
@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Sep 24, 2026
@Mark-Simulacrum

Copy link
Copy Markdown
Member

This looks like it's a diagnostic change which is sort of a correctness fix;
probably an OK regression to accept. It might be limited to code that emits
diagnostics (so probably related to old version of syn we have here).

Marking as triaged.

@estebank

estebank commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@Mark-Simulacrum to be clear, it would be ok to revert. It also makes sense that syn would be most affected (but should only happen once errors are actually emitted, not in the happy path...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc 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