Commit Graph

321197 Commits

Author SHA1 Message Date
Jonathan Brouwer 888990ba13 Rollup merge of #153967 - estebank:infer_must_implement, r=petrochenkov
Tweak wording of failed predicate in inference error

Special case message talking about `Predicate` that couldn't be satisfied when in inference errors so that we don't say "cannot satisfy `_: Trait`" and instead say "type must implement `Trait`".
2026-03-17 17:51:30 +01:00
Jonathan Brouwer b2a26be751 Rollup merge of #153959 - mu001999-contrib:fix-153848, r=petrochenkov
Fix non-module `parent_module` in stripped cfg diagnostics

Fixes rust-lang/rust#153848

Old `parent_module` is from the `parent_node` in `append_stripped_cfg_item`, it cannot be assumed that it points to a real module. So call `expect_module` on it will cause ICE.

The first commit rename `parent_module` to `parent_scope`, and the second using `get_nearest_non_block_module` to find the nearest `module` of `parent_scope` in `find_cfg_stripped`, which should be the correct `parent_module`.
2026-03-17 17:51:29 +01:00
Jonathan Brouwer fe6816491f Rollup merge of #153801 - ywxt:parallel-test, r=petrochenkov
Add the option to run UI tests with the parallel frontend

This PR adds two arguments for tests:

1. `--parallel-frontend-threads`: specify `-Zthread` to compile test case (currently UI tests only)
2. `--iteration-count`: the number of times to run each test

Also, due to the non-deterministic diagnostic orders and cycle errors, this PR adds the directive `//@ ignore-parallel-frontend` to ignore tests with cycle error when the parallel-frontend is enabled (by `--parallel-frontend-threads`) and enables `//@ compare-output-by-lines` by default.

