Skip to content

Rollup of 11 pull requests#156658

Closed
JonathanBrouwer wants to merge 32 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-pBUmW9y
Closed

Rollup of 11 pull requests#156658
JonathanBrouwer wants to merge 32 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-pBUmW9y

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@JonathanBrouwer JonathanBrouwer commented May 17, 2026

Successful merges:

r? @ghost

Create a similar rollup

thiago-fealves and others added 30 commits May 4, 2026 10:55
…r` is found

This commit adds a diagnostic suggestion to help users who forget to
call `.collect()` when they have an iterator and the function or
variable expects a `String`.

The logic checks if the expected type is `std::string::String` and if
the found type implements the `Iterator` trait, if so the compiler
provides a suggestion to add `.collect()`

Includes also a UI test to verify if the suggestion appears correctly
Co-authored-by: Qai Juang <qaijuang@gmail.com>
For now, this is a 1-to-1 copy of `LayoutData`, but this will change.
It was always set to `Variants::Single`.
Enum variants always have `Arbitrary` layout, so the enum isn't needed.
This field is only used during layout calculations, so re-synthetized
`LayoutData`s for enum variants can use a dummy value instead.
Reusing the alignment of the enclosing enum in `LayoutData::for_variant`
doesn't appear to cause any issues.
It has a single call site.
It was only used by rustdoc and doesn't seem like it was necessary
there. No tests fail at least.
This works, but I couldn't find any test cases for it.
`LintExpectationId` has two variants, `Unstable` and `Stable`. There are
some places where both variants are possible, but there are also places
where only one of `Unstable` or `Stable` is possible.

This commit encodes this into the type system by introducing
new types `UnstableLintExpectationId` and `StableLintExpectationId`. The
variants of `LintExpectationId` now enclose these. This makes it clearer
what values are possible where.

Other things of note:
- `LintLevelsProvider` gets an associated type and some method changes.
- `LintContext` gets an associated type.
- `LevelSpec` is made generic. `UnstableLevelSpec` and `StableLevelSpec`
  typedefs are added.
- The unstable types are now guaranteed by the type system to never be
  stably hashed. Previously this was a runtime check.
I find these make the code harder to understand.
Describing things that took me a while to work out.
Remove redundant information in `rustc_abi::Variants`

Follow-up to rust-lang#151040; partially addresses rust-lang#113988.

Replaces the nested `LayoutData` in `Variants::Multiple` by a new, smaller `VariantLayout` struct, and adjust `LayoutData::for_variant`and the layout algorithm in consequence.
This PR is best reviewed commit-by-commit.
…notriddle

Remove driver_lint_caps

It was only used by rustdoc and doesn't seem like it was necessary there. No tests fail at least.

r? rust-lang/rustdoc
…ing, r=estebank

compiler: suggest `.collect()` when `String` is expected and `Iterator` is found

This commit adds a diagnostic suggestion to help users who forget to call `.collect()` when they have an iterator and the function or variable expects a `String`.

The logic checks if the expected type is `std::string::String` and if the found type implements the `Iterator` trait, if so the compiler provides a suggestion to add `.collect()`

Includes also a UI test to verify if the suggestion appears correctly
…-1, r=saethlin

Emit retags in codegen to support BorrowSanitizer (part 1)

Tracking issue: rust-lang#154760
[Zulip Thread](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Staging.20for.20emitting.20retags.20in.20codegen/with/593004012)

This is the first of several PRs that will add experimental support for emitting retags as function calls in codegen. Each PR will be a minimal, improved slice of the changes in rust-lang#155965.

This PR contains all of the changes that will affect codegen backends. It adds methods to `IntrinsicCallBuilderMethods` for emitting each kind of retag call.

cc: @RalfJung
… r=GuillaumeGomez

Split `LintExpectationId`s

This PR makes clearer where stable and unstable `LintExpectationIds` can occur, plus a few other small cleanups. Details in individual commits.

r? @GuillaumeGomez
…=mejrs

Test EII UI tests with prefer-dynamic

Tracking issue: rust-lang#125418

Remove `no-prefer-dynamic` from the EII UI tests now that rust-lang#153648 fixed exporting EII declaration aliases from dylibs.

Fixes rust-lang#151271.

Tested with:

```sh
python3 x.py test tests/ui/eii --force-rerun
```
…uillaumeGomez

rustdoc: add test case for `-Drustdoc::` and `--cap-lints`

This works, but I couldn't find any test cases for it.
…est, r=mu001999

Add regression test for issue rust-lang#41261

Adds a regression test for rust-lang#41261.
…r, r=JohnTitor

rename unexpected_try_recover function

While reading the code, the doc comment and the name of the function `unexpected_try_recover` confused me. The doc said it tries to recover if it is a closing delimiter but I see no recovering code and the function always return an error.

So I change the name of the function to `unexpected_err` and change the return value to `Diag<'a>`. I also update the doc comment.
…=Kivooeo

minor `rustc_mir_transform` cleanup

Some minor things I noticed here and there while reading though code
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 17, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels May 17, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=4

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-2

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 17, 2026

