Commit Graph

54334 Commits

Author SHA1 Message Date
Jonathan Brouwer bef489b0ce Rollup merge of #152943 - CoCo-Japan-pan:impl-restriction-parse, r=Urgau,jhpratt
Parse `impl` restrictions

This PR implements the parsing logic for `impl` restrictions (e.g., `pub impl(crate) trait Foo {}`) as proposed in [RFC 3323](https://rust-lang.github.io/rfcs/3323-restrictions.html).
As the first step of the RFC implementation, this PR focuses strictly on the parsing phase. The new syntax is guarded by the `#![feature(impl_restriction)]` feature gate.
This implementation basically follows the pattern used in rust-lang/rust#141754.

r? @jhpratt
2026-03-03 13:08:43 +01:00
bors 1b7d722f42 Auto merge of #153331 - JonathanBrouwer:rollup-hr9XbEa, r=JonathanBrouwer
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#152941 (prefer actual ABI-controling fields over target.abi when making ABI decisions)
 - rust-lang/rust#153227 (Don’t report missing fields in struct exprs with syntax errors.)
 - rust-lang/rust#153265 (Clarified doc comments + added tests confirming current behavior for intersperse/intersperse_with)
 - rust-lang/rust#152966 (Migrate 11 tests from tests/ui/issues to specific directories)
 - rust-lang/rust#153003 (rustdoc: make `--emit` and `--out-dir` mimic rustc)
 - rust-lang/rust#153034 (Remove unhelpful hint from trivial bound errors)
 - rust-lang/rust#153152 (Migration of LintDiagnostic - part 5)
 - rust-lang/rust#153177 (disable the ptr_fragment_in_final test on s390x)
 - rust-lang/rust#153221 (Add release notes for 1.94.0)
 - rust-lang/rust#153279 (feat: Provide an '.item_kind()' method on ItemEnum)
 - rust-lang/rust#153297 (Update the name of the Hermit operating system)
 - rust-lang/rust#153309 (Cleanup of c-variadic link test)
2026-03-03 07:00:49 +00:00
Jonathan Brouwer 4a56a45083 Rollup merge of #153152 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Migration of LintDiagnostic - part 5

Part of https://github.com/rust-lang/rust/issues/153099.

With this, `rust_lint` is finally done, although the change of API of `decorate_builtin_lint` impacted a few other crates, although minimal, still needed to be mentioned.

r? @JonathanBrouwer
2026-03-03 07:14:15 +01:00
Jonathan Brouwer 87bd517707 Rollup merge of #153034 - arferreira:fix-trivial-bound-diagnostic, r=Kivooeo
Remove unhelpful hint from trivial bound errors

The `= help: see issue #48214` hint on trivial bound errors isn't useful, most users hitting these errors aren't trying to use the `trivial_bounds` feature. The `disabled_nightly_features` call already handles suggesting the feature gate on nightly.

Closes rust-lang/rust#152872
2026-03-03 07:14:15 +01:00
Jonathan Brouwer 7174c100f4 Rollup merge of #153227 - kpreid:struct-missing-field, r=estebank
Don’t report missing fields in struct exprs with syntax errors.

@Noratrieb [told me](https://internals.rust-lang.org/t/custom-cargo-command-to-show-only-errors-avoid-setting-rustflags-every-time/24032/7?u=kpreid) that “it is a bug if this recovery causes follow-up errors that would not be there if the user fixed the first error.” So, here’s a contribution to hide a follow-up error that annoyed me recently.

Specifically, if the user writes a struct literal with a syntax error, such as

```rust
StructName { foo: 1 bar: 2 }
```

the compiler will no longer report that the field `bar` is missing in addition to the syntax error.

This is my first time attempting any change to the parser or AST; please let me know if there is a better way to do what I’ve done here. ~~The part I’m least happy with is the blast radius of adding another field to `hir::ExprKind::Struct`, but this seems to be in line with the style of the rest of the code. (If this were my own code, I would consider changing `hir::ExprKind::Struct` to a nested struct, the same way it is in `ast::ExprKind`.)~~ The additional information is now stored as an additional variant of `ast::StructRest` / `hir::StructTailExpr`.

**Note to reviewers:** I recommend reviewing each commit separately, and in the case of the first one with indentation changes ignored.
2026-03-03 07:14:12 +01:00
Jonathan Brouwer ca1b24406d Rollup merge of #152941 - RalfJung:abi-control, r=mati865
prefer actual ABI-controling fields over target.abi when making ABI decisions

We don't actually check that `abi` is consistent with the fields that control the ABI, e.g. one could set `llvm_abiname` to "ilp32e" on a riscv target without setting a matching `abi`. So, if we need to make actual decisions, better to use the source of truth we forward to LLVM than the informational string we forward to the user.

This is a breaking change for aarch64 JSON target specs: setting `abi` to "softfloat" is no longer enough; one has to also set `rustc_abi` to "softfloat". That is consistent with riscv and arm32, but it's still surprising. Cc @Darksonn in case this affects the Linux kernel.

Also see https://github.com/rust-lang/rust/pull/153035 which does something similar for PowerPC, and [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/De-spaghettifying.20ABI.20controls/with/575095372). Happy to delay this PR if someone has a better idea.

Cc @folkertdev @workingjubilee
2026-03-03 07:14:11 +01:00
bors d3877ec332 Auto merge of #151864 - aerooneqq:delegation-generics-propagation, r=petrochenkov
Implement AST -> HIR generics propagation in delegation



This PR adds support for generics propagation during AST -> HIR lowering and is a part of rust-lang/rust#118212.

# High-level design overview

## Motivation
The task is to generate generics for delegations (i.e. in this context we assume a function that is created for `reuse` statements) during AST -> HIR lowering. Then we want to propagate those generated params to generated method call (or default call) in delegation. This will help to solve issues like the following:

```rust
mod to_reuse {
    pub fn consts<const N: i32>() -> i32 {
        N
    }
}

reuse to_reuse::consts;
//~^ ERROR  type annotations needed

// DESUGARED CURRENT:
#[attr = Inline(Hint)]
fn consts() -> _ { to_reuse::consts() }

// DESUGARED DESIRED:
#[attr = Inline(Hint)]
fn consts<const N: i32>() -> _ { to_reuse::consts::<N>() }
```

Moreover, user can specify generic args in `reuse`, we need to propagate them (works now) and inherit signature with substituted generic args:

```rust
mod to_reuse {
    pub fn foo<T>(t: T) -> i32 {
        0
    }
}

reuse to_reuse::foo::<i32>;
//~^ ERROR  mismatched types

fn main() {
    foo(123);
}

error[E0308]: mismatched types
  --> src/main.rs:24:17
   |
19 |     pub fn foo<T>(t: T) -> i32 {
   |                - found this type parameter
...
24 | reuse to_reuse::foo::<i32>;
   |                 ^^^
   |                 |
   |                 expected `i32`, found type parameter `T`
   |                 arguments to this function are incorrect
   |
   = note:        expected type `i32`
           found type parameter `T`
```
In this case we want the delegation to have signature that have one `i32` parameter (not `T` parameter).
Considering all other cases, for now we want to preserve existing behavior, which was almost fully done (at this stage there are changes in behavior of delegations with placeholders and late-bound lifetimes).

## Main approach overview
The main approach is as follows:
- We determine generic params of delegee parent (now only trait can act as a parent as delegation to inherent impls is not yet supported) and delegee function,
- Based on presence of user-specified args in `reuse` statement (i.e. `reuse Trait::<'static, i32, 123>::foo::<String>`)  we either generate delegee generic params or not. If not, then we should include user-specified generic args into the signature of delegation,
- The general order of generic params generation is as following: 
   `[DELEGEE PARENT LIFETIMES, DELEGEE LIFETIMES, DELEGEE PARENT TYPES AND CONSTS, DELEGEE TYPES AND CONSTS]`,
- There are two possible generic params orderings (they differ only in a position of `Self` generic param):
  - When Self is after lifetimes, this happens only in free to trait delegation scenario, as we need to generate implicit Self param of the delegee trait,
  - When Self is in the beginning and we should not generate Self param, this is basically all other cases if there is an implicit Self generic param in delegation parent.
- Considering propagation, we do not propagate lifetimes for child, as at AST -> HIR lowering stage we can not know whether the lifetime is late-bound or early bound, so for now we do not propagate them at all. There is one more hack with child lifetimes, for the same reason we create predicates of kind `'a: 'a` in order to preserve all lifetimes in HIR, so for now we can generate more lifetimes params then needed. This will be partially fixed in one of next pull requests.

## Implementation details

- We obtain AST generics either from AST of a current crate if delegee is local or from external crate through `generics_of` of `tcx`. Next, as we want to generate new generic params we generate new node ids for them, remove default types and then invoke already existent routine for lowering AST generic params into HIR,
- If there are user-specified args in either parent or child parts of the path, we save HIR ids of those segments and pass them to `hir_analysis` part, where user-specified args are obtained, then lowered through existing API and then used during signature and predicates inheritance,
- If there are no user-specified args then we propagate generic args that correspond to generic params during generation of delegation,
- During signature inheritance we know whether parent or child generic args were specified by the user, if so, we should merge them with generic params (i.e. cases when parent args are specified and child args are not: `reuse Trait::<String>::foo`), next we use those generic args and mapping for delegee parent and child generic params into those args in order to fold delegee signature and delegee predicates.

## Tests

New tests were developed and can be found in `ast-hir-engine` folder, those tests cover all cases of delegation with different number of lifetimes, types, consts in generic params and different user-specified args cases (parent and child, parent/child only, none). 

## Edge cases
There are some edge cases worth mentioning. 

### Free to trait delegation. 
Consider this example:
```rust
trait Trait<'a, T, const N: usize> {
    fn foo<'x: 'x, A, B>(&self) {}
}

reuse Trait::foo;
```

As we are reusing from trait and delegee has `&self` param it means that delegation must have `Self` generic param:
```rust
fn foo<'a, 'x, Self, T, const N: usize, A, B>(self) {}
```

We inherit predicates from Self implicit generic param in `Trait`, thus we can pass to delegation anything that implements this trait. Now, consider the case when user explicitly specifies parent generic args.
```rust
reuse Trait::<'static, String, 1>::foo;
```

In this case we do not need to generate parent generic params, but we still need to generate `Self` in delegation (`DelegationGenerics::SelfAndUserSpecified` variant):
```rust
fn foo<'x, Self, A, B>(self) {}
```
User-specified generic arguments should be used to replace parent generic params in delegation, so if we had param of type `T` in `foo`, during signature inheritance we should replace it with user-specified `String` type.

### impl trait delegation
When we delegate from impl trait to something, we want the delegation to have signature that matches signature in trait. For this reason we already resolve delegation not to the actual delegee but to the trait method in order to inherit its signature. That is why when processing user-specified args when the caller kind is `impl trait` (`FnKind::AssocTraitImpl`), we discard parent user-specified args and replace them with those that are specified in trait header. In future we will also discard `child_args` but we need proper error handling for this case, so it will be addressed in one of future pull requests that are approximately specified in "Nearest future work" section.

## Nearest future work (approximate future pull requests):
- Late-bound lifetimes
- `impl Trait` params in functions
- Proper propagation of parent generics when generating method call
- ~Fix diagnostics duplication during lowering of user-specified types~
- Support for recursive delegations
- Self types support `reuse <u8 as Trait<_>>::foo as generic_arguments2`
- Decide what to do with infer args `reuse Trait::<_, _>::foo::<_>`
- Proper error handling when there is a mismatch between actual and expected args (impl trait case)

r? @petrochenkov
2026-03-03 02:39:40 +00:00
Jonathan Brouwer 8a824ee301 Fix performance of early lints 2026-03-02 23:47:01 +01:00
Guillaume Gomez 2be5835a7e Make DiagEmitter::emit take self by value 2026-03-02 23:46:04 +01:00
Guillaume Gomez 62cb683ff5 Remove duplicated code for delayed lints between rustc_hir_analysis and rustdoc 2026-03-02 23:46:04 +01:00
Guillaume Gomez 71e2ecd149 Simplify rustc_lint::EmitDiag by removing Lint from its API 2026-03-02 23:46:04 +01:00
Guillaume Gomez 22b4a8cb86 Update decorate_builtin_lint to use Diagnostic instead of LintDiagnostic 2026-03-02 23:46:04 +01:00
Guillaume Gomez c1037ce357 Migrate most rustc_lint lint to Diagnostic 2026-03-02 23:46:04 +01:00
Guillaume Gomez 6dc23a591e Remove LintContext::emit_span_lint_lazy 2026-03-02 23:46:04 +01:00
Guillaume Gomez 74674820aa Remove unused LintContext::emit_lint method 2026-03-02 23:46:04 +01:00
Jonathan Brouwer 2fe8b01461 Rollup merge of #153191 - WaffleLapkin:shouldnt_use_trivial_tuples, r=jdonszelmann
don't emit `unused_results` lint for tuples of "trivial" types

r? @jdonszelmann
Fixes rust-lang/rust#153144.

So it turns out rust-lang/rust#153018 had a sneaky behavior change in the way tuples are handled and the old behavior wasn't tested.

Consider these tuples:

```rust
((), ());
((), 1);
```

Neither of them is `must_use`, so they are potential candidates for `unused_results`. So the question is whatever said tuples are considered "trivial" and thus if they end up emitting `unused_results` or not.

Here is a comparison table between PRs:
<table>
<tr><td>stable</td><td>After #153018</td><td>After this PR</td></tr><tr><td>

```rust
((), ()); // trivial
((), 1); // trivial
```
</td>
<td>

```rust
((), ()); //~ warn: unused_results
((), 1); //~ warn: unused_results
```
</td>
<td>

```rust
((), ()); // trivial
((), 1); //~ warn: unused_results
```
</td>
</tr>
  <tr>
    <td>

tuples are trivial if **any** of their fields are trivial
    </td>
    <td>

tuples are never trivial
    </td>
    <td>

tuples are trivial if **all** of their fields are trivial
    </td>
  </tr>
</table>
2026-03-02 20:10:35 +01:00
Jonathan Brouwer 34fd06ef66 Rollup merge of #153161 - nnethercote:rejig-rustc_with_all_queries, r=Zalathar
Rejig `rustc_with_all_queries!`

There are three things relating to `rustc_with_all_queries!` that have been bugging me.

- `rustc_with_all_queries!`'s ability to receive `extra_fake_queries` lines like `[] fn Null(()) -> (),` where the only real thing is the `Null`, and everything is just pretending to be a normal query, ugh.
- `make_dep_kind_array!`: a macro produced by one macro (`define_dep_nodes!`) and used by another macro (`define_queries!`) in another crate, ugh.
- The `_dep_kind_vtable_ctors` module, which is a special module with no actual code that serves just a way of collecting vtable constructors from two different places so they can be referred to by `make_dep_kind_array!`, ugh.

By making some adjustments to how `rustc_with_all_queries!` works, all three of these things are eliminated.

r? @Zalathar
2026-03-02 20:10:35 +01:00
Jonathan Brouwer ef4cff2ea3 Rollup merge of #153015 - joboet:atomic_alias_generic, r=jhpratt
core: make atomic primitives type aliases of `Atomic<T>`

Tracking issue: https://github.com/rust-lang/rust/issues/130539

This makes `AtomicI32` and friends type aliases of `Atomic<T>` by encoding their alignment requirements via the use of an internal `Storage` associated type. This is also used to encode that `AtomicBool` store a `u8` internally.

Modulo the `Send`/`Sync` implementations, this PR does not move any trait implementations, methods or associated functions – I'll leave that for another PR.
2026-03-02 20:10:34 +01:00
Jonathan Brouwer 4a3d3cb486 Rollup merge of #151962 - TaKO8Ki:pointee-sized-next-solver-ice, r=lcnr
Fix next-solver ICE on PointeeSized goals

Fixes rust-lang/rust#151957
2026-03-02 20:10:33 +01:00
aerooneqq 0daab3ad6a Implement AST -> HIR generics propagation in delegation 2026-03-02 15:29:02 +03:00
Takayuki Maeda ca74063cea simplify test case and add revisions for both solvers
remove *
2026-03-02 17:55:10 +09:00
Takayuki Maeda 66786fc407 fix next-solver ICE on PointeeSized goals 2026-03-02 17:50:02 +09:00
Jonathan Brouwer 09b8f72ef0 Rollup merge of #153090 - mati865:elf-raw-dylib-fns, r=TaKO8Ki
elf-raw-dylib: set type for functions

Avoids GNU ld warnings like:
```
type and size of dynamic symbol `meooooooooooooooow' are not defined
```
First noticed in https://github.com/rust-lang/rust/pull/152451#issuecomment-3880667900 with changes from https://github.com/rust-lang/rust/pull/149937.
2026-03-02 09:49:23 +01:00
Jonathan Brouwer ad4b2c01a1 Rollup merge of #153046 - bjorn3:cg_ssa_cleanups, r=TaKO8Ki
Couple of cg_ssa refactorings

These should help a bit with using cg_ssa in cg_clif at some point in the future.
2026-03-02 09:49:22 +01:00
Jonathan Brouwer af84b2a02a Rollup merge of #153169 - nnethercote:rm-is_anon-etc, r=petrochenkov
Various small query cleanups

I found these while doing a close read of the query code.

r? @oli-obk
2026-03-02 09:49:21 +01:00
Nicholas Nethercote 40b2274f6c Change how query vtables are constructed.
Currently `define_dep_nodes` produces a macro `make_dep_kind_array` that
encodes the names of non-queries followed by queries. This macro is used
by `make_dep_kind_vtables` to make the full array of vtables, by
referring to vtable constructor functions that are put into `mod
_dep_kind_vtable_ctors`. Pretty weird!

This commit takes advantage of the previous commit's changes to
`rustc_with_all_queries`, which makes both query and non-query
information available. A new call to `rustc_with_all_queries` is used to
construct the vtable array. (This moves some dep_kind_vtable code from
`plumbing.rs` to `dep_kind_vtables.rs`, which is good.) It's
straightforward now with iterator chaining, and `mod
_dep_kind_vtable_ctors` is no longer needed.
2026-03-02 15:27:39 +11:00
Nicholas Nethercote 253c6965bc Make non-queries available to rustc_with_all_queries.
`rustc_with_all_queries` currently provides information about all
queries. Also, a caller can provide an ad hoc list of extra non-queries.
This is used by `define_queries` for non-query dep kinds: `Null`, `Red`,
etc. This is pretty hacky.

This commit changes `rustc_with_all_queries` so that the non-queries
information is available to all callers. (Some callers ignore the
non-query information.) This is done by adding `non_query` entries to
the primary list of queries in `rustc_queries!`.
2026-03-02 15:26:41 +11:00
Nicholas Nethercote 5bd28b85bd Remove FromCycleError impl for SymbolName.
It has no effect.

`symbol_name` is the only query that produces a `SymbolName`. If it was
marked with `cycle_delayed_bug`/`cycle_stash` then this `FromCycleError`
impl would make sense, but that's not the case. Maybe it was the case in
the past.
2026-03-02 14:26:58 +11:00
Nicholas Nethercote 5677f7c706 Rename trait Value as FromCycleError.
`Value` is an unhelpfully generic name. Standard naming procedure for a
trait with a single method is for the trait name to match the method
name, which is what this commit does. Likewise, the enclosing module is
renamed from `values` to `from_cycle_error`.

Also add a comment about some non-obvious behaviour.
2026-03-02 14:26:58 +11:00
Nicholas Nethercote 6f111d21a5 Remove a duplicated comment.
This exact comment block also appears in
`compiler/rustc_middle/src/queries.rs`, which is a better place for it.
2026-03-02 14:26:58 +11:00
Nicholas Nethercote 2aaced6344 Replace two abort_if_errors calls.
Calling `abort_if_errors` after emitting an error is guaranteed to call
`raise_fatal`, so just do that directly instead.
2026-03-02 14:26:58 +11:00
Nicholas Nethercote 8129da81e2 Remove three single-use type synonyms.
It's an unnecessary level of indirection.
2026-03-02 14:26:56 +11:00
Nicholas Nethercote fc395ed961 Merge two assertion blocks in execute_job_non_incr.
It reads better that way.
2026-03-02 14:23:55 +11:00
Nicholas Nethercote 7a4daa48b8 Avoid an early return in try_execute_query.
When there are two cases of equal size and importance, I find an if/else
expression easier to read than an early return.
2026-03-02 14:21:03 +11:00
Nicholas Nethercote c0770baed8 Make from_cycle_error consume the CycleError.
This makes it clear the `CycleError` is not used after the call.
2026-03-02 14:21:03 +11:00
Nicholas Nethercote cc1b878386 Inline and remove handle_cycle_error.
It has a single use.
2026-03-02 14:21:03 +11:00
Nicholas Nethercote 72a001bc25 Remove DepKindVTable::is_anon.
It's unused.
2026-03-02 14:21:00 +11:00
bors ddd36bd570 Auto merge of #153157 - madsmtm:fix-eq-derive-comptime-regression, r=JonathanBrouwer
Re-add `#[inline]` to `Eq::assert_fields_are_eq`

Fixes a compile-time regression in https://github.com/rust-lang/rust/pull/149978: non-inline methods are generally codegen'd while inline methods are deferred (and this function should never be called, so deferring is the right choice).

r? JonathanBrouwer
CC @cyrgani
2026-03-02 02:41:00 +00:00
joboet 95e571ded1 update references to Atomic in diagnostics
... and remove some unused diagnostic items.
2026-03-02 00:23:23 +01:00
joboet 4b86b1a11a compiler: manually implement DynSend for atomic primitives
The manual `DynSend` implementation for `AtomicPtr` blocks the
auto-implementation for other atomic primitives since they forward to the same
`Atomic<T>` type now. This breakage cannot occur in user code as it depends on
`DynSend` being a custom auto-trait.
2026-03-02 00:23:23 +01:00
bors e7d90c695a Auto merge of #153131 - Kobzol:filesearch-opt, r=nnethercote
Optimize dependency file search

I tried to look into the slowdown reported in https://github.com/rust-lang/cargo/issues/16665.

I created a Rust hello world program, and used this Python script to create a directory containing 200k files:
```python
from pathlib import Path

dir = Path("deps")
dir.mkdir(parents=True, exist_ok=True)
for i in range(200000):
    path = dir / f"file{i:07}.o"
    with open(path, "w") as f:
        f.write("\n")
```

Then I tried to do various small microoptimalizations and simplifications to the code that iterates the search directories. Each individual commit improved performance, with the third one having the biggest effect.

Here are the results on `main` vs the last commit with the stage1 compiler on Linux, using `hyperfine "rustc +stage1 src/main.rs -L deps" -r 30` (there's IO involved, so it's good to let it run for a while):

```bash
Benchmark 1: rustc +stage1 src/main.rs -L deps
  Time (mean ± σ):     299.4 ms ±   2.7 ms    [User: 161.9 ms, System: 144.9 ms]
  Range (min … max):   294.8 ms … 307.1 ms    30 runs

Benchmark 1: rustc +stage1 src/main.rs -L deps
  Time (mean ± σ):     208.1 ms ±   4.5 ms    [User: 87.3 ms, System: 128.7 ms]
  Range (min … max):   202.4 ms … 219.6 ms    30 runs
```

Would be cool if someone could try this on macOS (maybe @ehuss - not sure if you have macOS or you only commented about its behavior on the Cargo issue :) ).

I also tried to prefilter the paths (not in this PR); right now we load everything and then we filter files with given prefixes, that's wasteful. Filtering just files starting with `lib` would get us down to ~150ms here. (The baseline without `-L` is ~80ms on my PC). The rest of the 70ms is essentially allocations from iterating the directory entries and sorting. That would be very hard to change - iterating the directory entries (de)allocates a lot of intermediate paths :( We'd have to implement the iteration by hand with either arena allocation, or at least some better management of memory.

r? @nnethercote
2026-03-01 23:00:45 +00:00
bors 80381278a0 Auto merge of #153260 - JonathanBrouwer:rollup-J54yMmy, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#153130 (std: move `getpid` to `sys::process`)
 - rust-lang/rust#152549 (Revert "resolve: Downgrade `ambiguous_glob_imports` to warn-by-default")
 - rust-lang/rust#153231 (diags: Pass `DiagArgMap` instead of `FluentArgs` into `format_diag_message`)
 - rust-lang/rust#153246 (Fix compile error in std::fs impl on VEXos target)
 - rust-lang/rust#153255 (Recover feature lang_items for emscripten)
 - rust-lang/rust#153257 (update my mailmap)
2026-03-01 19:45:00 +00:00
Jonathan Brouwer db167a8094 Rollup merge of #153231 - JonathanBrouwer:move_diag_arg_map, r=Kivooeo
diags: Pass `DiagArgMap` instead of `FluentArgs` into `format_diag_message`

This PR no longer exposes `FluentArgs` outside of `translation.rs`, instead using the already existing `DiagArgMap`.
This is in preparation of a few upcoming PRs, as well as just making the code slightly nicer.

Will do a perf run because this technically calls `to_fluent_args` a few more times than previously, but not expecting this to be significant
2026-03-01 17:43:42 +01:00
Jonathan Brouwer ca6dc4c7be Rollup merge of #152549 - petrochenkov:diesel3, r=fmease
Revert "resolve: Downgrade `ambiguous_glob_imports` to warn-by-default"

This reverts commit cd05071ec4.

Revert of https://github.com/rust-lang/rust/pull/151130.
This will need to be merged after ~February 27 2026, when Rust 1.95 branches out from the main branch.
2026-03-01 17:43:41 +01:00
bors 28b5c1cc08 Auto merge of #153122 - Zalathar:dep-kind-vtable, r=nnethercote
Improve the forcing/promotion functions in `DepKindVTable`

This is a bundle of changes to the two function pointers in `DepKindVTable` that are responsible for forcing dep nodes, or promoting disk-cached values from the previous session into memory.

The perf improvements to incr-unchanged and incr-patched are likely from skipping more of the “promotion” plumbing for queries that never cache to disk.
2026-03-01 16:28:20 +00:00
Jonathan Brouwer 01dbf41bc0 Add doc comment to DiagArgMap 2026-03-01 10:47:29 +01:00
Jonathan Brouwer 51f35d76a2 Pass DiagArgMap instead of FluentArgs into format_diag_message 2026-03-01 10:07:39 +01:00
Jonathan Brouwer 5ade46246e Move DiagArgMap to rustc_error_messages 2026-03-01 10:07:36 +01:00
Zalathar 08df254a60 Don't try to promote queries that never cache to disk 2026-03-01 19:42:19 +11:00
Zalathar f7ac4266f5 Explain why some queries don't support forcing/promotion 2026-03-01 19:42:19 +11:00