Skip to content

Conversation

@matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost

Create a similar rollup

hkBst and others added 30 commits October 7, 2025 14:34
… duration under Win7

Fixes rust-lang#149935. See the added comment for more details.

Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
This fixes stage1 builds when the proc-macro bridge api changed.
The rustc_proc_macro crate is identical to the proc_macro that would end
up in the sysroot of the rustc compiler rustc_proc_macro is linked into.
They break whenever the proc macro ABI changes due to it building a proc
macro against the bootstrap sysroot.
It is a singleton which doesn't actually need to be passed through over
the bridge.
And rename FreeFunctions struct to Methods.
…ulacrum

Add codegen test for removing trailing zeroes from `NonZero`

Closes rust-lang#138497
TryFrom<integer> for bool

I noticed the manual TryFrom implementation in [this video from RustConf 2025](https://youtu.be/cOP219vkax8?list=PL2b0df3jKKiRFEuVNk76ufXagOgEJ9sBZ&t=1917) and thought I'd add it.
std: avoid tearing `dbg!` prints

Fixes rust-lang#136703.

This is an alternative to rust-lang#149859. Instead of formatting everything into a string, this PR makes multi-expression `dbg!` expand into multiple nested matches, with the final match containing a single `eprint!`. By using macro recursion and relying on hygiene, this allows naming every bound value in that `eprint!`.

CC @orlp

r? libs
…, r=Mark-Simulacrum

add CSE optimization tests for iterating over slice

This PR is regression test for issue rust-lang#119573.
This PR introduces a new regression test to verify a critical optimization known as Common Subexpression Elimination (CSE) is correctly applied during various slice iteration patterns.
…gross35

Move std_detect tests into a separate crate

Same rationale as rust-lang#136642.
…r=Mark-Simulacrum

Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7

Fixes rust-lang#149935. See the added comment for more details.

This makes the concerned test now reproducibly pass, for us at least. Also, testing this separately revealed successful: see the issue.

@rustbot label C-bug I-flaky-test O-windows-7 T-libs A-time A-thread
…rochenkov,Kobzol

Various refactors to the proc_macro bridge

This reduces the amount of types, traits and other abstractions that are involved with the bridge, which should make it easier to understand and modify. This should also help a bit with getting rid of the type marking hack, which is complicating the code a fair bit.

Fixes: rust-lang#139810
Rename `DepKindStruct` to `DepKindVTable`

This type is used by dependency-tracking code in the query system, for looking up function pointers and other metadata associated with a particular `DepKind`.

Calling it “struct” is not particularly helpful, whereas calling it a “vtable” at least gives some basic intuition for what it is and how it is used.

Some associated identifiers have also drifted a bit over time, and this PR adjusts those as well.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Jan 24, 2026
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool 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-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Jan 24, 2026
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 24, 2026

📌 Commit cac874b 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 Jan 24, 2026
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
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/imports/ambiguous-5.rs ... ok
test [ui] tests/ui/imports/ambiguous-4.rs ... ok
test [ui] tests/ui/imports/ambiguous-7.rs ... ok
test [ui] tests/ui/imports/ambiguous-9.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-8.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-core-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-std-glob.rs ... ok
---
24    = note: in this macro invocation
-    = note: this error originates in the macro `impl_from` which comes from the expansion of the macro `into_int_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
+    = note: this error originates in the macro `impl_from_bool` which comes from the expansion of the macro `into_int_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
26 
27 error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
28   --> $DIR/bad-interconversion.rs:9:12


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args try-trait/bad-interconversion.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/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/try-trait/bad-interconversion.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/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-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/aarch64-unknown-linux-gnu/test/ui/try-trait/bad-interconversion" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0277]: `?` couldn't convert the error to `u8`
##[error]  --> /checkout/tests/ui/try-trait/bad-interconversion.rs:4:20
   |
LL | fn result_to_result() -> Result<u64, u8> {
   |                          --------------- expected `u8` because of this
LL |     Ok(Err(123_i32)?)
   |        ------------^ the trait `From<i32>` is not implemented for `u8`
   |        |
   |        this can't be annotated with `?` because it has type `Result<_, i32>`
   |
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
help: the following other types implement trait `From<T>`
  --> /rustc/FAKE_PREFIX/library/core/src/convert/num.rs:47:8
   |
   = note: `u8` implements `From<bool>`
  ::: /rustc/FAKE_PREFIX/library/core/src/convert/num.rs:68:0
---
   |
   = note: in this macro invocation
   = note: this error originates in the macro `impl_from_bool` which comes from the expansion of the macro `into_int_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
##[error]  --> /checkout/tests/ui/try-trait/bad-interconversion.rs:9:12
   |
LL | fn option_to_result() -> Result<u64, String> {
   | -------------------------------------------- this function returns a `Result`
LL |     Some(3)?;
   |            ^ use `.ok_or(...)?` to provide an error compatible with `Result<u64, String>`

error[E0277]: the `?` operator can only be used on `Result`s in a function that returns `Result`
##[error]  --> /checkout/tests/ui/try-trait/bad-interconversion.rs:15:31
   |
LL | fn control_flow_to_result() -> Result<u64, String> {
   | -------------------------------------------------- this function returns a `Result`
LL |     Ok(ControlFlow::Break(123)?)
   |                               ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Result<u64, String>`

error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
##[error]  --> /checkout/tests/ui/try-trait/bad-interconversion.rs:20:22
   |
LL | fn result_to_option() -> Option<u16> {
   | ------------------------------------ this function returns an `Option`
LL |     Some(Err("hello")?)
   |                      ^ use `.ok()?` if you want to discard the `Result<Infallible, &str>` error information

error[E0277]: the `?` operator can only be used on `Option`s in a function that returns `Option`
##[error]  --> /checkout/tests/ui/try-trait/bad-interconversion.rs:25:33
   |
LL | fn control_flow_to_option() -> Option<u64> {
   | ------------------------------------------ this function returns an `Option`
LL |     Some(ControlFlow::Break(123)?)
   |                                 ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Option<u64>`

error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow`
##[error]  --> /checkout/tests/ui/try-trait/bad-interconversion.rs:30:39
   |
LL | fn result_to_control_flow() -> ControlFlow<String> {
   | -------------------------------------------------- this function returns a `ControlFlow`
LL |     ControlFlow::Continue(Err("hello")?)
   |                                       ^ this `?` produces `Result<Infallible, &str>`, which is incompatible with `ControlFlow<String>`
   |
help: the trait `FromResidual<Result<Infallible, &str>>` is not implemented for `ControlFlow<String>`
      but trait `FromResidual<ControlFlow<String, Infallible>>` is implemented for it
  --> /rustc/FAKE_PREFIX/library/core/src/ops/control_flow.rs:127:0
   = help: for that trait implementation, expected `ControlFlow<String, Infallible>`, found `Result<Infallible, &str>`

error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow`
##[error]  --> /checkout/tests/ui/try-trait/bad-interconversion.rs:35:12
   |
LL | fn option_to_control_flow() -> ControlFlow<u64> {
   | ----------------------------------------------- this function returns a `ControlFlow`
LL |     Some(3)?;
   |            ^ this `?` produces `Option<Infallible>`, which is incompatible with `ControlFlow<u64>`
   |
help: the trait `FromResidual<Option<Infallible>>` is not implemented for `ControlFlow<u64>`
      but trait `FromResidual<ControlFlow<u64, Infallible>>` is implemented for it
  --> /rustc/FAKE_PREFIX/library/core/src/ops/control_flow.rs:127:0
   = help: for that trait implementation, expected `ControlFlow<u64, Infallible>`, found `Option<Infallible>`

error[E0277]: the `?` operator in a function that returns `ControlFlow<B, _>` can only be used on other `ControlFlow<B, _>`s (with the same Break type)
##[error]  --> /checkout/tests/ui/try-trait/bad-interconversion.rs:41:29
   |
LL | fn control_flow_to_control_flow() -> ControlFlow<i64> {
   | ----------------------------------------------------- this function returns a `ControlFlow`
LL |     ControlFlow::Break(4_u8)?;
   |                             ^ this `?` produces `ControlFlow<u8, Infallible>`, which is incompatible with `ControlFlow<i64>`
   |
   = note: unlike `Result`, there's no `From`-conversion performed for `ControlFlow`
help: the trait `FromResidual<ControlFlow<u8, _>>` is not implemented for `ControlFlow<i64>`
      but trait `FromResidual<ControlFlow<i64, _>>` is implemented for it
  --> /rustc/FAKE_PREFIX/library/core/src/ops/control_flow.rs:127:0
   = help: for that trait implementation, expected `i64`, found `u8`

error: aborting due to 8 previous errors

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

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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-rust-analyzer Relevant to the rust-analyzer 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