📌 Commit 88811ee has been approved by JonathanBrouwer

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 May 17, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 17, 2026
Rollup of 11 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-2
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-apple failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.01ms

all doctests ran in 0.25s; merged doctests compilation took 0.24s
   Doc-tests rustc_baked_icu_data
warning: hidden lifetime parameters in types are deprecated
  --> compiler/rustc_baked_icu_data/src/data/list_and_v1.rs.data:34:47
   |
34 | ...   fn load(&self, req: icu_provider::DataRequest) -> Result<icu_provider::DataResponse<icu_list::provider::ListAndV1>, icu_provid...
   |                           --------------^^^^^^^^^^^
   |                           |
   |                           expected lifetime parameter
   |
  ::: compiler/rustc_baked_icu_data/src/lib.rs:32:5
   |
32 |     impl_data_provider!(BakedDataProvider);
   |     -------------------------------------- in this macro invocation
   |
note: the lint level is defined here
  --> <crate attribute>:1:9
   |
 1 | #![warn(rust_2018_idioms)]
   |         ^^^^^^^^^^^^^^^^
   = note: `#[warn(elided_lifetimes_in_paths)]` implied by `#[warn(rust_2018_idioms)]`
   = note: this warning originates in the macro `impl_list_and_v1` which comes from the expansion of the macro `impl_data_provider` (in Nightly builds, run with -Z macro-backtrace for more info)
help: indicate the anonymous lifetime
   |
34 |             fn load(&self, req: icu_provider::DataRequest<'_>) -> Result<icu_provider::DataResponse<icu_list::provider::ListAndV1>, icu_provider::DataError> {
   |                                                          ++++

warning: 1 warning emitted


---
 Documenting rustc_lint_defs v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_lint_defs)
 Documenting rustc_error_messages v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_error_messages)
 Documenting rustc_ast v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_ast)
 Documenting rustc_baked_icu_data v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_baked_icu_data)
warning: hidden lifetime parameters in types are deprecated
  --> compiler/rustc_baked_icu_data/src/data/list_and_v1.rs.data:34:47
   |
34 | ...   fn load(&self, req: icu_provider::DataRequest) -> Result<icu_provider::DataResponse<icu_list::provider::ListAndV1>, icu_provid...
   |                           --------------^^^^^^^^^^^
   |                           |
   |                           expected lifetime parameter
   |
  ::: compiler/rustc_baked_icu_data/src/lib.rs:32:5
   |
32 |     impl_data_provider!(BakedDataProvider);
   |     -------------------------------------- in this macro invocation
   |
note: the lint level is defined here
  --> <crate attribute>:1:9
   |
 1 | #![warn(rust_2018_idioms)]
   |         ^^^^^^^^^^^^^^^^
   = note: `#[warn(elided_lifetimes_in_paths)]` implied by `#[warn(rust_2018_idioms)]`
   = note: this warning originates in the macro `impl_list_and_v1` which comes from the expansion of the macro `impl_data_provider` (in Nightly builds, run with -Z macro-backtrace for more info)
help: indicate the anonymous lifetime
   |
34 |             fn load(&self, req: icu_provider::DataRequest<'_>) -> Result<icu_provider::DataResponse<icu_list::provider::ListAndV1>, icu_provider::DataError> {
   |                                                          ++++

 Documenting rustc_proc_macro v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_proc_macro)
 Documenting rustc_ast_ir v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_ast_ir)
 Documenting rustc_hir_id v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_hir_id)
 Documenting rustc_span v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_span)
 Documenting rustc_data_structures v0.0.0 (/Users/runner/work/rust/rust/compiler/rustc_data_structures)
error: `rustc_baked_icu_data` (lib doc) generated 1 warning
error: warnings are denied by `build.warnings` configuration
warning: build failed, waiting for other jobs to finish...
Command `/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0/bin/cargo doc -Zwarnings --target aarch64-apple-darwin -Zbinary-dep-depinfo -j 3 -Zroot-dir=/Users/runner/work/rust/rust --locked --color=always --profile=release --features 'jemalloc llvm rustc' --manifest-path /Users/runner/work/rust/rust/compiler/rustc/Cargo.toml -Zskip-rustdoc-fingerprint --no-deps -Zrustdoc-map -p rustc-main -p rustc_abi -p rustc_arena -p rustc_ast -p rustc_ast_ir -p rustc_ast_lowering -p rustc_ast_passes -p rustc_ast_pretty -p rustc_attr_parsing -p rustc_baked_icu_data -p rustc_borrowck -p rustc_builtin_macros -p rustc_codegen_llvm -p rustc_codegen_ssa -p rustc_const_eval -p rustc_data_structures -p rustc_driver -p rustc_driver_impl -p rustc_error_codes -p rustc_error_messages -p rustc_errors -p rustc_expand -p rustc_feature -p rustc_fs_util -p rustc_graphviz -p rustc_hashes -p rustc_hir -p rustc_hir_analysis -p rustc_hir_id -p rustc_hir_pretty -p rustc_hir_typeck -p rustc_incremental -p rustc_index -p rustc_index_macros -p rustc_infer -p rustc_interface -p rustc_lexer -p rustc_lint -p rustc_lint_defs -p rustc_llvm -p rustc_log -p rustc_macros -p rustc_metadata -p rustc_middle -p rustc_mir_build -p rustc_mir_dataflow -p rustc_mir_transform -p rustc_monomorphize -p rustc_next_trait_solver -p rustc_parse -p rustc_parse_format -p rustc_passes -p rustc_pattern_analysis -p rustc_privacy -p rustc_proc_macro -p rustc_public -p rustc_public_bridge -p rustc_query_impl -p rustc_resolve -p rustc_sanitizers -p rustc_serialize -p rustc_session -p rustc_span -p rustc_symbol_mangling -p rustc_target -p rustc_thread_pool -p rustc_trait_selection -p rustc_traits -p rustc_transmute -p rustc_ty_utils -p rustc_type_ir -p rustc_type_ir_macros -p rustc_windows_rc [workdir=/Users/runner/work/rust/rust]` failed with exit code 101
Created at: src/bootstrap/src/core/build_steps/doc.rs:916:25
Executed at: src/bootstrap/src/core/build_steps/doc.rs:977:26

