Skip to content

Comments

Rollup of 8 pull requests#153059

Closed
GuillaumeGomez wants to merge 25 commits intorust-lang:mainfrom
GuillaumeGomez:rollup-bobduJ9
Closed

Rollup of 8 pull requests#153059
GuillaumeGomez wants to merge 25 commits intorust-lang:mainfrom
GuillaumeGomez:rollup-bobduJ9

Conversation

@GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost

Create a similar rollup

Trivaxy and others added 25 commits January 21, 2026 05:04
Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
The name `pass_by_value` is completely wrong. The lint actually checks
for the use of pass by reference for types marked with
`rustc_pass_by_value`.

The hardest part of this was choosing the new name. The `disallowed_`
part of the name closely matches the following clippy lints:
- `disallowed_macros`
- `disallowed_methods`
- `disallowed_names`
- `disallowed_script_idents`
- `disallowed_types`

The `pass_by_value` part of the name aligns with the following clippy
lints:
- `needless_pass_by_value`
- `needless_pass_by_ref_mut`
- `trivially_copy_pass_by_ref`
- `large_types_passed_by_value` (less so)
…ark-Simulacrum

ptr::replace: make calls on ZST null ptr not UB

See rust-lang#138351 for context.

We made `ptr::read` and `ptr::write` not UB on ZST null pointers. This does the same with `ptr::replace`. Since we're just adding a branch on a constant, this should come at no runtime cost.
Fix doc link used in suggestion for pinning self

Fixes rust-lang#147901

The old suggestion linked to a documentation page that [no longer exists](https://rust-lang.github.io/async-book/04_pinning/01_chapter.html#pinning-in-practice). Presumably, [this](https://rust-lang.github.io/async-book/part-reference/pinning.html) is the better place to link to now
…le, r=estebank

rustc_expand: improve diagnostics for non-repeatable metavars

Fix rust-lang#47452.
…ywiser

Implement debuginfo for unsafe binder types

Fixes: rust-lang#139462

This treats an unsafe binder like a struct with a single field. This way we'd have the binder's distinct type name while keeping the wrapped value accessible.

Tracking:
- rust-lang#130516
…vooeo

delete some very old trivial `Box` tests

There's still lots more of these tests; these are just a few duplicated ones I found. None of the tests really test for something interesting except that `Deref{Mut}` trivially works with boxes, but there are still loads of more tests that do the same.
In the past, these tests presumably looked more different to each other than today, with `Box`-like pointers being primitives etc.

This PR is also to check whether such changes (deleting of useless tests) are wanted in general.

Part of rust-lang#133895.
rustc_public: Make fields that shouldn't be exposed visible only in `rustc_public`

Previously these fields had to be public since the convert logic was in the `rustc_smir` crate, however that is no longer the case today.
…, r=Urgau

Rename `rustc::pass_by_value` lint as `rustc::disallowed_pass_by_ref`.

The name `pass_by_value` is completely wrong. The lint actually checks for the use of pass by reference for types marked with `rustc_pass_by_value`.

The hardest part of this was choosing the new name. The `disallowed_` part of the name closely matches the following clippy lints:
- `disallowed_macros`
- `disallowed_methods`
- `disallowed_names`
- `disallowed_script_idents`
- `disallowed_types`

The `pass_by_value` part of the name aligns with the following clippy lints:
- `needless_pass_by_value`
- `needless_pass_by_ref_mut`
- `trivially_copy_pass_by_ref`
- `large_types_passed_by_value` (less so)

r? @Urgau
…athanBrouwer

Migration of `LintDiagnostic` - part 3

Follow-up of rust-lang#152933 and of rust-lang#153016.

More `LintDiagnostic` items being migrated to `Diagnostic`. Since there is no remaining `emit_node_span_lint` calls, I replaced the method with the code of `emit_diag_node_span_lint`.

r? @JonathanBrouwer
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 24, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 24, 2026
@rustbot rustbot added 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. labels Feb 24, 2026
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=5 rollup=never

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 24, 2026

📌 Commit fea905f has been approved by GuillaumeGomez

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 Feb 24, 2026
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 25, 2026
Rollup of 8 pull requests

Successful merges:

 - #149169 (ptr::replace: make calls on ZST null ptr not UB)
 - #150562 (Fix doc link used in suggestion for pinning self)
 - #152679 (rustc_expand: improve diagnostics for non-repeatable metavars)
 - #153017 (Implement debuginfo for unsafe binder types)
 - #152868 (delete some very old trivial `Box` tests)
 - #152922 (rustc_public: Make fields that shouldn't be exposed visible only in `rustc_public`)
 - #153029 (Rename `rustc::pass_by_value` lint as `rustc::disallowed_pass_by_ref`.)
 - #153051 (Migration of `LintDiagnostic` - part 3)
@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)
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    b72a662c47e3   3 weeks ago   790MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:57ef9cc45f72cc4258ee1baa8243bc3cd55c0a0e570b6768c37346247be35f0d
deleted: sha256:b72a662c47e31df2e7bf59368b2b83be239f02a1baa721393717711a1a719df9
deleted: sha256:3e13ccd80f19769f39008cfc6549938e1ea4905f47b028c1df2dd6085191386c
deleted: sha256:842807995a512b2c5a9b241a3aecdbe79af6b0642d96fa5460cfcf0c9d8be295
deleted: sha256:0f9074b9f46f4570eb7cb4b65fcb3c3d909f9b1d14ca66b30508117b6deda303
deleted: sha256:2ca99cb9251d19157c56b5d91c8961bb4b35196a5ca9b4ffdccbf24abbfe2a5f
---
set -ex

