Commit Graph

33385 Commits

Author SHA1 Message Date
r0cky
d88c7ffc62 Remove unused fluent messages 2024-03-03 00:57:45 +08:00
Matthias Krüger
ff22925e50
Rollup merge of #121853 - lcnr:normalizes_to-polarity, r=compiler-errors
normalizes-to: handle negative impls

necessary to build the stage 2 compiler in #121848 😁

r? `@compiler-errors`
2024-03-01 17:51:33 +01:00
Matthias Krüger
96e3777a9f
Rollup merge of #121831 - gurry:fix-typo, r=oli-obk
Fix typo in comment

"pop" should have been "prop"
2024-03-01 17:51:32 +01:00
Matthias Krüger
01b58bddd4
Rollup merge of #121828 - mu001999:clean, r=Nilstrieb
Remove unused fluent messages

Unused fluent messages after #121779
2024-03-01 17:51:32 +01:00
Matthias Krüger
47a491d9f0
Rollup merge of #121819 - nnethercote:fix-121812, r=oli-obk
Handle stashing of delayed bugs

By just emitting them immediately, because it does happen in practice, when errors are downgraded to delayed bugs.

We already had one case in `lint.rs` where we handled this at the callsite. This commit changes things so it's handled within `stash_diagnostic` instead, because #121812 identified a second case, and it's possible there are more.

Fixes #121812.

r? ````@oli-obk````
2024-03-01 17:51:31 +01:00
Matthias Krüger
b5ef517ed5
Rollup merge of #121818 - rcvalle:rust-cfi-remove-unused-typeid-for-fnsig, r=workingjubilee
CFI: Remove unused `typeid_for_fnsig`

Removes unused `typeid_for_fnsig` for simplifying the compiler CFI API.
2024-03-01 17:51:31 +01:00
Matthias Krüger
1a4c93e3ed
Rollup merge of #121784 - Zalathar:if-or-converge, r=Nadrieril
Make the success arms of `if lhs || rhs` meet up in a separate block

Extracted from #118305, where this is necessary to avoid introducing a bug when injecting marker statements into the then/else arms.

---

