Skip to content

Comments

Rollup of 7 pull requests#152932

Closed
matthiaskrgr wants to merge 16 commits intorust-lang:mainfrom
matthiaskrgr:rollup-2vn7GPw
Closed

Rollup of 7 pull requests#152932
matthiaskrgr wants to merge 16 commits intorust-lang:mainfrom
matthiaskrgr:rollup-2vn7GPw

Conversation

@matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost

Create a similar rollup

GrigorenkoPV and others added 16 commits January 24, 2026 21:32
Previously, `self.props.compile_flags.windows(2)` would return an empty
iterator in the case where `self.props.compile_flags` was 1 or 0 length.

This created incorrectness where tests like
`tests/mir-opt/pre-codegen/copy_and_clone.rs` would pass when they should fail.
`IntoQueryParam` is a trait that lets query callers be a bit sloppy with
the passed-in key.
- Types similar to `DefId` will be auto-converted to `DefId`. Likewise
  for `LocalDefId`.
- Reference types will be auto-derefed.

The auto-conversion is genuinely useful; the auto-derefing much less so.
In practice it's only used for passing `&DefId` to queries that accept
`DefId`, which is an anti-pattern because `DefId` is marked with
`#[rustc_pass_by_value]`.

This commit removes the auto-deref impl and makes the necessary sigil
adjustments. (I generally avoid using `*` to deref manually at call
sites, preferring to deref via `&` in patterns or via `*` in match
expressions. Mostly because that way a single deref often covers
multiple call sites.)
Same as 147495, just keeping it up-to-date.
…-ref-P, r=oli-obk

Remove `impl IntoQueryParam<P> for &'a P`.

`IntoQueryParam` is a trait that lets query callers be a bit sloppy with the passed-in key.
- Types similar to `DefId` will be auto-converted to `DefId`. Likewise for `LocalDefId`.
- Reference types will be auto-derefed.

The auto-conversion is genuinely useful; the auto-derefing much less so. In practice it's only used for passing `&DefId` to queries that accept `DefId`, which is an anti-pattern because `DefId` is marked with `#[rustc_pass_by_value]`.

This commit removes the auto-deref impl and makes the necessary sigil adjustments. (I generally avoid using `*` to deref manually at call sites, preferring to deref via `&` in patterns or via `*` in match expressions. Mostly because that way a single deref often covers multiple call sites.)

r? @cjgillot
…r=mati865

Tighten the `!range` bounds on alignments in vtables

Right now we're only telling LLVM that they're non-zero, but alignments must be powers of two so can't be more than `isize::MAX+1`.  And we actually never emit anything beyond LLVM's limit of 2²⁹, so outside of 16-bit targets the limit is that.