# Run a subset of tests. Used to run tests in parallel in multiple jobs.

# When this job partition is run as part of PR CI, skip tidy to allow revealing more failures. The
# dedicated `tidy` job failing won't block other PR CI jobs from completing, and so tidy failures
# shouldn't inhibit revealing other failures in PR CI jobs.
if [ "$PR_CI_JOB" == "1" ]; then
  echo "PR_CI_JOB set; skipping tidy"
  SKIP_TIDY="--skip tidy"
fi

../x.py --stage 2 test \
  ${SKIP_TIDY:+$SKIP_TIDY} \
  --skip compiler \
  --skip src
#!/bin/bash

set -ex

# Run a subset of tests. Used to run tests in parallel in multiple jobs.

# When this job partition is run as part of PR CI, skip tidy to allow revealing more failures. The
# dedicated `tidy` job failing won't block other PR CI jobs from completing, and so tidy failures
# shouldn't inhibit revealing other failures in PR CI jobs.
if [ "$PR_CI_JOB" == "1" ]; then
  echo "PR_CI_JOB set; skipping tidy"
  SKIP_TIDY="--skip tidy"
fi

../x.py --stage 2 test \
  ${SKIP_TIDY:+$SKIP_TIDY} \
  --skip tests \
  --skip coverage-map \
  --skip coverage-run \
  --skip library \
  --skip tidyselftest
