Skip to content

Conversation

@matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Dec 9, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

JohnTitor and others added 22 commits October 12, 2025 16:51
  Previously, when an `impl Trait` captured multiple higher-ranked
  lifetimes from an outer `impl Trait`, the compiler would emit a
  separate error for each captured lifetime. This resulted in verbose
  and confusing diagnostics, especially in edition 2024 where implicit
  captures caused duplicate errors.

  This commit introduces error accumulation that collects all capture
  spans and lifetime declaration spans, then emits a single consolidated
  diagnostic using MultiSpan. The new error shows all captured lifetimes
  with visual indicators and lists all declarations in a single note.
There are major questions remaining about the reentrancy that this
allows. It doesn't have any users on github outside of a single project
that uses it in a panic=abort project to show backtraces. It
can still be emulated through #[alloc_error_handler] or
set_alloc_error_hook depending on if you use the standard library or
not. And finally it makes it harder to do various improvements to the
allocator shim.
…xternal macro

```
error[E0308]: mismatched types
  --> $DIR/macro-span-caller-replacement.rs:5:17
   |
LL |             s = format!("{arg}");
   |                 ^^^^^^^^^^^^^^^^ expected `&str`, found `String`
...
LL |     macro_with_format!();
   |     -------------------- in this macro invocation
   |
   = note: this error originates in the macro `format` which comes from the expansion of the macro `macro_with_format` (in Nightly builds, run with -Z macro-backtrace for more info)
```
```
error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
  --> $DIR/dyn-trait-type-alias-return-type.rs:4:11
   |
LL | fn f() -> T { loop {} }
   |           ^ doesn't have a size known at compile-time
   |
   = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
note: this type alias is unsized
  --> $DIR/dyn-trait-type-alias-return-type.rs:1:1
   |
LL | type T = dyn core::fmt::Debug;
   | ^^^^^^
   = note: the return type of a function must have a statically known size
```
…rrors, r=estebank

Deduplicate higher-ranked lifetime capture errors in impl Trait

  Previously, when an `impl Trait` captured multiple higher-ranked
  lifetimes from an outer `impl Trait`, the compiler would emit a
  separate error for each captured lifetime. This resulted in verbose
  and confusing diagnostics, especially in edition 2024 where implicit
  captures caused duplicate errors.

  This commit introduces error accumulation that collects all capture
  spans and lifetime declaration spans, then emits a single consolidated
  diagnostic using MultiSpan. The new error shows all captured lifetimes
  with visual indicators and lists all declarations in a single note.

r? `@estebank`
Fixes rust-lang#143022
Remove -Zoom=panic

There are major questions remaining about the reentrancy that this allows. It doesn't have any users on github outside of a single project that uses it in a panic=abort project to show backtraces. It can still be emulated through `#[alloc_error_handler]` or `set_alloc_error_hook` depending on if you use the standard library or not. And finally it makes it harder to do various improvements to the allocator shim.

With this PR the sole remaining symbol in the allocator shim that is not effectively emulating weak symbols is the symbol that prevents skipping the allocator shim on stable even when it would otherwise be empty because libstd + `#[global_allocator]` is used.

Closes rust-lang#43596
Fixes rust-lang#126683
 Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type

Point at return type of `async fn`s instead of their def `Span`.

Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type.

Correctly address `type Alias = dyn Trait` when `fn foo() -> Alias { .. }`.

Fix rust-lang#147894.
…nkov

Point at span within local macros even when error happens in nested external macro

Address issue noticed at https://users.rust-lang.org/t/error-message-does-not-specify-where-in-macro/135157/1. On errors occurring within a macro expansion, point at the innermost local macro expansion point.

```
error[E0308]: mismatched types
  --> $DIR/macro-span-caller-replacement.rs:5:17
   |
LL |             s = format!("{arg}");
   |                 ^^^^^^^^^^^^^^^^ expected `&str`, found `String`
...
LL |     macro_with_format!();
   |     -------------------- in this macro invocation
   |
   = note: this error originates in the macro `format` which comes from the expansion of the macro `macro_with_format` (in Nightly builds, run with -Z macro-backtrace for more info)
```
…bzol

Run clippy on cg_gcc in CI

This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues.

cc `@antoyo`
r? `@Kobzol`
…r=JonathanBrouwer,Kivooeo

Make typo in field and name suggestions verbose

Part of rust-lang#141973.
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Dec 9, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Dec 9, 2025

📌 Commit d1087ac has been approved by matthiaskrgr

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 Dec 9, 2025
@bors
Copy link
Collaborator

bors commented Dec 9, 2025

⌛ Testing commit d1087ac with merge 4383aad...

bors added a commit that referenced this pull request Dec 9, 2025
Rollup of 6 pull requests

Successful merges:

 - #147602 (Deduplicate higher-ranked lifetime capture errors in impl Trait)
 - #147725 (Remove -Zoom=panic)
 - #148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type)
 - #148717 (Point at span within local macros even when error happens in nested external macro)
 - #149458 (Run clippy on cg_gcc in CI)
 - #149816 (Make typo in field and name suggestions verbose)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-21-3 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
To only update this specific test, also pass `--test-args imports/ambiguous-glob-vs-expanded-extern.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/imports/ambiguous-glob-vs-expanded-extern" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/imports/ambiguous-glob-vs-expanded-extern/auxiliary" "--extern" "glob_vs_expanded=/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/imports/ambiguous-glob-vs-expanded-extern/auxiliary/libglob_vs_expanded.so"
stdout: none
--- stderr -------------------------------
error: `mac` is ambiguous
##[error]  --> /checkout/tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs:4:23
   |
LL |     glob_vs_expanded::mac!(); //~ ERROR `mac` is ambiguous
   |                       ^^^ ambiguous name
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
   = note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
note: `mac` could refer to the macro defined here
---
  --> /checkout/tests/ui/imports/auxiliary/glob-vs-expanded.rs:5:9
   |
LL | pub use inner::*;
   |         ^^^^^
   = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
   = note: this error originates in the macro `define_mac` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 1 previous error

Future incompatibility report: Future breakage diagnostic:
error: `mac` is ambiguous
##[error]  --> /checkout/tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs:4:23
   |
LL |     glob_vs_expanded::mac!(); //~ ERROR `mac` is ambiguous
   |                       ^^^ ambiguous name
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
   = note: ambiguous because of a conflict between a name from a glob import and a macro-expanded name in the same module during import or macro resolution
note: `mac` could refer to the macro defined here
---
  --> /checkout/tests/ui/imports/auxiliary/glob-vs-expanded.rs:5:9
   |
LL | pub use inner::*;
   |         ^^^^^
   = note: `#[deny(ambiguous_glob_imports)]` (part of `#[deny(future_incompatible)]`) on by default
   = note: this error originates in the macro `define_mac` (in Nightly builds, run with -Z macro-backtrace for more info)
------------------------------------------

---- [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs stdout end ----

failures:

@bors
Copy link
Collaborator

bors commented Dec 9, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library 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