--- BACKTRACE vvv
   0: std::backtrace_rs::backtrace::libunwind::trace
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:117:9
   1: std::backtrace_rs::backtrace::trace_unsynchronized::<<std::backtrace::Backtrace>::create::{closure#0}>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:14
   2: <std::backtrace::Backtrace>::create
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/backtrace.rs:331:13
   3: <bootstrap::utils::exec::DeferredCommand>::finish_process
             at ./src/bootstrap/src/utils/exec.rs:939:17
   4: <bootstrap::utils::exec::DeferredCommand>::wait_for_output::<&bootstrap::utils::exec::ExecutionContext>
             at ./src/bootstrap/src/utils/exec.rs:831:21
   5: <bootstrap::utils::exec::ExecutionContext>::run
             at ./src/bootstrap/src/utils/exec.rs:741:45
   6: <bootstrap::utils::exec::BootstrapCommand>::run::<&bootstrap::core::builder::Builder>
             at ./src/bootstrap/src/utils/exec.rs:339:27
   7: <bootstrap::core::build_steps::doc::Rustc as bootstrap::core::builder::Step>::run
             at ./src/bootstrap/src/core/build_steps/doc.rs:977:26
   8: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::doc::Rustc>
             at ./src/bootstrap/src/core/builder/mod.rs:1595:36
   9: <bootstrap::core::build_steps::test::HtmlCheck as bootstrap::core::builder::Step>::run
             at ./src/bootstrap/src/core/build_steps/test.rs:240:17
  10: <bootstrap::core::builder::Builder>::ensure::<bootstrap::core::build_steps::test::HtmlCheck>
             at ./src/bootstrap/src/core/builder/mod.rs:1595:36
  11: <bootstrap::core::build_steps::test::HtmlCheck as bootstrap::core::builder::Step>::make_run
             at ./src/bootstrap/src/core/build_steps/test.rs:227:21
  12: <bootstrap::core::builder::StepDescription>::maybe_run
             at ./src/bootstrap/src/core/builder/mod.rs:476:13
  13: bootstrap::core::builder::cli_paths::match_paths_to_steps_and_run
             at ./src/bootstrap/src/core/builder/cli_paths.rs:141:22
  14: <bootstrap::core::builder::Builder>::run_step_descriptions
             at ./src/bootstrap/src/core/builder/mod.rs:1138:9
  15: <bootstrap::core::builder::Builder>::execute_cli
             at ./src/bootstrap/src/core/builder/mod.rs:1117:14
  16: <bootstrap::Build>::build
             at ./src/bootstrap/src/lib.rs:803:25
  17: bootstrap::main
             at ./src/bootstrap/src/bin/main.rs:130:11
  18: <fn() as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/core/src/ops/function.rs:250:5
  19: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/sys/backtrace.rs:166:18
  20: std::rt::lang_start::<()>::{closure#0}
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/rt.rs:206:18
  21: <&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe as core::ops::function::FnOnce<()>>::call_once
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/core/src/ops/function.rs:287:21
  22: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/panicking.rs:581:40
  23: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/panicking.rs:544:19
  24: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/panic.rs:359:14
  25: std::rt::lang_start_internal::{closure#0}
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/rt.rs:175:24
  26: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/panicking.rs:581:40
---
             at /rustc/ef0fb8a2563200e322fa4419f09f65a63742038c/library/std/src/rt.rs:205:5
  31: _main


Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `--stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin`
Build completed unsuccessfully in 2:22:14
  local time: Sun May 17 09:57:58 UTC 2026
  network time: Sun, 17 May 2026 09:57:59 GMT
##[error]Process completed with exit code 1.

@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 17, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 17, 2026

💔 Test for e961a81 failed: CI. Failed job:

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 17, 2026

This pull request was unapproved due to being closed.

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 17, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 17, 2026
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. A-rustc-dev-guide Area: rustc-dev-guide rollup A PR which is a rollup 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.