---
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_enabled ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#aarch64 ... ok
test [ui] tests/ui/abi/anon-extern-mod.rs ... ok
test [ui] tests/ui/abi/abi-sysv64-register-usage.rs ... ok
test [ui] tests/ui/abi/avr-sram.rs#disable_sram ... ok
test [ui] tests/ui/abi/avr-sram.rs#has_sram ... ok
test [ui] tests/ui/abi/avr-sram.rs#no_sram ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#arm ... ok
test [ui] tests/ui/abi/bad-custom.rs ... ok
test [ui] tests/ui/abi/abi-sysv64-arg-passing.rs ... ok
test [ui] tests/ui/abi/c-stack-as-value.rs ... ok
test [ui] tests/ui/abi/c-zst.rs#aarch64-darwin ... ok
---
test [ui] tests/ui/asm/aarch64/type-f16.rs ... ignored, only executed when the architecture is aarch64
test [ui] tests/ui/array-slice-vec/vector-no-ann-2.rs ... ok
test [ui] tests/ui/array-slice-vec/vector-slice-matching-8498.rs ... ok
test [ui] tests/ui/asm/aarch64/arm64ec-sve.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#hf ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#r82 ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#sf ... ok
test [ui] tests/ui/asm/arm-low-dreg.rs ... ok
test [ui] tests/ui/asm/binary_asm_labels.rs ... ok
test [ui] tests/ui/asm/binary_asm_labels_allowed.rs ... ignored, only executed when the architecture is aarch64
test [ui] tests/ui/asm/asm-with-nested-closure.rs ... ok
test [ui] tests/ui/asm/cfg-parse-error.rs ... ok
---
test [ui] tests/ui/const-generics/occurs-check/unused-substs-3.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-4.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic-fail.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-5.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic.rs ... ok
test [ui] tests/ui/const-generics/ogca/rhs-but-not-root.rs ... ok
test [ui] tests/ui/const-generics/ogca/coherence-ambiguous.rs ... ok
test [ui] tests/ui/const-generics/opaque_types.rs ... ok
test [ui] tests/ui/const-generics/outer-lifetime-in-const-generic-default.rs ... ok
test [ui] tests/ui/const-generics/opaque_types2.rs ... ok
test [ui] tests/ui/const-generics/overlapping_impls.rs ... ok
test [ui] tests/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs#full ... ok
---
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat2 ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat3 ... ok
test [ui] tests/ui/extern/issue-80074.rs ... ok
test [ui] tests/ui/extern/issue-95829.rs ... ok
test [ui] tests/ui/extern/lgamma-linkage.rs ... ok
test [ui] tests/ui/extern/no-mangle-associated-fn.rs ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/extern/windows-tcb-trash-13259.rs ... ok
test [ui] tests/ui/feature-gates/allow-features-empty.rs ... ok
---
test [ui] tests/ui/feature-gates/feature-gate-macro-derive.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-marker_trait_attr.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-may-dangle.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-mgca-type-const-syntax.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-more-maybe-bounds.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-min-generic-const-args.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-min_const_fn.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-more-qualified-paths.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-movrs_target_feature.rs ... ok
---
test [ui] tests/ui/imports/ambiguous-7.rs ... ok
test [ui] tests/ui/imports/ambiguous-import-visibility-module.rs ... ok
test [ui] tests/ui/imports/ambiguous-8.rs ... ok
test [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-glob-vs-multiouter.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-globvsglob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-no-implicit-prelude.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-core-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-std-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-core.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-std.rs ... ok
---
test [ui] tests/ui/layout/post-mono-layout-cycle.rs ... ok
test [ui] tests/ui/layout/randomize.rs#normal ... ok
test [ui] tests/ui/layout/randomize.rs#randomize-layout ... ok
test [ui] tests/ui/layout/null-pointer-optimization.rs ... ok
test [ui] tests/ui/layout/rigid-alias-due-to-broken-impl.rs ... ok
test [ui] tests/ui/layout/size-of-val-raw-too-big.rs ... ignored, only executed when the pointer width is 32bit (Layout computation rejects this layout for different reasons on 64-bit.)
test [ui] tests/ui/layout/reprc-power-alignment.rs ... ok
test [ui] tests/ui/layout/struct.rs ... ok
test [ui] tests/ui/layout/rust-call-abi-not-a-tuple-ice-81974.rs ... ok
test [ui] tests/ui/layout/thaw-validate-invalid-enum.rs ... ok
---
error: ui test did not emit an error
note: by default, ui tests are expected not to compile.
hint: use check-pass, build-pass, or run-pass directive to change this behavior.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" "/checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.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/stage0-sysroot" "--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-fulldeps/internal-lints/rustc_pass_by_value" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Z" "unstable-options"
stdout: none
--- stderr -------------------------------
warning: unknown lint: `rustc::disallowed_pass_by_ref`
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:5:9
   |
---

warning: passing `Ty<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:14:13
   |
LL |     ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
   |             ^^^^^^^ help: try passing by value: `Ty<'_>`
   |
   = note: `#[warn(rustc::pass_by_value)]` (part of `#[warn(rustc::internal)]`) on by default

warning: passing `TyCtxt<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:16:18
   |
LL |     ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
   |                  ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`

warning: passing `Ty<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:20:28
   |
---

warning: passing `Ty<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:27:17
   |
LL |         ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
   |                 ^^^^^^^ help: try passing by value: `Ty<'_>`

warning: passing `TyCtxt<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:29:22
   |
LL |         ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
   |                      ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`

warning: passing `Ty<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:32:41
   |
---

warning: passing `Ty<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:54:17
   |
LL |         ty_ref: &Ty<'_>, //~ ERROR passing `Ty<'_>` by reference
   |                 ^^^^^^^ help: try passing by value: `Ty<'_>`

warning: passing `TyCtxt<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:56:22
   |
LL |         ty_ctxt_ref: &TyCtxt<'_>, //~ ERROR passing `TyCtxt<'_>` by reference
   |                      ^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_>`

warning: passing `Ty<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:60:38
   |
---

warning: passing `CustomEnum` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:74:20
   |
LL |         reference: &CustomEnum, //~ ERROR passing `CustomEnum` by reference
   |                    ^^^^^^^^^^^ help: try passing by value: `CustomEnum`

warning: passing `CustomStruct` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:85:24
   |
LL | type CustomAlias<'a> = &'a CustomStruct; //~ ERROR passing `CustomStruct` by reference
   |                        ^^^^^^^^^^^^^^^^ help: try passing by value: `CustomStruct`

warning: passing `CustomStruct` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:90:20
   |
LL |         reference: &CustomStruct, //~ ERROR passing `CustomStruct` by reference
   |                    ^^^^^^^^^^^^^ help: try passing by value: `CustomStruct`

warning: passing `CustomAlias<'_>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:96:20
   |
LL |         reference: &CustomAlias, //~ ERROR passing `CustomAlias<'_>` by reference
   |                    ^^^^^^^^^^^^ help: try passing by value: `CustomAlias<'_>`

warning: passing `WithParameters<T, 1>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:110:20
   |
LL |         reference: &'a WithParameters<T, 1>, //~ ERROR passing `WithParameters<T, 1>` by reference
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^ help: try passing by value: `WithParameters<T, 1>`

warning: passing `WithParameters<T, 1, u32>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:111:27
   |
LL |         reference_with_m: &WithParameters<T, 1, u32>, //~ ERROR passing `WithParameters<T, 1, u32>` by reference
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try passing by value: `WithParameters<T, 1, u32>`

warning: passing `WithParameters<T, 1>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:112:10
   |
LL |     ) -> &'a WithParameters<T, 1> {
   |          ^^^^^^^^^^^^^^^^^^^^^^^^ help: try passing by value: `WithParameters<T, 1>`

warning: passing `WithParameters<_, 1>` by reference
##[warning]  --> /checkout/tests/ui-fulldeps/internal-lints/rustc_pass_by_value.rs:114:22
   |
LL |         reference as &WithParameters<_, 1> //~ ERROR passing `WithParameters<_, 1>` by reference
   |                      ^^^^^^^^^^^^^^^^^^^^^ help: try passing by value: `WithParameters<_, 1>`

warning: 21 warnings emitted
------------------------------------------

@rust-bors rust-bors bot 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 Feb 25, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 25, 2026

💔 Test for 2e02105 failed: CI. Failed job:

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 25, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 25, 2026

PR #153029, which is a member of this rollup, was unapproved.
This rollup was thus also unapproved.

@jhpratt jhpratt closed this Feb 25, 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 Feb 25, 2026
@GuillaumeGomez GuillaumeGomez deleted the rollup-bobduJ9 branch February 25, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) rollup A PR which is a rollup 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.

10 participants