Commit graph

316694 commits

Author SHA1 Message Date
zedddie
a257fb960f
Fix ICE in transmutability error reporting when type aliases are normalized 2026-01-29 20:50:18 +01:00
bors
370143facf Auto merge of #151816 - Zalathar:rollup-z5YytdB, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151775 (Portable SIMD subtree update)
 - rust-lang/rust#151488 (Tweak E0599 to consolidate unsatisfied trait bound messages)
 - rust-lang/rust#149823 (fix(parser): Disallow CR in frontmatter )
 - rust-lang/rust#151475 (add foregin type tests for issue 64458)
 - rust-lang/rust#151657 (Cleanup of `#[derive(Diagnostic)]` attribute parsers)
2026-01-29 11:49:06 +00:00
Stuart Cook
617288eb58
Rollup merge of #151657 - JonathanBrouwer:diag2, r=Kivooeo
Cleanup of `#[derive(Diagnostic)]` attribute parsers

This PR does a lot of refactoring on the implementation of `#[derive(Diagnostic)]`. It should have no observable effect other than error messages for incorrect usage of the attributes. In general, I think the error messages got better.

This PR can be reviewed commit by commit, each commit passes the tests.
- [Convert parse_nested_meta to parse_args_with for #[diagnostic]](https://github.com/rust-lang/rust/pull/151657/changes/9e61014a8a0bb1f1d7911511c303a7ae2a9c2a7d)
  Start parsing `#[diagnostic]` using `syn`'s `parse_args_with` function instead of `parse_nested_meta`. This improves error messages and prepares for the new syntax needed for https://github.com/rust-lang/rust/issues/151366 which cannot be parsed using `parse_args_with`.
- [Convert parse_nested_meta to parse_args_with for #[subdiagnostic]](https://github.com/rust-lang/rust/pull/151657/changes/5d21a21695d56b74ea249f269ee10195251008b7)
  Same as above but for `#[subdiagnostic]`
- [Remove unused no_span option](https://github.com/rust-lang/rust/pull/151657/changes/0bf3f5d51cb853884240792818d81e70daec6ab7)
  Removes the `no_span` option of `#[suggestion]`, which there were no tests for and which seems to have been unused. If needed again in the future, this can be re-added pretty easily, but I find that unlikely.
- [Remove HasFieldMap trait in favour of passing FieldMap directly](https://github.com/rust-lang/rust/pull/151657/changes/2e8347abf4147d2bffe4d7989a21b17ae04cdb57)
  Removes the `HasFieldMap` trait, because I don't really see the point of having a trait "has a field map" if we can just pass the fieldmap itself instead.

r? @Kivooeo
(Thanks for reviewing my PRs so far :3)
2026-01-29 22:34:10 +11:00
Stuart Cook
36a2726bb4
Rollup merge of #151475 - KaiTomotake:add-foreign-type-tests, r=Kivooeo
add foregin type tests for issue 64458

add tests/ui/rfcs/rfc-1861-extern-types/comparison.rs

close rust-lang/rust#64458
2026-01-29 22:34:09 +11:00
Stuart Cook
b6ce0c0028
Rollup merge of #149823 - epage:f, r=Kivooeo
fix(parser): Disallow CR in frontmatter

T-lang came back on the stabilization PR (rust-lang/rust#148051) asking for CR to be disallowed
to leave room for all stray CRs to be rejected in the future.
At that point, the test can remain but the implementation can be
removed.

If that plan does not go through, we'll need to re-evaluate
- whether this is more lint-like and should defer to the calling tool
  that is managing the frontmatter
- how much Rust should treat the frontmatter as Rust and apply the same
  grammar restrictions of "no stray CR" (like raw string literals)

Part of rust-lang/rust#136889
2026-01-29 22:34:09 +11:00
Stuart Cook
2b899b07f0
Rollup merge of #151488 - JohnTitor:issue-114430, r=estebank
Tweak E0599 to consolidate unsatisfied trait bound messages

Fixes rust-lang/rust#114430
r? @estebank
2026-01-29 22:34:08 +11:00
Stuart Cook
d49f50ff4a
Rollup merge of #151775 - calebzulawski:sync-from-portable-simd-2026-01-28, r=folkertdev
Portable SIMD subtree update

cc @folkertdev @programmerjake
2026-01-29 22:34:07 +11:00
bors
80b898258d Auto merge of #151809 - Zalathar:rollup-YOo3wjw, r=Zalathar
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#150474 (Tidy: detect ui tests subdirectory changes so `tests/ui/README.md` stays in sync)
 - rust-lang/rust#150572 (Improve move error diagnostic for `AsyncFn` closures)
 - rust-lang/rust#151596 (Fix -Zmir-enable-passes to detect unregistered enum names in declare_passes macro)
 - rust-lang/rust#151802 (Make `QueryDispatcher::Qcx` an associated type)
 - rust-lang/rust#149110 (Implement `cast_slice` for raw pointer types)
 - rust-lang/rust#151559 ([rustdoc] Add a marker to tell users that there are hidden (deprecated) items in the search results)
 - rust-lang/rust#151665 (Fix contrast ratio for `Since` element in rustdoc dark theme)
 - rust-lang/rust#151785 (Stabilize feature(push_mut))
 - rust-lang/rust#151798 (Update `askama` to `0.15.3`)
 - rust-lang/rust#151800 (Subscribe myself to translation diagnostics)
 - rust-lang/rust#151804 (Document, sort, and tweak spellcheck entries in `typos.toml`)
 - rust-lang/rust#151805 (Fix grammar in `env::current_exe()#Security`)
2026-01-29 08:41:01 +00:00
Yuki Okushi
4b22ee9fc5 Tweak E0599 to consolidate unsatisfied trait bound messages 2026-01-29 17:26:32 +09:00
Stuart Cook
e397c50de6
Rollup merge of #151805 - ZenPZero:patch-1, r=jhpratt
Fix grammar in `env::current_exe()#Security`
2026-01-29 19:03:34 +11:00
Stuart Cook
a67e3450ec
Rollup merge of #151804 - Zalathar:sort-typos, r=lqd
Document, sort, and tweak spellcheck entries in `typos.toml`

- This grew out of rust-lang/rust#151781, which was originally a simple typo fix.
2026-01-29 19:03:33 +11:00
Stuart Cook
4d7db909b2
Rollup merge of #151800 - JonathanBrouwer:subscribe-translation, r=JonathanBrouwer
Subscribe myself to translation diagnostics
2026-01-29 19:03:33 +11:00
Stuart Cook
a3be677570
Rollup merge of #151798 - GuillaumeGomez:update-askama, r=GuillaumeGomez
Update `askama` to `0.15.3`

Some bugfixes.

r? ghost
2026-01-29 19:03:32 +11:00
Stuart Cook
70e5959e48
Rollup merge of #151785 - zachs18:stabilize-push_mut, r=jhpratt
Stabilize feature(push_mut)

Stabilizes `feature(push_mut)`, consisting of `Vec::push_mut`, `Vec::insert_mut`, `VecDeque::push_front_mut`, `VecDeque::push_back_mut`, `VecDeque::insert_mut`, `LinkedList::push_front_mut`, and `LinkedList::push_back_mut`.

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

FCP completed: https://github.com/rust-lang/rust/issues/135974#issuecomment-3763973089

Release notes: https://github.com/rust-lang/rust/issues/151252
2026-01-29 19:03:32 +11:00
Stuart Cook
3830f76b4a
Rollup merge of #151665 - arferreira:fix-rustdoc-contrast, r=GuillaumeGomez
Fix contrast ratio for `Since` element in rustdoc dark theme

Changed `--right-side-color` from `#808080` to `#ababab` in the dark theme.

<img width="742" height="784" alt="Screenshot 2026-01-25 at 8 04 29 PM" src="https://github.com/user-attachments/assets/38c5f0b9-2034-429f-87db-8a0ed8209b5d" />

Verified visually in dark theme, it's now more readable:

<img width="174" height="96" alt="Screenshot 2026-01-25 at 8 41 02 PM" src="https://github.com/user-attachments/assets/d0c30409-4374-48c4-ae9c-a0aec48e8957" />

Part of https://github.com/rust-lang/rust/issues/59845
Fixes rust-lang/rust#151422
2026-01-29 19:03:32 +11:00
Stuart Cook
f5822b672b
Rollup merge of #151559 - GuillaumeGomez:marker-hidden-deprecated-search, r=lolbinarycat
[rustdoc] Add a marker to tell users that there are hidden (deprecated) items in the search results

Someone on mastodon rightfully pointed out that having a visual indication that some search results were hidden would be a good idea if the "hide deprecated items" setting is enabled. In particular if no results are displayed.

It looks like this:

<img width="861" height="228" alt="Screenshot From 2026-01-24 00-26-33" src="https://github.com/user-attachments/assets/93aeef11-a550-47dc-9c78-219ea4fd822c" />

r? @lolbinarycat
2026-01-29 19:03:31 +11:00
Stuart Cook
034b53c863
Rollup merge of #149110 - Paladynee:acp/ptr_cast_slice, r=jhpratt
Implement `cast_slice` for raw pointer types

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

This PR implements the method `cast_slice` that defers to the respective `slice_from_raw_parts` call for `*const T`, `*mut T` and `NonNull<T>`, and copies over their documentation.
```rust
impl<T> *const T {
    pub const fn cast_slice(self, len: usize) -> *const [T];
}
impl<T> *mut T {
    pub const fn cast_slice(self, len: usize) -> *mut [T];
}
impl<T> NonNull<T> {
    pub const fn cast_slice(self, len: usize) -> NonNull<[T]>;
}
```
2026-01-29 19:03:31 +11:00
Stuart Cook
26dfc4d6b9
Rollup merge of #151802 - Zalathar:qcx, r=nnethercote
Make `QueryDispatcher::Qcx` an associated type

There's no reason to think that a query dispatcher/vtable would support multiple query-context types, and this simplifies some generic signature boilerplate.

---

- This is the planned change that was mentioned in https://github.com/rust-lang/rust/pull/151777#issuecomment-3810715635.

r? nnethercote
2026-01-29 19:03:30 +11:00
Stuart Cook
9f0483e5f0
Rollup merge of #151596 - sgasho:150910_SimplifyCfg_passes_warn, r=nnethercote,saethlin
Fix -Zmir-enable-passes to detect unregistered enum names in declare_passes macro

related: https://github.com/rust-lang/rust/issues/150910

I fixed declare_passes macro to detect unregistered enum names

### UI Results
+nightly --> before: no warnings
+stage1 --> after: detect SimplifyCfg as an unknown pass

<img width="591" height="199" alt="スクリーンショット 2026-01-24 23 53 41" src="https://github.com/user-attachments/assets/ddabaa58-b4c6-4e80-a3c9-f40d866db273" />
2026-01-29 19:03:30 +11:00
Stuart Cook
9f551d31e4
Rollup merge of #150572 - heathdutton:issue-150174-asyncfn-diagnostic-v2, r=lcnr
Improve move error diagnostic for `AsyncFn` closures

When an async closure captures a variable by move but is constrained to `AsyncFn` or `AsyncFnMut`, the error message now explains that the closure kind is the issue and points to the trait bound, similar to the existing diagnostic for `Fn`/`FnMut` closures.

**Before:**
```
error[E0507]: cannot move out of `foos` which is behind a shared reference
  --> src/lib.rs:12:20
   |
11 | async fn foo(foos: &mut [&mut Foo]) -> Result<(), ()> {
   |              ---- move occurs because `foos` has type...
12 |     in_transaction(async || -> Result<(), ()> {
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^ `foos` is moved here
13 |         for foo in foos {
   |                    ---- variable moved due to use in coroutine
```

**After:**
```
error[E0507]: cannot move out of `y`, a captured variable in an `AsyncFn` closure
  --> src/lib.rs:9:10
   |
LL |     let y = vec![format!("World")];
   |         - captured outer variable
LL |     call(async || {
   |          ^^^^^^^^ captured by this `AsyncFn` closure
...
help: `AsyncFn` and `AsyncFnMut` closures require captured values to be able
      to be consumed multiple times, but `AsyncFnOnce` closures may consume
      them only once
  --> src/lib.rs:5:27
   |
LL | fn call<F>(_: F) where F: AsyncFn() {}
   |                           ^^^^^^^^^
```

Fixes rust-lang/rust#150174
2026-01-29 19:03:29 +11:00
Stuart Cook
dd43c8848d
Rollup merge of #150474 - reddevilmidzy:tidy-sub-dir, r=Zalathar
Tidy: detect ui tests subdirectory changes so `tests/ui/README.md` stays in sync

close: rust-lang/rust#150399

There's an issue where `tests/ui/README.md` isn't updated whenever the ui subdirectory changes.
I've added subdirectory change detection to tidy ~~added a new mention to `triage.toml` to notify `tests/ui/README.md` to also be updated~~.

r? @Urgau
2026-01-29 19:03:29 +11:00
Zen
f5b53682a1
Fix grammar 2026-01-28 23:00:39 -05:00
Zalathar
a42bbe697f Fix some typos of "definition" 2026-01-29 13:33:41 +11:00
Zalathar
38a60a6307 Explain some allowlist entries in typos.toml 2026-01-29 13:33:41 +11:00
Zalathar
e8bdcb084d Enforce alphabetical sorting in typos.toml and tweak comments 2026-01-29 13:16:36 +11:00
Zalathar
8238fa692a Remove or narrow some typos.toml allowlist entries 2026-01-29 13:16:25 +11:00
sgasho
99591e6d42 Fix -Zmir-enable-passes to detect unregistered enum names 2026-01-29 09:01:05 +09:00
Zalathar
2a96ea0bee Make QueryDispatcher::Qcx an associated type 2026-01-29 10:59:58 +11:00
Caleb Zulawski
b71ff51277 Update std and tests to match std::simd API (remove LaneCount bound and rename to_int to to_simd) 2026-01-28 18:35:17 -05:00
bors
ba284f468c Auto merge of #151794 - JonathanBrouwer:rollup-rGbYGX2, r=JonathanBrouwer
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#150491 (resolve: Mark items under exported ambiguous imports as exported)
 - rust-lang/rust#150720 (Do not suggest `derive` if there is already an impl)
 - rust-lang/rust#150968 (compiler-builtins: Remove the no-f16-f128 feature)
 - rust-lang/rust#151493 ([RFC] rustc_parse: improve the error diagnostic for "missing let in let chain")
 - rust-lang/rust#151660 (Bump `std`'s `backtrace`'s `rustc-demangle`)
 - rust-lang/rust#151696 (Borrowck: Simplify SCC annotation computation, placeholder rewriting)
 - rust-lang/rust#151704 (Implement `set_output_kind` for Emscripten linker)
 - rust-lang/rust#151706 (Remove Fuchsia from target OS list in unix.rs for sleep)
 - rust-lang/rust#151769 (fix undefined behavior in VecDeque::splice)
 - rust-lang/rust#151779 (stdarch subtree update)
 - rust-lang/rust#151449 ([rustdoc] Add regression test for rust-lang/rust#151411)
 - rust-lang/rust#151773 (clean up checks for constant promotion of integer division/remainder operations)
2026-01-28 21:40:46 +00:00
Jonathan Brouwer
6eb9c02a96
Subscribe myself to translation diagnostics 2026-01-28 22:40:28 +01:00
Jonathan Brouwer
2e8347abf4
Remove HasFieldMap trait in favour of passing FieldMap directly 2026-01-28 22:30:29 +01:00
Jonathan Brouwer
0bf3f5d51c
Remove unused no_span option 2026-01-28 22:23:23 +01:00
Jonathan Brouwer
5d21a21695
Convert parse_nested_meta to parse_args_with for #[subdiagnostic] 2026-01-28 22:18:44 +01:00
Jonathan Brouwer
9e61014a8a
Convert parse_nested_meta to parse_args_with for #[diagnostic] 2026-01-28 22:18:37 +01:00
Guillaume Gomez
e1417f408e Update askama to 0.15.3 2026-01-28 22:06:18 +01:00
Jonathan Brouwer
aeba7d5607
Rollup merge of #151773 - dianne:cleanup-division-promotion, r=oli-obk
clean up checks for constant promotion of integer division/remainder operations

I found the old logic with matches on `Option`s returned by other matches to be kind of complicated, so I rewrote it with `let` chains. There should be no change in behavior.
2026-01-28 21:10:55 +01:00
Jonathan Brouwer
775abf4f36
Rollup merge of #151449 - GuillaumeGomez:regression-test-for-151411, r=lolbinarycat
[rustdoc] Add regression test for #151411

Fixes rust-lang/rust#151411.

Seems like the ICE was already solved by https://github.com/rust-lang/rust/pull/151255. Well in any case, more regression tests won't hurt.

r? @lolbinarycat
2026-01-28 21:10:54 +01:00
Jonathan Brouwer
e3da016602
Rollup merge of #151779 - folkertdev:stdarch-sync-2026-01-28, r=folkertdev
stdarch subtree update

Subtree update of `stdarch` to 9040e2f62a.

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

r? @ghost
2026-01-28 21:10:53 +01:00
Jonathan Brouwer
3ffbf6e692
Rollup merge of #151769 - Qelxiros:vecdeque_splice_fix, r=joboet
fix undefined behavior in VecDeque::splice

closes rust-lang/rust#151758
2026-01-28 21:10:53 +01:00
Jonathan Brouwer
b841ab20de
Rollup merge of #151706 - PiJoules:fuchsia-nanosleep, r=joboet
Remove Fuchsia from target OS list in unix.rs for sleep

Fuchsia doesn't support clock_nanosleep so default back to using nanosleep
2026-01-28 21:10:52 +01:00
Jonathan Brouwer
b84cf6f790
Rollup merge of #151704 - hoodmane:emscripten-set-output-kind, r=petrochenkov
Implement `set_output_kind` for Emscripten linker

This makes cdylibs compile to working Emscripten dynamic libraries without passing extra RUSTFLAGS. This was previously approved as rust-lang/rust#98358 but there were CI failures that I never got around to fixing.

cc @workingjubilee
2026-01-28 21:10:52 +01:00
Jonathan Brouwer
d0a9dac350
Rollup merge of #151696 - amandasystems:scc-annotations-update, r=lcnr
Borrowck: Simplify SCC annotation computation, placeholder rewriting

This change backports some changes from the now abandoned rust-lang/rust#142623.

Notably, it simplifies the `PlaceholderReachability` `enum` by replacing the case when no placeholders were reached with a standard `Option::None`.

It also rewrites the API for `scc::Annotations` to be update-mut rather than a more Functional programming style. This showed some slight performance impact in early tests of the PR and definitely makes the implementation simpler.

This probably wants a perf run just for good measure.

r? @lcnr
2026-01-28 21:10:51 +01:00
Jonathan Brouwer
1eba55e25d
Rollup merge of #151660 - fmease:bump-backtrace-demangler-alt, r=tgross35
Bump `std`'s `backtrace`'s `rustc-demangle`

Alternative to https://github.com/rust-lang/rust/pull/151659.

Fixes rust-lang/rust#151548.
2026-01-28 21:10:51 +01:00
Jonathan Brouwer
41caa6e22d
Rollup merge of #151493 - Unique-Usman:ua/missinglet, r=estebank
[RFC] rustc_parse: improve the error diagnostic for "missing let in let chain"
2026-01-28 21:10:50 +01:00
Jonathan Brouwer
3f23c0997a
Rollup merge of #150968 - tgross35:remove-no-f16-f128, r=Amanieu
compiler-builtins: Remove the no-f16-f128 feature

This option was used to gate `f16` and `f128` when support across backends and targets was inconsistent. We now have the rustc builtin cfg `target_has_reliable{f16,f128}` which has taken over this usecase. Remove no-f16-f128 since it is now unused and redundant.
2026-01-28 21:10:50 +01:00
Jonathan Brouwer
3787595751
Rollup merge of #150720 - WhyNovaa:diagnostics-impl-fix, r=lcnr
Do not suggest `derive` if there is already an impl

This PR fixes an issue where the compiler would suggest adding `#[derive(Trait)]` even if the struct or enum already implements that trait manually.

Fixes [#146515](https://github.com/rust-lang/rust/issues/146515)
2026-01-28 21:10:49 +01:00
Jonathan Brouwer
8bdd8dc5e1
Rollup merge of #150491 - petrochenkov:ambigeffvis, r=yaahc
resolve: Mark items under exported ambiguous imports as exported

After https://github.com/rust-lang/rust/pull/147984 one of the imports in an ambiguous import set becomes accessible under a deny-by-default deprecation lint.

So if it points to something, that something needs to be marked as exported, so its MIR is encoded into metadata, its symbol is not lost from object files, etc.
The added test shows an example.
This fixes around 10-20 crater regressions found in https://github.com/rust-lang/rust/pull/149195#issuecomment-3641704823.

Unblocks https://github.com/rust-lang/rust/pull/149195.
2026-01-28 21:10:48 +01:00
Ed Page
52d4ef12a8 fix(parser): Disallow CR in frontmatter
T-lang came back on the stabilization PR asking for CR to be disallowed
to leave room for all stray CRs to be rejected in the future.
At that point, the test can remain but the implementation can be
removed.

If that plan does not go through, we'll need to re-evaluate
- whether this is more lint-like and should defer to the calling tool
  that is managing the frontmatter
- how much Rust should treat the frontmatter as Rust and apply the same
  grammar restrictions of "no stray CR" (like raw string literals)
2026-01-28 13:01:02 -06:00
Ed Page
dd5539251c refactor(parse): Use a common frame of reference 2026-01-28 13:01:02 -06:00