In the previous code (#111752), the success block of `lhs` would jump directly to the success block of `rhs`. However, `rhs_success_block` could already contain statements that are specific to the RHS, and the direct goto causes them to be executed in the LHS success path as well.

This patch therefore creates a fresh block that the LHS and RHS success blocks can both jump to.

---

I think the reason we currently get away with this is that `rhs_success_block` usually doesn't contain anything other than StorageDead statements for locals used by the RHS, and those statements don't seem to cause problems in the LHS success path (which never makes those locals live).

But if we start adding meaningful statements for branch coverage (or MC/DC coverage), it's important to keep the LHS and RHS blocks separate.
2024-03-01 17:51:30 +01:00
Matthias Krüger
58825b4ea9
Rollup merge of #121580 - Suyashtnt:issue-121502-fix, r=michaelwoerister
make unused_imports less assertive in test modules

closes #121502

This is a fairly small change and I used the fix suggested in the example expected error message.
Not sure if I should've rather used the alternatives but this one seems the most descriptive.

Some alternatives:
- if this is meant to be a test module, add `#[cfg(test)]` to the containing module
- try adding #[cfg(test)] to this test module
- consider adding #[allow(unused_imports)] if you want to silent the lint on the unused import
- consider removing the unused import
2024-03-01 17:51:29 +01:00
Matthias Krüger
f23c6ddada
Rollup merge of #121416 - veera-sivarajan:bugfix-120785, r=nnethercote
Improve error messages for generics with default parameters

Fixes #120785

Issue: Previously, all type parameters with default types were deliberately ignored to simplify error messages. For example, an error message for Box type would display `Box<T>` instead of `Box<T, _>`. But, this resulted in unclear error message when a concrete type was used instead of the default type.

Fix: This PR fixes it by checking if a concrete type is specified after a default type to display the entire type name or the simplified type name.
2024-03-01 17:51:28 +01:00
Matthias Krüger
80549a8811
Rollup merge of #120646 - clubby789:uninit-destructuring-sugg, r=michaelwoerister
Fix incorrect suggestion for uninitialized binding in pattern

Fixes #120634
2024-03-01 17:51:28 +01:00
lcnr
0700ec078f normalizes-to: handle negative impls 2024-03-01 15:12:20 +01:00
bors
b0696a5160 Auto merge of #121462 - compiler-errors:eq-and-sub, r=lcnr
Combine `Sub` and `Equate`

Combine `Sub` and `Equate` into a new relation called `TypeRelating` (that name sounds familiar...)

Tracks the difference between `Sub` and `Equate` via `ambient_variance: ty::Variance` much like the `NllTypeRelating` relation, but implemented slightly jankier because it's a more general purpose relation.

r? lcnr
2024-03-01 10:30:42 +00:00
bors
6cbf0926d5 Auto merge of #121728 - tgross35:f16-f128-step1-ty-updates, r=compiler-errors
Add stubs in IR and ABI for `f16` and `f128`

This is the very first step toward the changes in https://github.com/rust-lang/rust/pull/114607 and the [`f16` and `f128` RFC](https://rust-lang.github.io/rfcs/3453-f16-and-f128.html). It adds the types to `rustc_type_ir::FloatTy` and `rustc_abi::Primitive`, and just propagates those out as `unimplemented!` stubs where necessary.

These types do not parse yet so there is no feature gate, and it should be okay to use `unimplemented!`.

The next steps will probably be AST support with parsing and the feature gate.

r? `@compiler-errors`
cc `@Nilstrieb` suggested breaking the PR up in https://github.com/rust-lang/rust/pull/120645#issuecomment-1925900572
2024-03-01 03:36:11 +00:00
Gurinder Singh
beac5b12aa Fix typo in comment 2024-03-01 08:14:42 +05:30
r0cky
2064c19886 Remove unused fluent messages 2024-03-01 09:59:44 +08:00
Michael Goulet
5072b659ff Rebase fallout from TypeRelating::binders, inline higher_ranked_sub 2024-03-01 01:20:50 +00:00
Michael Goulet
b1536568db Fallout from removing a_is_expected 2024-03-01 01:20:50 +00:00
Michael Goulet
04e22627f5 Remove a_is_expected from combine relations 2024-03-01 01:20:50 +00:00
Michael Goulet
61daee66a8 Get rid of some sub_exp and eq_exp 2024-03-01 01:20:49 +00:00
Michael Goulet
801dd1d061 Remove cause 2024-03-01 01:20:49 +00:00
Michael Goulet
c87b727a23 Combine sub and eq 2024-03-01 01:20:49 +00:00
Michael Goulet
3cb36317cd Preserve variance on error in generalizer 2024-03-01 01:20:49 +00:00
Nicholas Nethercote
44f0043e82 Handle stashing of delayed bugs.
By just emitting them immediately, because it does happen in practice,
when errors are downgraded to delayed bugs.

We already had one case in `lint.rs` where we handled this at the
callsite. This commit changes things so it's handled within
`stash_diagnostic` instead, because #121812 identified a second case,
and it's possible there are more.

Fixes #121812.
2024-03-01 10:18:54 +11:00
Ramon de C Valle
7e64163951 CFI: Remove unused typeid_for_fnsig
Removes unused `typeid_for_fnsig` for simplifying the compiler CFI API.
2024-02-29 14:58:21 -08:00
Nicholas Nethercote
721c741756 Remove unnecessary Level:: qualifiers.
We have `use Level::*;` in this file.
2024-03-01 09:54:27 +11:00
bors
77be7a3e0d Auto merge of #121810 - matthiaskrgr:rollup-mawij2g, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #121326 (Detect empty leading where clauses on type aliases)
 - #121464 (rustc: Fix wasm64 metadata object files)
 - #121681 (Safe Transmute: Revise safety analysis)
 - #121753 (Add proper cfg to keep only one AlignmentEnum definition for different target_pointer_widths)
 - #121782 (allow statics pointing to mutable statics)
 - #121798 (Fix links in rustc doc)
 - #121806 (add const test for ptr::metadata)
 - #121809 (Remove doc aliases to PATH)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-29 21:47:54 +00:00
Matthias Krüger
255fdcc858
Rollup merge of #121782 - RalfJung:mutable-ref-in-static, r=oli-obk
allow statics pointing to mutable statics

Fixes https://github.com/rust-lang/rust/issues/120450 for good. We can even simplify our checks: no need to specifically go looking for mutable references in const, we can just reject any reference that points to something mutable.

r? `@oli-obk`
2024-02-29 20:50:04 +01:00
Matthias Krüger
419f7aeed6
Rollup merge of #121681 - jswrenn:nix-visibility-analysis, r=compiler-errors
Safe Transmute: Revise safety analysis

This PR migrates `BikeshedIntrinsicFrom` to a simplified safety analysis (described [here](https://github.com/rust-lang/project-safe-transmute/issues/15)) that does not rely on analyzing the visibility of types and fields.

The revised analysis treats primitive types as safe, and user-defined types as potentially carrying safety invariants. If Rust gains explicit (un)safe fields, this PR is structured so that it will be fairly easy to thread support for those annotations into the analysis.

Notably, this PR removes the `Context` type parameter from `BikeshedIntrinsicFrom`. Most of the files changed by this PR are just UI tests tweaked to accommodate the removed parameter.

r? `@compiler-errors`
2024-02-29 20:50:03 +01:00
Matthias Krüger
509972089b
Rollup merge of #121464 - alexcrichton:fix-wasm64, r=wesleywiser
rustc: Fix wasm64 metadata object files

It looks like LLD will detect object files being either 32 or 64-bit depending on any memory present. LLD will additionally reject 32-bit objects during a 64-bit link. Previously metadata objects did not have any memories in them which led LLD to conclude they were 32-bit objects which broke 64-bit targets for wasm.

This commit fixes this by ensuring that for 64-bit targets there's a memory object present to get LLD to detect it's a 64-bit target. Additionally this commit moves away from a hand-crafted wasm encoder to the `wasm-encoder` crate on crates.io as the complexity grows for the generated object file.

Closes #121460
2024-02-29 20:50:03 +01:00
Matthias Krüger
dd4ecd1cf4
Rollup merge of #121326 - fmease:detect-empty-leading-where-clauses-on-ty-aliases, r=compiler-errors
Detect empty leading where clauses on type aliases

1. commit: refactor the AST of type alias where clauses
   * I could no longer bear the look of `.0.1` and `.1.0`
   * Arguably moving `split` out of `TyAlias` into a substruct might not make that much sense from a semantic standpoint since it reprs an index into `TyAlias.predicates` but it's alright and it cleans up the usage sites of `TyAlias`
2. commit: fix an oversight: An empty leading where clause is still a leading where clause
   * semantically reject empty leading where clauses on lazy type aliases
     * e.g., on `#![feature(lazy_type_alias)] type X where = ();`
   * make empty leading where clauses on assoc types trigger lint `deprecated_where_clause_location`
     * e.g., `impl Trait for () { type X where = (); }`
2024-02-29 20:50:02 +01:00
bors
878c8a2a62 Auto merge of #118247 - spastorino:type-equality-subtyping, r=lcnr
change equate for binders to not rely on subtyping

*summary by `@spastorino` and `@lcnr*`

### Context

The following code:

```rust
type One = for<'a> fn(&'a (), &'a ());
type Two = for<'a, 'b> fn(&'a (), &'b ());

mod my_api {
    use std::any::Any;
    use std::marker::PhantomData;

    pub struct Foo<T: 'static> {
        a: &'static dyn Any,
        _p: PhantomData<*mut T>, // invariant, the type of the `dyn Any`
    }

    impl<T: 'static> Foo<T> {
        pub fn deref(&self) -> &'static T {
            match self.a.downcast_ref::<T>() {
                None => unsafe { std::hint::unreachable_unchecked() },
                Some(a) => a,
            }
        }

        pub fn new(a: T) -> Foo<T> {
           Foo::<T> {
                a: Box::leak(Box::new(a)),
                _p: PhantomData,
            }
        }
    }
}

use my_api::*;

fn main() {
    let foo = Foo::<One>::new((|_, _| ()) as One);
    foo.deref();
    let foo: Foo<Two> = foo;
    foo.deref();
}
```

has UB from hitting the `unreachable_unchecked`. This happens because `TypeId::of::<One>()` is not the same as `TypeId::of::<Two>()` despite them being considered the same types by the type checker.

Currently the type checker considers binders to be equal if subtyping succeeds in both directions: `for<'a> T<'a> eq for<'b> U<'b>` holds if `for<'a> exists<'b> T<'b> <: T'<a> AND for<'b> exists<'a> T<'a> <: T<'b>` holds. This results in `for<'a> fn(&'a (), &'a ())` and `for<'a, 'b> fn(&'a (), &'b ())` being equal in the type system.

`TypeId` is computed by looking at the *structure* of a type. Even though these types are semantically equal, they have a different *structure* resulting in them having different `TypeId`. This can break invariants of unsafe code at runtime and is unsound when happening at compile time, e.g. when using const generics.

So as seen in `main`, we can assign a value of type `Foo::<One>` to a binding of type `Foo<Two>` given those are considered the same type but then when we call `deref`, it calls `downcast_ref` that relies on `TypeId` and we would hit the `None` arm as these have different `TypeId`s.

As stated in https://github.com/rust-lang/rust/issues/97156#issuecomment-1879030033, this causes the API of existing crates to be unsound.

## What should we do about this

The same type resulting in different `TypeId`s  is a significant footgun, breaking a very reasonable assumptions by authors of unsafe code. It will also be unsound by itself once they are usable in generic contexts with const generics.

There are two options going forward here:
- change how the *structure* of a type is computed before relying on it. i.e. continue considering `for<'a> fn(&'a (), &'a ())` and `for<'a, 'b> fn(&'a (), &'b ())` to be equal, but normalize them to a common representation so that their `TypeId` are also the same.
- change how the semantic equality of binders to match the way we compute the structure of types. i.e. `for<'a> fn(&'a (), &'a ())` and `for<'a, 'b> fn(&'a (), &'b ())` still have different `TypeId`s but are now also considered to not be semantically equal.

---

Advantages of the first approach:
- with the second approach some higher ranked types stop being equal, even though they are subtypes of each other

General thoughts:
- changing the approach in the future will be breaking
    - going from first to second may break ordinary type checking, as types which were previously equal are now distinct
    - going from second to first may break coherence, because previously disjoint impls overlap as the used types are now equal
    - both of these are quite unlikely. This PR did not result in any crater failures, so this should not matter too much

Advantages of the second approach:
- the soundness of the first approach requires more non-local reasoning. We have to make sure that changes to subtyping do not cause the representative computation to diverge from semantic equality
    - e.g. we intend to consider higher ranked implied bounds when subtyping to [fix] https://github.com/rust-lang/rust/issues/25860, I don't know how this will interact and don't feel confident making any prediction here.
- computing a representative type is non-trivial and soundness critical, therefore adding complexity to the "core type system"

---

This PR goes with the second approach. A crater run did not result in any regressions. I am personally very hesitant about trying the first approach due to the above reasons. It feels like there are more unknowns when going that route.

### Changing the way we equate binders

Relating bound variables from different depths already results in a universe error in equate. We therefore only need to make sure that there is 1-to-1 correspondence between bound variables when relating binders. This results in concrete types being structurally equal after anonymizing their bound variables.

We implement this by instantiating one of the binder with placeholders and the other with inference variables and then equating the instantiated types. We do so in both directions.

More formally, we change the typing rules as follows:

```
for<'r0, .., 'rn> exists<'l0, .., 'ln> LHS<'l0, .., 'ln> <: RHS<'r0, .., 'rn>
for<'l0, .., 'ln> exists<'r0, .., 'rn> RHS<'r0, .., 'rn> <: LHS<'l0, .., 'ln>
--------------------------------------------------------------------------
for<'l0, .., 'ln> LHS<'l0, .., 'ln> eq for<'r0, .., 'rn> RHS<'r0, .., 'rn>
```

to
```
for<'r0, .., 'rn> exists<'l0, .., 'ln> LHS<'l0, .., 'ln> eq RHS<'r0, .., 'rn>
for<'l0, .., 'ln> exists<'r0, .., 'rn> RHS<'r0, .., 'rn> eq LHS<'l0, .., 'ln>
--------------------------------------------------------------------------
for<'l0, .., 'ln> LHS<'l0, .., 'ln> eq for<'r0, .., 'rn> RHS<'r0, .., 'rn>
```

---

Fixes #97156

r? `@lcnr`
2024-02-29 19:18:41 +00:00
Santiago Pastorino
4a2e3bc2b0
Change condition in binders to one that is more readable 2024-02-29 15:27:59 -03:00
Santiago Pastorino
0479287a38
Make nll higher ranked equate use bidirectional subtyping in invariant context 2024-02-29 15:27:59 -03:00
Santiago Pastorino
23ae3dbb31
Make infer higher ranked equate use bidirectional subtyping in invariant context 2024-02-29 15:27:56 -03:00
León Orell Valerian Liehr
cce81289e6
Detect empty leading where-clauses on type aliases 2024-02-29 17:20:04 +01:00
León Orell Valerian Liehr
2b8060578a
AST: Refactor type alias where clauses 2024-02-29 17:18:40 +01:00
Guillaume Gomez
0e9f02d6fa
Rollup merge of #121783 - nnethercote:emitter-cleanups, r=oli-obk
Emitter cleanups

Some cleanups I made when reading emitter code. In particular, `HumanEmitter` and `JsonEmitter` have gone from three constructors to one.

r? `@oli-obk`
2024-02-29 17:08:38 +01:00
Guillaume Gomez
a5945b5d8d
Rollup merge of #121669 - nnethercote:count-stashed-errs-again, r=estebank
Count stashed errors again

Stashed diagnostics are such a pain. Their "might be emitted, might not" semantics messes with lots of things.

#120828 and #121206 made some big changes to how they work, improving some things, but still leaving some problems, as seen by the issues caused by #121206. This PR aims to fix all of them by restricting them in a way that eliminates the "might be emitted, might not" semantics while still allowing 98% of their benefit. Details in the individual commit logs.

r? `@oli-obk`
2024-02-29 17:08:38 +01:00
Guillaume Gomez
2e0a26a32a
Rollup merge of #121376 - Nadrieril:mir-half-ranges, r=pnkfelix
Skip unnecessary comparison with half-open range patterns

This is the last remaining detail in the implementation of half-open range patterns. Until now, a half-open range pattern like `10..` was converted to `10..T::MAX` before lowering to MIR, which generated an extra pointless comparison. With this PR we don't generate it.
2024-02-29 17:08:37 +01:00
Guillaume Gomez
9df7f26b1b
Rollup merge of #121000 - Nadrieril:keep_all_fields, r=compiler-errors
pattern_analysis: rework how we hide empty private fields

Consider this:
```rust
mod foo {
  pub struct Bar {
    pub a: bool,
    b: !,
  }
}

fn match_a_bar(bar: foo::Bar) -> bool {
  match bar {
    Bar { a, .. } => a,
  }
}
```

Because the field `b` is private, matches outside the module are not allowed to observe the fact that `Bar` is empty. In particular `match bar {}` is valid within the module `foo` but an error outside (assuming `exhaustive_patterns`).

We currently handle this by hiding the field `b` when it's both private and empty. This means that the pattern `Bar { a, .. }` is lowered to `Bar(a, _)` if we're inside of `foo` and to `Bar(a)` outside. This involves a bit of a dance to keep field indices straight. But most importantly this makes pattern lowering depend on the module.

In this PR, I instead do nothing special when lowering. Only during analysis do we track whether a place must be skipped.

r? `@compiler-errors`
2024-02-29 17:08:37 +01:00
Guillaume Gomez
36bd9ef5a8
Rollup merge of #120820 - CKingX:cpu-base-minimum, r=petrochenkov,ChrisDenton
Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics (in nightly) in Windows x64

As Rust plans to set Windows 10 as the minimum supported OS for target x86_64-pc-windows-msvc, I have added the cmpxchg16b and sse3 feature. Windows 10 requires CMPXCHG16B, LAHF/SAHF, and PrefetchW as stated in the requirements [here](https://download.microsoft.com/download/c/1/5/c150e1ca-4a55-4a7e-94c5-bfc8c2e785c5/Windows%2010%20Minimum%20Hardware%20Requirements.pdf). Furthermore, CPUs that meet these requirements also have SSE3 ([see](https://walbourn.github.io/directxmath-sse3-and-ssse3/))
2024-02-29 17:08:36 +01:00
Guillaume Gomez
8a74df9c22
Rollup merge of #121792 - GuillaumeGomez:improve-suggestion, r=michaelwoerister
Improve renaming suggestion when item starts with underscore

Fixes https://github.com/rust-lang/rust/issues/121776.

It goes from:

```terminal
error[E0433]: failed to resolve: use of undeclared type `Foo`
 --> src/foo.rs:6:13
  |
6 |     let _ = Foo::Bar;
  |             ^^^ use of undeclared type `Foo`
  |
help: an enum with a similar name exists, consider changing it
  |
1 | enum Foo {
  |      ~~~
```

to:

```terminal
error[E0433]: failed to resolve: use of undeclared type `Foo`
 --> foo.rs:6:13
  |
6 |     let _ = Foo::Bar;
  |             ^^^ use of undeclared type `Foo`
  |
help: an enum with a similar name exists, consider renaming `_Foo` into `Foo`
  |
1 | enum Foo {
  |      ~~~

error: aborting due to 1 previous error
```
2024-02-29 14:33:53 +01:00
Guillaume Gomez
b2c3279984
Rollup merge of #121700 - rcvalle:rust-cfi-dont-compress-user-defined-builtin-types, r=compiler-errors
CFI: Don't compress user-defined builtin types

Doesn't compress user-defined builtin types (see https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-builtin and https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-compression).
2024-02-29 14:33:51 +01:00
Guillaume Gomez
5978b6ff83
Rollup merge of #121654 - compiler-errors:async-fn-for-fn-def, r=oli-obk
Fix `async Fn` confirmation for `FnDef`/`FnPtr`/`Closure` types

Fixes three issues:
1. The code in `extract_tupled_inputs_and_output_from_async_callable` was accidentally getting the *future* type and the *output* type (returned by the future) messed up for fnptr/fndef/closure types. :/
2. We have a (class of) bug(s) in the old solver where we don't really support higher ranked built-in `Future` goals for generators. This is not possible to hit on stable code, but [can be hit with `unboxed_closures`](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=e935de7181e37e13515ad01720bcb899) (#121653).
    * I'm opting not to fix that in this PR. Instead, I just instantiate placeholders when confirming `async Fn` goals.
4. Fixed a bug when generating `FnPtr` shims for `async Fn` trait goals.

r? oli-obk
2024-02-29 14:33:50 +01:00
Guillaume Gomez
3770cf7abf Improve suggestion to rename type starting with underscore to make it more obvious what is actually suggested 2024-02-29 12:07:41 +01:00
Jacob Pratt
698cec8d61
Rollup merge of #121779 - mu001999:clean, r=Nilstrieb
Remove unused diagnostic struct

Detected by #121752
2024-02-29 05:25:30 -05:00
Jacob Pratt
d6e0f5cb0c
Rollup merge of #121777 - sisungo:master, r=oli-obk
Fix typo in `rustc_passes/messages.ftl`

Line 190 contains unpaired parentheses:

```
passes_doc_cfg_hide_takes_list =
    `#[doc(cfg_hide(...)]` takes a list of attributes
```

The `#[doc(cfg_hide(...)]` contains unpaired parentheses. This PR changes it to `#[doc(cfg_hide(...))]`, which made the parentheses paired.
2024-02-29 05:25:29 -05:00
Jacob Pratt
23351388d0
Rollup merge of #121745 - compiler-errors:refining-impl-trait-deeply-norm, r=lcnr
Deeply normalize obligations in `refining_impl_trait`

We somewhat awkwardly use semantic comparison when checking the `refining_impl_trait` lint. This relies on us being able to normalize bounds eagerly to avoid cases where an unnormalized alias is not considered equal to a normalized alias. Since `normalize` in the new solver is a noop, let's use `deeply_normalize` instead.

r? lcnr

cc ``@tmandry,`` this should fix your bug lol
2024-02-29 05:25:28 -05:00
Jacob Pratt
69716291c3
Rollup merge of #121740 - surechen:change_attribute_to_local_20240228, r=lcnr
Changing some attributes to only_local.

Modified according to https://github.com/rust-lang/compiler-team/issues/505.

r?  ``@lcnr``
2024-02-29 05:25:27 -05:00
Jacob Pratt
b098b17b47
Rollup merge of #121723 - nnethercote:two-diagnostic-things, r=oli-obk
Two diagnostic things

Two minor improvements to diagnostics-related things.

r? ``@RalfJung``
2024-02-29 05:25:27 -05:00