Context: [#t-compiler/parallel-rustc > Add the parallel front-end test suite @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Add.20the.20parallel.20front-end.20test.20suite/near/578781369)

This PR should work with https://github.com/rust-lang/rust/pull/153797 together.
2026-03-17 17:51:29 +01:00
Jonathan Brouwer 19f292aabe Rollup merge of #153972 - folkertdev:stdarch-sync-2026-03-16, r=folkertdev,RalfJung
stdarch subtree update

Subtree update of `stdarch` to https://github.com/rust-lang/stdarch/commit/aa3fc334dcb21b2bf5b5b31a52c19435072d7ced.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-03-17 17:51:28 +01:00
Folkert de Vries a72aceea2b correct vpdpbusd asserts in miri
in https://github.com/rust-lang/rust/commit/a24022ad4e98bfc5adc47cc114db57b68c8511d2 we changed the argument types to be more accurate, and now the miri asserts on the simd type/size need to reflect that
2026-03-17 13:14:16 +01:00
ywxt 6a0ce16654 Ignore tests for the parallel frontend 2026-03-17 17:39:59 +08:00
ywxt 1814df18ef Run ui tests on the parallel frontend 2026-03-17 16:22:11 +08:00
bors b711f95f86 Auto merge of #153984 - Zalathar:rollup-JpmwnrA, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#153966 (suggest valid features when target feature is invalid)
 - rust-lang/rust#153372 (Fix LegacyKeyValueFormat report from docker build: x86_64-gnu)
 - rust-lang/rust#153738 (Don't look for non-type-level assoc consts when checking trait object types)
 - rust-lang/rust#153907 (Remove redundant fields from `QueryStackFrame`)
 - rust-lang/rust#153921 (Suppress self-referential associated type constraint suggestion)
2026-03-17 07:31:52 +00:00
Stuart Cook 66c506d44a Rollup merge of #153921 - arferreira:fix-bogus-assoc-type-constraint-suggestion, r=estebank
Suppress self-referential associated type constraint suggestion

Fixes rust-lang/rust#112104

When comparing `Option<&I::Item>` against `Option<I::Item>`, the compiler decomposes the mismatch into `expected = &<I as Iterator>::Item` vs `found = <I as Iterator>::Item`. ARM 2 in `note_and_explain_type_err` matches because `found` is a projection, and would suggest `Item = &<I as Iterator>::Item` — constraining the associated type to something that contains itself.

ARM 1 (`expected_projection`) already guards against this with `found.contains(expected)`. ARM 2 was missing the symmetric check. This adds `expected.contains(found)` to the match guard.

Before:
```rust
help: consider constraining the associated type `<I as Iterator>::Item` to `&<I as Iterator>::Item`
  |
1 | fn foo<I: Iterator<Item = &<I as Iterator>::Item>>(iter: &mut I) {
  |                   +++++++++++++++++++++++++++++++
```

After: bogus suggestion is gone, and the existing `.as_ref()` suggestion from `hir_typeck` still fires correctly.

r? @estebank
2026-03-17 15:53:12 +11:00
Stuart Cook deb6627933 Rollup merge of #153907 - Zalathar:stack-frame, r=nnethercote
Remove redundant fields from `QueryStackFrame`

- Follow-up to https://github.com/rust-lang/rust/pull/153867#discussion_r2935993621
---

Now that QueryStackFrame holds a TaggedQueryKey, it turns out that all of its other fields are redundant and can be removed:

- An explicit dep-kind is redundant here. If we want to find the query name, or check for specific queries, we can inspect the `TaggedQueryKey` instead.
- Similarly, in cases where the key is some kind of `DepId`, we can extract it directly from the `TaggedQueryKey`.

r? nnethercote
2026-03-17 15:53:11 +11:00
Stuart Cook 1c3429f136 Rollup merge of #153738 - fmease:dyn-ace-gingerly-care, r=BoxyUwU
Don't look for non-type-level assoc consts when checking trait object types

On main, when looking for assoc items that weren't specified in a given trait object type (via binding), we comb through all (eligible) assoc consts whether type-level or not even though you're not allowed to bind non-type-level assoc consts.

That's usually fine because traits containing (eligible) non-type-level assoc consts are dyn incompatible, so the trait object type is ~already considered ill-formed. Therefore, in PR rust-lang/rust#150843, I saved myself the extra effort, esp. since back then it was more annoying to check if the const item was declared type-level.

<sub>(More concretely: In bodies, we check for all dyn compatibility violations when lowering the trait object type, so we will bail out early with an error; in contrast, item signatures / non-bodies get wfchecked (`WellFormed` obligation) after lowering which includes dyn compatiblity checking (`DynCompatible` obligation); however to reduce the amount of diags, during lowering if there are any unspecified assoc items, we'll check them for dyn compatibility and bail out early if any of them tests negative.)</sub>

Now, we obviously don't wfcheck the defsite of (eager) type aliases which breaks the assumption that such trait object types get rejected. This led to the regression found in rust-lang/rust#153731: The ill-formed trait object type doesn't get rejected (as is expected) but we now require the single (non-type-level) assoc const to be bound in the dyn-Trait which we didn't do before. The actual error talks about dyn incompatibility due to the aforementioned extra check that's usually there to contain the number of diags.

Fixes [after beta backport] rust-lang/rust#153731.
2026-03-17 15:53:11 +11:00
Stuart Cook fec951b823 Rollup merge of #153372 - homersimpsons:chore/fix-LegacyKeyValueFormat-x86_64-gnu, r=marcoieni
Fix LegacyKeyValueFormat report from docker build: x86_64-gnu

Part of rust-lang/rust#152305

r? @marcoieni
2026-03-17 15:53:10 +11:00
Stuart Cook f08ebf3635 Rollup merge of #153966 - folkertdev:suggest-target-feature-names, r=mati865
suggest valid features when target feature is invalid

I run into this quite frequently, where I remember some part of a feature name but not the exact name. Now this emits suggestions like

```
error: the feature named `+avx512` is not valid for this target
  --> $DIR/invalid-attribute.rs:127:18
   |
LL | #[target_feature(enable = "+avx512")]
   |                  ^^^^^^^^^^^^^^^^^^ `+avx512` is not valid for this target
   |
   = help: valid names are: `avx512f`, `avx2`, `avx512bw`, `avx512cd`, and `avx512dq` and 74 more
```
2026-03-17 15:53:09 +11:00
bors 6bdc342ddb Auto merge of #146013 - Jules-Bertholet:from-wrapper, r=Mark-Simulacrum
Add `From` impls for wrapper types





- ~`From<T: Copy> for ManuallyDrop<T>`~
- `From<T: UnwindSafe> for AssertUnwindSafe<T>`
- `From<T> for LazyCell<T, F>`
- `From<T> for LazyLock<T, F>`
- `From<T> for ThinBox<T>` (unstable)
- `From<T> for UniqueRc<T>` (unstable)
- `From<T> for UniqueArc<T>` (unstable)

@rustbot label T-libs-api needs-fcp

Also needs a crater run, as the insta-stable impls are technically breaking changes.
2026-03-17 04:14:51 +00:00
León Orell Valerian Liehr f8bce56b39 Don't look for non-type-level assoc consts when checking trait object types 2026-03-17 01:52:28 +01:00
Folkert de Vries 8155209828 enable the movrs target feature in core and std 2026-03-16 23:30:37 +01:00
Sayantan Chakraborty 3776c07842 Merge pull request #2050 from folkertdev/aarch64-rand
add ACLE random number generation intrinsics
2026-03-16 21:03:10 +00:00
Esteban Küber 9b1eb935bc Tweak wording of failed predicate in inference error
Special case message talking about `Predicate` that couldn't be satisfied when in inference errors so that we don't say "cannot satisfy `_: Trait`" and instead say "type must implement `Trait`".
2026-03-16 17:58:49 +00:00
Folkert de Vries cd4fd289cd suggest valid features when target feature is invalid 2026-03-16 17:44:16 +01:00
mu001999 757f224bce Use nearest non block module as the correct parent module 2026-03-16 22:22:25 +08:00
mu001999 2d419b597c Rename parent_module to parent_scope 2026-03-16 22:21:54 +08:00
bors 3645249d79 Auto merge of #153952 - JonathanBrouwer:rollup-WGd5m6M, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#153359 (Gate `ConstParamTy_` trait behind `const_param_ty_trait` feature)
 - rust-lang/rust#153505 (tests: accept new GEP source element type)
2026-03-16 13:55:06 +00:00
Jonathan Brouwer 902473b2db Rollup merge of #153505 - durin42:llvm-23-gep-source-element-type, r=nikic
tests: accept new GEP source element type

Easy follow up to llvm/llvm-project@6ecbc0c96e.

@rustbot label: +llvm-main
2026-03-16 13:11:01 +01:00
Jonathan Brouwer 42c5d9a455 Rollup merge of #153359 - zedddie:const-param-ty-trait-gating, r=BoxyUwU
Gate `ConstParamTy_` trait behind `const_param_ty_trait` feature

Initially even when user wasn't using unsized const params, the only way to implement/name `ConstParamTy_` was to use `#![feature(unsized_const_params]`, now its gated under `const_param_ty_trait` feature, implied by `unsized_const_params`.

I've also changed use of `unsized_const_params` in tests which were using it only to implement `ConstParamTy_` without using unsized

r? BoxyUwU
2026-03-16 13:11:00 +01:00
Zalathar d57577e03d Remove redundant fields from QueryStackFrame
An explicit dep-kind is redundant here. If we want to find the query name, or
check for specific queries, we can inspect the `TaggedQueryKey` instead.

Similarly, in cases where the key is some kind of `DefId`, we can extract it
directly from the `TaggedQueryKey`.
2026-03-16 22:04:46 +11:00
bors ec15ca96ff Auto merge of #153943 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/90c8906e6443e7cee18cece9c2621a8b1c10794c.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-03-16 10:36:21 +00:00
bors fe7294f879 Auto merge of #153944 - Zalathar:rollup-fBm3hLt, r=Zalathar
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#153940 (Rename all-query functions.)
 - rust-lang/rust#153942 (Re-export `rustc_middle::query::{QuerySystem, QueryVTable}`)
2026-03-16 07:23:49 +00:00
Stuart Cook b8cdd7a1c7 Rollup merge of #153942 - Zalathar:imports, r=nnethercote
Re-export `rustc_middle::query::{QuerySystem, QueryVTable}`

- Follow-up to https://github.com/rust-lang/rust/pull/153760#discussion_r2928848418.
---

All of the other public items in `rustc_middle::query::plumbing` are re-exported from `query`, except for these two, for no particular reason that I can see.

Re-exporting them allows `rustc_middle::query::plumbing` to have its visibility reduced to pub(crate).

Imports within `rustc_middle` have also been updated to consistently use the re-exports in `crate::query`.

r? nnethercote
2026-03-16 18:22:57 +11:00
Stuart Cook ebd6268b44 Rollup merge of #153940 - nnethercote:rename-all-query-fns, r=Zalathar
Rename all-query functions.

There are four functions that use `for_each_query_vtable!` to call an "inner" function. They are:

- `collect_active_jobs_from_all_queries` -> `gather_active_jobs`
- `alloc_self_profile_query_strings` -> `alloc_self_profile_query_strings_for_query_cache`
- `encode_all_query_results` -> `encode_query_results`
- `query_key_hash_verify_all` -> `query_key_hash_verify`

These names are all over the place. This commit renames them as follows:

- `collect_active_query_jobs{,_inner}`
- `alloc_self_profile_query_strings{,_inner}`
- `encode_query_values{,_inner}`
- `verify_query_key_hashes{,_inner}`

This:
- puts the verb at the start
- uses `_inner` for all the inners (which makes sense now that the inners are all next to their callers)
- uses `_query_` consistently
- avoids `all`, because the plurals are enough
- uses `values` instead of `results`
- removes the `collect`/`gather` distinction, which is no longer important

r? @Zalathar
2026-03-16 18:22:56 +11:00
Zalathar aa223a0220 Re-export rustc_middle::query::{QuerySystem, QueryVTable}
All of the other public items in `rustc_middle::query::plumbing` are
re-exported from `query`, except for these two, for no particular reason that I
can see.

Re-exporting them allows `rustc_middle::query::plumbing` to have its visibility
reduced to pub(crate).

Imports within `rustc_middle` have also been updated to consistently use the
re-exports in `crate::query`.
2026-03-16 18:20:35 +11:00
Nicholas Nethercote a8024fc1d7 Remove an out-of-date comment.
It should have been removed in #153650. (The comments on
`CollectActiveJobsKind` suffice now.)
2026-03-16 16:33:52 +11:00
Nicholas Nethercote b41b0c494c Rename all-query functions.
There are four functions that use `for_each_query_vtable!` to call an "inner"
function. They are:

- collect_active_jobs_from_all_queries -> gather_active_jobs
- alloc_self_profile_query_strings -> alloc_self_profile_query_strings_for_query_cache
- encode_all_query_results -> encode_query_results
- query_key_hash_verify_all -> query_key_hash_verify

These names are all over the place. This commit renames them as follows:

- collect_active_query_jobs{,_inner}
- alloc_self_profile_query_strings{,_inner}
- encode_query_values{,_inner}
- verify_query_key_hashes{,_inner}

This:
- puts the verb at the start
- uses "inner" for all the inners (which makes sense now that the inners are
  all next to their callers)
- uses `_query_` consistently
- avoids `all`, because the plurals are enough
- uses `values` instead of `results`
- removes the `collect`/`gather` distinction, which is no longer
  important
2026-03-16 16:33:40 +11:00
bors 5b61449ed8 Auto merge of #153937 - Zalathar:rollup-jVZ9rxY, r=Zalathar
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#153639 (Remove `QueryInfo`.)
 - rust-lang/rust#153570 (MaybeUninit: mention common mistakes in assume_init docs; link to validity invariant docs)
 - rust-lang/rust#153724 (Show named lifetime in closure upvar diagnostics)
 - rust-lang/rust#153793 (Add overview documentation for `std::mem`.)
 - rust-lang/rust#153922 (rustc_mir_build only depends on rustc_lint_defs, not rustc_lint)
 - rust-lang/rust#153923 (run_make_support: Print the command and output even if it succeeds)
 - rust-lang/rust#153925 (Provide better suggestions for inference errors on `.collect()?`)
 - rust-lang/rust#153928 (remove several redundant tests)
2026-03-16 04:02:46 +00:00
Stuart Cook ce55e36b0f Rollup merge of #153928 - cyrgani:test-test-tes, r=Kivooeo
remove several redundant tests

Remove the following tests:
* `binding/match-naked-record.rs`: duplicate of `binding/match-naked-record-expr.rs`
* `issues/issue-5192.rs`: duplicate of `box/unit/unique-object-move.rs`
* `macros/unreachable.rs`: duplicate of `macros/unreachable-macro-panic.rs`
* `issues/issue-4830.rs`: this used to test that a parsing error was emitted for obsolete `~` syntax, this was removed long ago
* `moves/array-copy-move.rs`: this used to test that calling methods on a vec with type error elements did not ICE. It no longer makes sense since it contains no method call and the integers do not cause type errors anymore.
2026-03-16 15:01:37 +11:00
Stuart Cook 7514258efd Rollup merge of #153925 - estebank:issue-129269, r=jieyouxu
Provide better suggestions for inference errors on `.collect()?`

When encountering an inference error when calling `.collect()` followed by `?`, detect the return type of the enclosing function and suggest `.collect::<Result<_, _>>()?` instead of `.collect::<Vec<_>>()?`:

```
error[E0283]: type annotations needed
  --> $DIR/question-mark-type-infer.rs:10:21
   |
LL |     l.iter().map(f).collect()?
   |                     ^^^^^^^ cannot infer type of the type parameter `B` declared on the method `collect`
   |
   = note: cannot satisfy `_: FromIterator<Result<i32, ()>>`
note: required by a bound in `collect`
  --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
help: consider specifying the generic argument
   |
LL |     l.iter().map(f).collect::<Result<_, _>>()?
   |                            ++++++++++++++++
```

On inference error in let binding, account for `?`:
```
error[E0282]: type annotations needed
  --> $DIR/question-mark-type-inference-in-chain.rs:31:9
   |
LL |     let mut tags = lines.iter().map(|e| parse(e)).collect()?;
   |         ^^^^^^^^
...
LL |     tags.sort();
   |     ---- type must be known at this point
   |
help: consider giving `tags` an explicit type
   |
LL |     let mut tags: Vec<_> = lines.iter().map(|e| parse(e)).collect()?;
   |                 ++++++++
```

Address rust-lang/rust#129269.
2026-03-16 15:01:36 +11:00
Stuart Cook 3a3454407f Rollup merge of #153923 - jyn514:jyn/run-make-debugging, r=jieyouxu
run_make_support: Print the command and output even if it succeeds

Previously, it was quite hard to get access to this output because it was printed to a buffer in memory and then discarded. This output is already hidden behind libtest's output capturing, we don't need to hide it twice.
2026-03-16 15:01:35 +11:00
Stuart Cook bbd1428a15 Rollup merge of #153922 - jyn514:jyn/crate-graph, r=jdonszelmann
rustc_mir_build only depends on rustc_lint_defs, not rustc_lint

This speeds up incremental compile times when modifying rustc_lint.
2026-03-16 15:01:35 +11:00
Stuart Cook eb101bb2f1 Rollup merge of #153793 - kpreid:std-mem-doc, r=scottmcm
Add overview documentation for `std::mem`.

I heard that `std::mem` sounds scary to some people, and how it’s described — “Basic functions for dealing with memory” — sounds even to me like something that should be avoided, not even because it would be unsafe, but because it is too low-level.

Let’s fix that by telling people about what they can actually find in the module, without having to read all the individual item descriptions.

The exact contents of the list are, of course, highly debatable, and I chose not to include any of the unstable or deprecated items, nor to include `Discriminant` as well as `discriminant`. I’m also not particularly happy with the wording of the introductory paragraph.
2026-03-16 15:01:34 +11:00
Stuart Cook 3e1052c6d5 Rollup merge of #153724 - arferreira:fix-lifetime-naming-in-closures, r=jieyouxu
Show named lifetime in closure upvar diagnostics

Fixes rust-lang/rust#153545.

When a closure captures a variable whose type involves a named lifetime from the parent function (e.g., `'a`), the borrow checker's region renumbering creates a separate `RegionVid` for each occurrence of the erased lifetime in the closure's upvar type. These new `RegionVid`s have no `external_name`, so diagnostics fall back to synthetic names like `'1`.

This PR recovers the original lifetime name by matching the closure's upvar type against the parent function's parameter type (obtained via `liberate_late_bound_regions`). Both types have the same structure but different region representations, the parent has `ReLateParam`/`ReEarlyParam` with real names, the closure has `ReVar` from renumbering. Walking them in parallel with `for_each_free_region` lets us find which named lifetime corresponds to the anonymous `RegionVid`.

Before:

```rust
error[E0716]: temporary value dropped while borrowed
 --> test.rs:11:21
  |
6 | fn apply<'a>(
  |          -- lifetime `'1` defined here
```

After:

```rust
error[E0716]: temporary value dropped while borrowed
 --> test.rs:11:21
  |
6 | fn apply<'a>(
  |          -- lifetime `'a` defined here
```

The fix gracefully falls back to the existing `'1` naming when it can't match, nested closures, local variables (not parameters), destructuring patterns, or partial captures where the type structures diverge.
2026-03-16 15:01:34 +11:00
Stuart Cook bd671824d5 Rollup merge of #153570 - RalfJung:assume-init-docs, r=tgross35
MaybeUninit: mention common mistakes in assume_init docs; link to validity invariant docs

Fixes https://github.com/rust-lang/rust/issues/150689
r? @tgross35
2026-03-16 15:01:33 +11:00
Stuart Cook 8c3017c477 Rollup merge of #153639 - nnethercote:rm-QueryInfo, r=petrochenkov
Remove `QueryInfo`.

`CycleError` has one field containing a `(Span, QueryStackFrame<I>)` and another field containing a `QueryInfo`, which is a struct containing just a `Span` and a `QueryStackFrame<I>`.

We already have the `Spanned` type for adding a span to something. This commit uses it for both fields in `CycleError`, removing the need for `QueryInfo`. Which is good for the following reasons.
- Any type with `Info` in the name is suspect, IMO.
- `QueryInfo` can no longer be confused with the similar `QueryJobInfo`.
- The doc comment on `QueryInfo` was wrong; it didn't contain a query key.

r? @Mark-Simulacrum
2026-03-16 15:01:33 +11:00
Nicholas Nethercote 1d43a421b5 Remove Clone impl from CycleError.
It's unused.
2026-03-16 08:54:21 +11:00
Nicholas Nethercote f3f4ab9205 Remove QueryInfo.
`CycleError` has one field containing a `(Span, QueryStackFrame<I>)` and
another field containing a `QueryInfo`, which is a struct containing
just a `Span` and a `QueryStackFrame<I>`.

We already have the `Spanned` type for adding a span to something. This
commit uses it for both fields in `CycleError`, removing the need for
`QueryInfo`. Which is good for the following reasons.
- Any type with `Info` in the name is suspect, IMO.
- `QueryInfo` can no longer be confused with the similar `QueryJobInfo`.
- The doc comment on `QueryInfo` was wrong; it didn't contain a query
  key.
2026-03-16 08:54:18 +11:00
cyrgani 6dcb85d55d remove several redundant tests 2026-03-15 20:39:11 +00:00
bors 1e2183119f Auto merge of #153166 - reddevilmidzy:codegen-tidy, r=lcnr
Tidy: disallow TODO in other in-tree projects

Fixes: https://github.com/rust-lang/rust/issues/152280
MCP: https://github.com/rust-lang/compiler-team/issues/963

TODO

* [x] Add ci check to `cg_clif`: https://github.com/rust-lang/rustc_codegen_cranelift/pull/1632
* [x] Add ci check to `cg_gcc`: https://github.com/rust-lang/rustc_codegen_gcc/pull/861

r? lcnr
2026-03-15 20:38:45 +00:00
Esteban Küber 774f232015 Provide better suggestions for inference errors on .collect()?
When encountering an inference error when calling `.collect()` followed by `?`, detect the return type of the enclosing function and suggest `.collect::<Result<_, _>>()?` instead of `.collect::<Vec<_>>()?`:

```
error[E0283]: type annotations needed
  --> $DIR/question-mark-type-infer.rs:10:21
   |
LL |     l.iter().map(f).collect()?
   |                     ^^^^^^^ cannot infer type of the type parameter `B` declared on the method `collect`
   |
   = note: cannot satisfy `_: FromIterator<Result<i32, ()>>`
note: required by a bound in `collect`
  --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
help: consider specifying the generic argument
   |
LL |     l.iter().map(f).collect::<Result<_, _>>()?
   |                            ++++++++++++++++
```

On inference error in let binding, account for `?`:
```
error[E0282]: type annotations needed
  --> $DIR/question-mark-type-inference-in-chain.rs:31:9
   |
LL |     let mut tags = lines.iter().map(|e| parse(e)).collect()?;
   |         ^^^^^^^^
...
LL |     tags.sort();
   |     ---- type must be known at this point
   |
help: consider giving `tags` an explicit type
   |
LL |     let mut tags: Vec<_> = lines.iter().map(|e| parse(e)).collect()?;
   |                 ++++++++
```
2026-03-15 17:39:06 +00:00
bors d27207d3d6 Auto merge of #153919 - matthiaskrgr:rollup-UnSAPBk, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#153870 (docs: remove stale reference to `check_let_chain`)
 - rust-lang/rust#153881 (Provide more context on type errors in const context)
 - rust-lang/rust#153887 (Turn label into structured suggestion for `.as_ref()` and `.as_mut()`)
 - rust-lang/rust#153897 (Use less `#[macro_use]` in the query system)
 - rust-lang/rust#153914 (add test for param-env shadowing)
 - rust-lang/rust#153917 (compiletest: show rustdoc logs when `--no-capture`)
2026-03-15 17:27:21 +00:00
Jynn Nelson 00dae097c4 Print the command and output even if it succeeds
Previously, it was quite hard to get access to this output because it
was printed to a buffer in memory and then discarded. This output is
already hidden behind libtest's output capturing, we don't need to hide
it twice.
2026-03-15 17:56:50 +01:00
arferreira 4ecc78d637 Suppress self-referential associated type constraint suggestion 2026-03-15 12:39:39 -04:00
Matthias Krüger 06dcfe909f Rollup merge of #153917 - jieyouxu:rustdoc-test-debug, r=clubby789
compiletest: show rustdoc logs when `--no-capture`

This should make rustdoc debug log output actually visible in `./x test tests/rustdoc-json/ --no-capture` invocations.

Reported in [#t-infra/bootstrap > Help with &#96;./x test --no-capture&#96; to get logs.](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Help.20with.20.60.2E.2Fx.20test.20--no-capture.60.20to.20get.20logs.2E/with/579547276).

### Example

<details>
<summary>Output</summary>

```bash
$ RUSTDOC_LOG=rustdoc::formats::cache=trace ./x test ./tests/rustdoc-json/span.rs --force-rerun --no-capture
[...]

running 1 tests
status: exit status: 0
command: cd "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span" && env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" "-L" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span/auxiliary" "-o" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span" "--deny" "warnings" "/home/joe/repos/rust/tests/rustdoc-json/span.rs" "-A" "internal_features" "--output-format" "json" "-Zunstable-options"
stdout: none
--- stderr -------------------------------
2:rustc DEBUG rustdoc::formats::cache cx.cache.crate_version=None
2:rustc DEBUG rustdoc::formats::cache folding mod (stripped: false) "Some("span")", id DefId(DefId(0:0 ~ span[c5a1]))
2:rustc DEBUG rustdoc::formats::cache folding mod (stripped: false) "Some("bar")", id DefId(DefId(0:3 ~ span[c5a1]::bar))
------------------------------------------

.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 177 filtered out; finished in 345.34ms

Build completed successfully in 0:00:02
```
</details>
2026-03-15 16:52:46 +01:00