Commit graph

309693 commits

Author SHA1 Message Date
Matthias Krüger
bbd3ab82bb
Rollup merge of #148600 - folkertdev:pass-indirectly-reuse-attrs, r=JonathanBrouwer
re-use `self.get_all_attrs` result for pass indirectly attribute

Could be a fix for a potential performance regression reported here https://github.com/rust-lang/rust/pull/144529#issuecomment-3491236458. Apparently the regression later disappeared. Nevertheless, this seems like a decent refactor.

r? ````@JonathanBrouwer```` (vaguely attribute-related, maybe there are other optimizations to that PR that we're missing)
2025-11-08 15:42:26 +01:00
Matthias Krüger
f2beff65ca
Rollup merge of #148585 - GuillaumeGomez:improve-format-code, r=yotamofek
[rustdoc] Replace `print` methods with functions to improve code readability

We have a lot of `print` methods, making it quite tricky to know what the types we're manipulating are.

We did something similar with `Clean` trait a few years ago (the first PR was https://github.com/rust-lang/rust/pull/99638, followed by a lot of them).

Each commit replaces one type for easier review.

r? `````@yotamofek`````
2025-11-08 15:42:25 +01:00
Matthias Krüger
624e7ebff4
Rollup merge of #148556 - chenyukang:yukang-fix-148493-async-closure, r=JonathanBrouwer
Fix suggestion for returning async closures

Fixes rust-lang/rust#148493
2025-11-08 15:42:24 +01:00
Matthias Krüger
4bbbea655a
Rollup merge of #148555 - ehuss:rust-by-example-es, r=Kobzol
Fix rust-by-example spanish translation

A spanish translation was added in https://github.com/rust-lang/rust-by-example/pull/1910, but the upstream integration was never added.

```@marioidival,``` I assume you intended for this to go live?
2025-11-08 15:42:24 +01:00
Matthias Krüger
a029c11188
Rollup merge of #148230 - fmease:rustdoc-highlight-tweaks, r=GuillaumeGomez
rustdoc: Properly highlight shebang, frontmatter & weak keywords in source code pages and code blocks

Before | After
---|---
<img width="517" height="532" alt="Screenshot 2025-10-28 at 23-21-02 pre rs - source" src="https://github.com/user-attachments/assets/5026761f-c604-4bcc-a699-9e75eb73dff6" /> | <img width="499" height="531" alt="Screenshot 2025-10-28 at 23-21-51 pre rs - source" src="https://github.com/user-attachments/assets/cc8c65e7-e3ad-4e20-a2c3-2623cf799093" />
2025-11-08 15:42:23 +01:00
Matthias Krüger
9ccff4ae27
Rollup merge of #147686 - vrtgs:non-zero-isolate, r=joboet
update isolate_highest_one for NonZero<T>

## Rationale
Let `x = self` and
`m = (((1 as $Int) << (<$Int>::BITS - 1)).wrapping_shr(self.leading_zeros()))`
Then the previous code computed `NonZero::new_unchecked(x & m)`.
Since `m` has exactly one bit set (the most significant 1-bit of `x`), `(x & m) == m`.
Therefore, the masking step was redundant.

The shift is safe and does not need wrapping because:
* `self.leading_zeros() < $Int::BITS` because `self` is non-zero.
* The result of `unchecked_shr` is non-zero, satisfying the `NonZero` invariant. if wrapping happens we would be violating `NonZero` invariants.

why this micro optimization?
the old code was suboptimal it duplicated `$Int`’s isolate_highest_one logic instead of delegating to it. Since the type already wraps `$Int`, either delegation should be used for clarity or, if keeping a custom implementation, it should be optimized as above.
2025-11-08 15:42:22 +01:00
Matthias Krüger
da2e3aabca
Rollup merge of #147540 - bjoernager:slice-as-array, r=Amanieu
Stabilise `as_array` in `[_]` and `*const [_]`; stabilise `as_mut_array` in `[_]` and `*mut [_]`.

Tracking issue: rust-lang/rust#133508

Closes: rust-lang/rust#133508

This PR stabilises the `as_array` and `as_mut_array` associated functions from the `core_slice_as_array` feature gate:

```rust
// core::slice

impl<T> [T] {
    pub const fn as_array<const N: usize>(&self) -> Option<&[T; N]>;

    pub const fn as_mut_array<const N: usize>(&mut self) -> Option<&mut [T; N]>;
}

// core::ptr

impl<T> *const [T] {
    pub const fn as_array<const N: usize>(self) -> Option<*const [T; N]>;
}

impl<T> *mut [T] {
    pub const fn as_mut_array<const N: usize>(self) -> Option<*mut [T; N]>;
}
```

It also updates the feature gates and tracking issues for all items associated with the previous `slice_as_array` tracking issue (including these four that are being stabilised).

~~FCP missing.~~
2025-11-08 15:42:22 +01:00
Matthias Krüger
0f786bd8fb
Rollup merge of #147534 - sayantn:simd-funnel-shifts, r=RalfJung
Implement SIMD funnel shifts in const-eval/Miri

Split off from rust-lang/rust#147520 with just this change for easier review

r? ```@RalfJung```
2025-11-08 15:42:21 +01:00
Matthias Krüger
da171df13c
Rollup merge of #147024 - brad0:std_detect_openbsd_elf_aux_info, r=Mark-Simulacrum
std_detect: Support run-time detection on OpenBSD using elf_aux_info
2025-11-08 15:42:20 +01:00
Matthias Krüger
7d63382000
Rollup merge of #145656 - folkertdev:stabilize-s390x-vector, r=Amanieu
Stabilize s390x `vector` target feature and `is_s390x_feature_detected!` macro

closes https://github.com/rust-lang/rust/issues/145649
closes https://github.com/rust-lang/rust/issues/135413
cc: https://github.com/rust-lang/rust/issues/130869
reference PR: https://github.com/rust-lang/reference/pull/1972

# Stabilization report

## Summary

This PR stabilizes the following s390x target features:

- `vector`
- `vector-enhancements-1`
- `vector-enhancements-2`
- `vector-enhancements-3`
- `vector-packed-decimal`
- `vector-packed-decimal-enhancement`
- `vector-packed-decimal-enhancement-2`
- `vector-packed-decimal-enhancement-3`
- `nnp-assist`
- `miscellaneous-extensions-2`
- `miscellaneous-extensions-3`
- `miscellaneous-extensions-4`

Additionally, it stabilizes the `std::arch::is_s390x_feature_detected!` macro itself and stably accepts the target features listed above.

## Tests & ABI details

Only the `vector` target feature changes the ABI, much like e.g. `avx2` it will, depending on the ABI, pass vector types in vector registers. This behavior is tested extensively:

- [tests/assembly-llvm/s390x-vector-abi.rs](22a86f8280/tests/assembly-llvm/s390x-vector-abi.rs)
- [tests/codegen-llvm/s390x-simd.rs](22a86f8280/tests/assembly-llvm/s390x-vector-abi.rs)
- [tests/ui/abi/simd-abi-checks-s390x.rs ](22a86f8280/tests/ui/abi/simd-abi-checks-s390x.rs )

The remaining features don't influence the ABI, they only influence instruction selection. In stdarch we test that the expected instructions are in fact generated when the target feature is enabled.

## Implementation history

For `is_s390x_feature_detected!`:

- https://github.com/rust-lang/stdarch/pull/1699
- https://github.com/rust-lang/rust/pull/138275
- https://github.com/rust-lang/stdarch/pull/1720
- https://github.com/rust-lang/stdarch/pull/1832

For `vector` and friends

- https://github.com/rust-lang/rust/pull/127506
- https://github.com/rust-lang/rust/pull/135630
- https://github.com/rust-lang/rust/pull/141250

## Unresolved questions

There is a fixme in [tests/ui/abi/simd-abi-checks-s390x.rs](22a86f8280/tests/ui/abi/simd-abi-checks-s390x.rs):

```
// FIXME: +soft-float itself doesn't set -vector
//`@[z13_soft_float]` compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector,+soft-float
//`@[z13_soft_float]` needs-llvm-components: systemz
```

I'm not sure whether that blocks stabilization?

---

The implementation first extracts the listed target features into their own `s390x_target_feature_vector` rust feature, and then stabilizes that. best reviewed commit-by-commit

r? `@Amanieu`
cc `@uweigand`  `@taiki-e`
2025-11-08 15:42:19 +01:00
bors
bbb6f68e28 Auto merge of #147803 - jsgf:move-copy-codegen, r=madsmtm,saethlin
Add -Zannotate-moves for profiler visibility of move/copy operations (codegen)

**Note:** this is an alternative implementation of https://github.com/rust-lang/rust/pull/147206; rather than being a MIR transform, it adds the annotations closer to codegen. It's functionally the same but the implementation is lower impact and it could be more correct.

---

This implements a new unstable compiler flag `-Zannotate-moves` that makes move and copy operations visible in profilers by creating synthetic debug information. This is achieved with zero runtime cost by manipulating debug info scopes to make moves/copies appear as calls to `compiler_move<T, SIZE>` and `compiler_copy<T, SIZE>` marker functions in profiling tools.

This allows developers to identify expensive move/copy operations in their code using standard profiling tools, without requiring specialized tooling or runtime instrumentation.

The implementation works at codegen time. When processing MIR operands (`Operand::Move` and `Operand::Copy`), the codegen creates an `OperandRef` with an optional `move_annotation` field containing an `Instance` of the appropriate profiling marker function. When storing the operand, `store_with_annotation()` wraps the store operation in a synthetic debug scope that makes it appear inlined from the marker.

Two marker functions (`compiler_move` and `compiler_copy`) are defined in `library/core/src/profiling.rs`. These are never actually called - they exist solely as debug info anchors.

Operations are only annotated if:
   - We're generating debug info and the feature is enabled.
   - Meets the size threshold (default: 65 bytes, configurable via `-Zannotate-moves=SIZE`), and is non-zero
   - Has a memory representation

This has a very small size impact on object file size. With the default limit it's well under 0.1%, and even with a very small limit of 8 bytes it's still ~1.5%. This could be enabled by default.
2025-11-08 07:57:14 +00:00
bors
4e0baae06d Auto merge of #148674 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

22 commits in 6368002885a04cbeae39a82cf5118f941559a40a..445fe4a68f469bf936b2fd81de2c503b233a7f4f
2025-10-31 14:31:52 +0000 to 2025-11-07 18:08:19 +0000
- fix(depinfo): prevent invalid trailing backslash on Windows (rust-lang/cargo#16223)
- refactor: Remove lazycell (rust-lang/cargo#16224)
- refactor: extract ConfigValue to its own module (rust-lang/cargo#16222)
- fix(config): non-mergeable list from cli should take priority (rust-lang/cargo#16220)
- fix(compile): build.warnings=deny shouldn't block hard warnings (rust-lang/cargo#16213)
- fix: display absolute path in the `missing in PATH` warning (rust-lang/cargo#16125)
- fix: non-mergeable list from config cli merge the same way  (rust-lang/cargo#16219)
- docs(contrib): Link out to rustc diagnostic style guide (rust-lang/cargo#16216)
- fix: Remove build-plan (rust-lang/cargo#16212)
- Add native completions for `--package` on various commands (rust-lang/cargo#16210)
- fix(completions): don't wrap completion item help in parenthesis (rust-lang/cargo#16215)
- refactor(locking): Make disabling locking on NFS mounts explicit (rust-lang/cargo#16177)
- docs(unstable): Move compile-time-deps out of Stabilized section (rust-lang/cargo#16211)
- docs(ref): Rename DEP_NAME_KEY to DEP_LINKS_KEY (rust-lang/cargo#16205)
- feat(build-analysis): emit rebuild reason log entry (rust-lang/cargo#16203)
- chore: Update dependencies (rust-lang/cargo#16200)
- chore(deps): update cargo-semver-checks to v0.45.0 (rust-lang/cargo#16190)
- chore(deps): update msrv (rust-lang/cargo#16178)
- refactor: embed deserialize validation logic in ProgressConfig (rust-lang/cargo#16194)
- refactor(gctx): extract config schema to a module (rust-lang/cargo#16195)
- chore: bump to 0.94.0; update changelog (rust-lang/cargo#16191)
- chore(deps): update rust crate gix to 0.74.0 (rust-lang/cargo#16186)

r? ghost
2025-11-08 03:33:10 +00:00
bors
ceb7df7e6f Auto merge of #147029 - neuschaefer:memchr-2.7.6, r=marcoieni
Update memchr to 2.7.6

memchr 2.7.6 contains a bugfix for aarch64_be.

Note: I'm not sure about how dependency updates are managed in rust.git. If something should go through another branch or will happen automatically, please let me know.
2025-11-07 21:58:38 +00:00
Weihang Lo
2bd3508ed8
Update cargo submodule 2025-11-07 16:30:54 -05:00
Vrtgs
057127cfee update isolate_highest_one for NonZero<T> 2025-11-08 00:22:36 +03:00
Gabriel Bjørnager Jensen
fa8e8649ad
Stabilise 'as_array' in '[_]' and '*const [_]'; Stabilise 'as_mut_array' in '[_]' and '*mut [_]'; Update feature gate and tracking issue for 'alloc_slice_into_array' items; 2025-11-07 15:14:41 +01:00
bors
843f8ce2eb Auto merge of #147798 - Zalathar:uutils, r=jieyouxu
ci: Switch back to default coreutils (uutils) after libffi-sys bump

Now that Miri has updated to the latest `libffi-sys`, we should be able to remove the GNU coreutils workaround, and switch back to the default coreutils (uutils) in the runners using Ubuntu 25.10 images.

If we encounter any other uutils compatibility problems in the future, they should hopefully be easier to trace back to specific changes.

- https://github.com/rust-lang/rust/pull/147581
- https://github.com/rust-lang/miri/pull/4634
- https://github.com/rust-lang/rust/pull/147744

Closes rust-lang/rust#147556.
2025-11-07 13:49:36 +00:00
Guillaume Gomez
0f0342949d Replace Display::fmt with write_char 2025-11-07 11:45:29 +01:00
Guillaume Gomez
f2794ce6c0 Switch clean print methods into a function 2025-11-07 11:42:04 +01:00
sayantn
a7aedeb5c8
implement SIMD funnel shifts in const-eval 2025-11-07 16:09:50 +05:30
bors
96064126a0 Auto merge of #147641 - cjgillot:liveness-cache-strings, r=estebank
Liveness: Cache the set of string constants for suggestions.

Even on a slow diagnostic path, listing all the constants in MIR can be expensive, so cache it.
2025-11-07 09:50:49 +00:00
bors
0bbef557bb Auto merge of #148624 - jhpratt:rollup-is5je9r, r=jhpratt
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#145768 (Offload device)
 - rust-lang/rust#145992 (Stabilize `vec_deque_pop_if`)
 - rust-lang/rust#147416 (Early return if span is from expansion so we dont get empty span and ice later on)
 - rust-lang/rust#147808 (btree: cleanup difference, intersection, is_subset)
 - rust-lang/rust#148520 (style: Use binary literals instead of hex literals in doctests for `highest_one` and `lowest_one`)
 - rust-lang/rust#148559 (Add typo suggestion for a misspelt Cargo environment variable)
 - rust-lang/rust#148567 (Fix incorrect precedence caused by range expression)
 - rust-lang/rust#148570 (Fix mismatched brackets in generated .dir-locals.el)
 - rust-lang/rust#148575 (fix dev guide link in rustc_query_system/dep_graph/README.md)
 - rust-lang/rust#148578 (core docs: add notes about availability of `Atomic*::from_mut_slice`)
 - rust-lang/rust#148603 (Backport 1.91.1 relnotes to main)
 - rust-lang/rust#148609 (Sync str::rsplit_once example with str::split_once)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-07 06:42:51 +00:00
Jacob Pratt
c932d7c45f
Rollup merge of #148609 - AMDmi3:rsplit_once_example, r=chenyukang
Sync str::rsplit_once example with str::split_once

This adds `"cfg=".rsplit_once('=')` case to `rsplit_once` example, bringing it in sync with example for `split_once`. For consistency and to make life easier for ones who want to ensure bahaviour of this specific edge case.
2025-11-07 00:21:24 -05:00
Jacob Pratt
0dafd5057f
Rollup merge of #148603 - pietroalbini:ea-1.91.1-relnotes, r=pietroalbini
Backport 1.91.1 relnotes to main

Backport of the release notes from https://github.com/rust-lang/rust/pull/148593 to the main branch. This should land before Monday so that the automation creates the GitHub release.
2025-11-07 00:21:23 -05:00
Jacob Pratt
9d001902ae
Rollup merge of #148578 - WaffleLapkin:equal-alignment-atomic-from-mut-slice, r=m-ou-se
core docs: add notes about availability of `Atomic*::from_mut_slice`

See https://github.com/rust-lang/rust/issues/76314#issuecomment-3496758620

r? libs-api
2025-11-07 00:21:23 -05:00
Jacob Pratt
dff3697089
Rollup merge of #148575 - vyacheslavhere:fix-query-system-readme-link, r=chenyukang
fix dev guide link in rustc_query_system/dep_graph/README.md
2025-11-07 00:21:22 -05:00
Jacob Pratt
694ddb34d0
Rollup merge of #148570 - TomFryersMidsummer:dir-locals, r=chenyukang
Fix mismatched brackets in generated .dir-locals.el

This caused Emacs to throw errors when opening files.

Introduced in 3fe3edbcde.
2025-11-07 00:21:21 -05:00
Jacob Pratt
3f1bce5219
Rollup merge of #148567 - chenyukang:yukang-fix-148344-incorrect-precedence, r=hkBst,Kivooeo
Fix incorrect precedence caused by range expression

Fixes rust-lang/rust#148344
The testcase `tests/ui/feature-gates/feature-gate-new_range` is also fixed.
2025-11-07 00:21:21 -05:00
Jacob Pratt
3186f21a8b
Rollup merge of #148559 - chenyukang:yukang-fix-148439-env, r=Kivooeo
Add typo suggestion for a misspelt Cargo environment variable

Fixes rust-lang/rust#148439
2025-11-07 00:21:20 -05:00
Jacob Pratt
3d765e3788
Rollup merge of #148520 - sorairolake:update-lowest-highest-one-doctests, r=tgross35
style: Use binary literals instead of hex literals in doctests for `highest_one` and `lowest_one`

For example, I think it's easier to understand that the index of the highest bit set to one in `16` is `4` as `0b10000` than as `0x10`.

```rust
assert_eq!(0x10_u64.highest_one(), Some(4));
```

Instead of:

```rust
assert_eq!(0b10000_u64.highest_one(), Some(4));
```

rust-lang/rust#145203
2025-11-07 00:21:19 -05:00
Jacob Pratt
4ad5a39183
Rollup merge of #147808 - hkBst:btree-3, r=joboet
btree: cleanup difference, intersection, is_subset
2025-11-07 00:21:19 -05:00
Jacob Pratt
7af1ee3556
Rollup merge of #147416 - Kivooeo:ice-fix23456, r=fmease
Early return if span is from expansion so we dont get empty span and ice later on

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

The problem original was from that stmt.span was from expansion and it span was bigger than right part which is block.span, so it causes empty span and panic later on, I decided to add checks for both of them to be on the safe side

r? `@fmease` (you were in discussion on this issue so I decided to assign you, feel free to reroll)
2025-11-07 00:21:18 -05:00
Jacob Pratt
47eeb00a63
Rollup merge of #145992 - GrigorenkoPV:stabilize/vec_deque_pop_if, r=Amanieu
Stabilize `vec_deque_pop_if`

Tracking issue: rust-lang/rust#135889
Closes rust-lang/rust#135889
Also fixes a typo mentioned in https://github.com/rust-lang/rust/issues/135889#issuecomment-2991213248

FCP: https://github.com/rust-lang/rust/issues/135889#issuecomment-3238777731

`@rustbot` label -T-libs +T-libs-api +needs-fcp +S-waiting-on-fcp

r? t-libs-api
2025-11-07 00:21:17 -05:00
Jacob Pratt
c63793952e
Rollup merge of #145768 - ZuseZ4:offload-device, r=oli-obk
Offload device

LLVM's offload functionality usually expects an extra dyn_ptr argument. We could avoid it,b ut likely gonna need it very soon in one of the follow-up PRs (e.g. to request shared memory). So we might as well already add it.

This PR adds a %dyn_ptr ptr to GPUKernel ABI functions, if the offload feature is enabled.

WIP

r? ```@ghost```
2025-11-07 00:21:17 -05:00
yukang
c92ef47934 Fix suggestion for returning async closures 2025-11-07 08:42:43 +08:00
Jeremy Fitzhardinge
5f29f11a4d Add -Zannotate-moves for profiler visibility of move/copy operations
This implements a new unstable compiler flag `-Zannotate-moves` that makes
move and copy operations visible in profilers by creating synthetic debug
information. This is achieved with zero runtime cost by manipulating debug
info scopes to make moves/copies appear as calls to `compiler_move<T, SIZE>`
and `compiler_copy<T, SIZE>` marker functions in profiling tools.

This allows developers to identify expensive move/copy operations in their
code using standard profiling tools, without requiring specialized tooling
or runtime instrumentation.

The implementation works at codegen time. When processing MIR operands
(`Operand::Move` and `Operand::Copy`), the codegen creates an `OperandRef`
with an optional `move_annotation` field containing an `Instance` of the
appropriate profiling marker function. When storing the operand,
`store_with_annotation()` wraps the store operation in a synthetic debug
scope that makes it appear inlined from the marker.

Two marker functions (`compiler_move` and `compiler_copy`) are defined
in `library/core/src/profiling.rs`. These are never actually called -
they exist solely as debug info anchors.

Operations are only annotated if the type:
   - Meets the size threshold (default: 65 bytes, configurable via
     `-Zannotate-moves=SIZE`)
   - Has a non-scalar backend representation (scalars use registers,
     not memcpy)

This has a very small size impact on object file size. With the default
limit it's well under 0.1%, and even with a very small limit of 8 bytes
it's still ~1.5%. This could be enabled by default.
2025-11-06 15:39:45 -08:00
Kivooeo
62ccf14c14 add check if macro from expansion 2025-11-06 22:42:10 +00:00
Dmitry Marakasov
b975c570fa Sync str::rsplit_once example with str::split_once 2025-11-07 01:01:54 +03:00
Emily Albini
eec36b390e update release notes 2025-11-06 20:24:37 +01:00
Folkert de Vries
1a9cc78577
re-use self.get_all_attrs result for pass indirectly attribute 2025-11-06 19:45:44 +01:00
yukang
3edd25f049 Add typo suggestion for a misspelt Cargo environment variable 2025-11-06 23:10:39 +08:00
bors
c90bcb9571 Auto merge of #148573 - matthiaskrgr:rollup-cn5viia, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#146861 (add extend_front to VecDeque with specialization like extend)
 - rust-lang/rust#148213 (Fix invalid tag closing when leaving expansion "original code")
 - rust-lang/rust#148292 (Un-shadow object bound candidate in `NormalizesTo` goal if self_ty is trait object)
 - rust-lang/rust#148528 (run-make tests: use edition 2024)
 - rust-lang/rust#148554 (Add regression test for issue 148542)
 - rust-lang/rust#148561 (Fix ICE from async closure variance)
 - rust-lang/rust#148563 (rustdoc-search: remove broken index special case)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-06 14:52:37 +00:00
Waffle Lapkin
893f0d2cff
core docs: add notes about availability of Atomic*::from_mut_slice 2025-11-06 15:23:11 +01:00
Vyacheslav
e77e5d1bc1
fix dev guide link in rustc_query_system/dep_graph/README.MD 2025-11-06 17:17:03 +05:00
Folkert de Vries
7516645928
stabilize s390x_target_feature_vector 2025-11-06 12:49:48 +01:00
Folkert de Vries
c59298da36
stabilize stdarch_s390x_feature_detection 2025-11-06 12:49:46 +01:00
Folkert de Vries
02e4db5cc6
std_detect: give s390x features more accurate features / tracking issues 2025-11-06 12:49:04 +01:00
Folkert de Vries
d69442fe9c
std_detect: remove unneeded stability lines from s390x features macro 2025-11-06 12:49:04 +01:00
Folkert de Vries
0645ac31cb
extract s390x vector and friends to their own rust feature 2025-11-06 12:49:04 +01:00
bors
c5e283b0d2 Auto merge of #148188 - Muscraft:annotate-snippets-default-on-nightly, r=estebank
feat: Use annotate-snippets by default on nightly

This PR switches the default renderer to use `annotate-snippets` on nightly, but does not affect stable. This is part of the ongoing effort to use `annotate-snippets` to render all diagnostics.

[MCP](https://github.com/rust-lang/compiler-team/issues/937)

Note: This contains the test change from rust-lang/rust#148004, without the change to the default emitter.

rust-lang/rust#59346
rust-lang/rust-project-goals#123

r? `@davidtwco`
2025-11-06 11:45:06 +00:00