(Pulled out from rust-lang#152867 which is starting to have too much in it.)
… r=jhpratt

Stabilize `str_as_str`

- Tracking issue: rust-lang#130366
- Needs FCP
- `ByteStr` methods remain gated behind `bstr` feature gate (rust-lang#134915)

Closes rust-lang#130366
Remove two more flaky assertions from `oneshot` tests

These elapsed-time-upper-bound assertions are inherently flaky in CI, because CI runners will sometimes starve individual threads for a surprisingly long time, so the assertions can fail even if nothing went wrong.

Similar changes for other flaky `oneshot` tests:
- rust-lang#152145
- rust-lang#152648

Example flaky failure:
- rust-lang#152747 (comment)
…al-sv-init, r=mati865

Error on attempt to construct scalable vector type

If you attempt to construct a scalable vector type rust will ICE.

E.g.:
```rust
#[rustc_scalable_vector(4)]
#[allow(non_camel_case_types)]
struct svint32_t(i32);
fn main() {
    let foo = svint32_t(1);
    // This will ICE
}
```

This PR adds a check that will emit an error if you attempt to use a SV constructor and a test to ensure it works.
…on-flag-check, r=clubby789,jieyouxu

Improve runtest revision redundant cfg check

While attempting to ingest rust-lang#148034 via ferrocene/ferrocene#2172 we noticed a test failure, as we add some `compile_flags` to tests.

We saw a failure looking like this:

```
Testing stage1 with compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu)

running 2 tests
2026-02-20T20:21:28.846102Z ERROR compiletest::runtest: redundant cfg argument `copy` is already created by the revision

[mir-opt] tests/mir-opt/pre-codegen/copy_and_clone.rs#COPY ... F
.
```

While my Rust checkout passed:

```
Testing stage1 with compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu)

running 2 tests
..

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 381 filtered out; finished in 107.10ms
```

This caused me to add some debugging statements.

Ferrocene:

```
2026-02-20T21:05:39.808427Z ERROR compiletest::runtest: "copy": does ["--edition=2015", "--cfg=copy"] contain `"--cfg=copy"` or `["--cfg", "copy"]`? true
2026-02-20T21:05:39.808427Z ERROR compiletest::runtest: "clone": does ["--edition=2015"] contain `"--cfg=clone"` or `["--cfg", "clone"]`? false
2026-02-20T21:05:39.808435Z ERROR compiletest::runtest: redundant cfg argument `copy` is already created by the revision
```

Rust:

```
2026-02-20T21:04:18.493158Z ERROR compiletest::runtest: "copy": does ["--cfg=copy"] contain `"--cfg=copy"` or `["--cfg", "copy"]`? false
2026-02-20T21:04:18.493158Z ERROR compiletest::runtest: "clone": does [] contain `"--cfg=clone"` or `["--cfg", "clone"]`? false
```

I noticed while reviewing the related functionality that there is a call to `.windows(2)` in the relevant check for redundant cfgs:

https://github.com/rust-lang/rust/blob/0376d43d443cba463a0b6a6ec9140ea17d7b7130/src/tools/compiletest/src/runtest.rs#L507-L511

Noting:

https://github.com/rust-lang/rust/blob/0376d43d443cba463a0b6a6ec9140ea17d7b7130/library/core/src/slice/mod.rs#L1064-L1066

Because of this, the revision check was getting an empty iterator when `self.props.compile_flags` was length 0 or 1.

This fix adjusts the check to handle such cases.

I went ahead and fixed the relevant test (4b3cd9b) that was impacted by this. I do not suspect there are others, at least within the scope that Ferrocene tests, as we have not previously seen this failure.
…-ld, r=jieyouxu

Update wasm-component-ld

Same as rust-lang#147495, just keeping it up-to-date.
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 21, 2026
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 21, 2026
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 21, 2026

📌 Commit 25de8d6 has been approved by matthiaskrgr

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 21, 2026
@rust-log-analyzer
Copy link
Collaborator

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[group]Runner Image Provisioner
Hosted Compute Agent
Version: 20260123.484
Commit: 6bd6555ca37d84114959e1c76d2c01448ff61c5d
Build Date: 2026-01-23T19:41:17Z
Worker ID: {76052bd7-d588-477a-bb31-6f4a6a6f56c1}
Azure Region: westcentralus
##[endgroup]
##[group]Operating System
Ubuntu
24.04.3
LTS
---
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
---
[RUSTC-TIMING] rustc_hir_analysis test:false 5.469
    Checking rustc_hir_typeck v0.0.0 (/checkout/compiler/rustc_hir_typeck)
[RUSTC-TIMING] rustc_mir_transform test:false 5.081
[RUSTC-TIMING] rustc_borrowck test:false 4.352
error[E0277]: the trait bound `&rustc_span::def_id::DefId: IntoQueryParam<rustc_span::def_id::DefId>` is not satisfied
    --> compiler/rustc_hir_typeck/src/callee.rs:434:83
     |
 434 |             && let def::DefKind::Ctor(def::CtorOf::Struct, _) = self.tcx.def_kind(def_id)
     |                                                                          -------- ^^^^^^ the nightly-only, unstable trait `IntoQueryParam<rustc_span::def_id::DefId>` is not implemented for `&rustc_span::def_id::DefId`
     |                                                                          |
     |                                                                          required by a bound introduced by this call
     |
note: required by a bound in `queries::<impl TyCtxt<'tcx>>::def_kind`
    --> compiler/rustc_middle/src/query/plumbing.rs:280:23
     |
 279 | / macro_rules! query_helper_param_ty {
 280 | |     (DefId) => { impl $crate::query::IntoQueryParam<DefId> };
     | |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `queries::<impl TyCtxt<'tcx>>::def_kind`
 281 | |     (LocalDefId) => { impl $crate::query::IntoQueryParam<LocalDefId> };
 282 | |     ($K:ty) => { $K };
 283 | | }
     | |_- in this expansion of `query_helper_param_ty!` (#3)
...
 350 | / macro_rules! define_callbacks {
 351 | |     (
 352 | |         $(
 353 | |             $(#[$attr:meta])*
...    |
 489 | |             pub fn $name(self, key: query_helper_param_ty!($($K)*)) -> $V
     | |                                     ------------------------------ in this macro invocation (#3)
...    |
 577 | |     };
 578 | | }
     | |_- in this expansion of `define_callbacks!` (#2)
---
2778 |   rustc_with_all_queries! { define_callbacks! }
     |   --------------------------------------------- in this macro invocation (#1)
help: consider dereferencing here
     |
 434 |             && let def::DefKind::Ctor(def::CtorOf::Struct, _) = self.tcx.def_kind(*def_id)
     |                                                                                   +

For more information about this error, try `rustc --explain E0277`.
[RUSTC-TIMING] rustc_hir_typeck test:false 4.519
error: could not compile `rustc_hir_typeck` (lib) due to 1 previous error

@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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 21, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 21, 2026

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

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

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. 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.

10 participants