Commit graph

314605 commits

Author SHA1 Message Date
Jonathan Brouwer
71b17c5c18
Rollup merge of #150264 - RalfJung:target-feature-tracking-split, r=Amanieu
split up tracking issue for target feature feature gates

https://github.com/rust-lang/rust/issues/44839 is tracking too many things at once. We usually have a separate tracking issue for each feature gate, so let's do that here as well:

-  rust-lang/rust#150244
- rust-lang/rust#150245
- rust-lang/rust#150246
- rust-lang/rust#150247
- rust-lang/rust#150248
- rust-lang/rust#150249
- rust-lang/rust#150250
- rust-lang/rust#150251
- rust-lang/rust#150252
- rust-lang/rust#150253
- rust-lang/rust#150254
- rust-lang/rust#150255
- rust-lang/rust#150256
- rust-lang/rust#150257
- rust-lang/rust#150258
- rust-lang/rust#150259
- rust-lang/rust#150260
- rust-lang/rust#150261

Closes https://github.com/rust-lang/rust/issues/44839 in favor of the ones listed above.

r? `@Amanieu`
2026-01-01 02:47:20 +01:00
Jonathan Brouwer
9b89b8814a
Rollup merge of #149778 - tbu-:pr_crate_io_result, r=Mark-Simulacrum
`crate::io::Result` → `io::Result` in most places

I don't know why many places refer to the type as `crate::io::Result` when `crate::io` is already imported.
2026-01-01 02:47:19 +01:00
bors
48622726c4 Auto merge of #150289 - rami3l:dist/rustc-docs-dist-path, r=jieyouxu
fix(bootstrap/dist)!: change dist path for `rustc-docs` to avoid clashing

Closes rust-lang/rust#75833, part of https://github.com/rust-lang/rustup/issues/3717:

> I'd like to know if we can assign another folder name to `rustc-docs`?
> [...]
> [`@ThePuzzlemaker](https://github.com/ThePuzzlemaker)'s` `share/doc/rust/html/nightly-rustc` does look a bit weird to me (`nightly-rustc` has nothing to do with the current `rustc`, i.e. the Rustc Book, but they somehow appear similar just looking at the names).
>
> I personally would like to see something like `share/doc/rust/html/rustc-docs` or `share/doc/rust/html/rustc-api` for this component.
_https://github.com/rust-lang/rust/issues/75833#issuecomment-2002503223_

The TLDR is that currently the "rustc book"'s path clashes with "rustc APIs" (i.e. `rustc-docs`), so we change the path of the latter to make it distributable via rustup.

I'm new to `bootstrap` so please feel free to point out any inconsistencies or any extra work I'll need to do to fully land this somewhat breaking change.
2025-12-31 22:00:15 +00:00
bors
8d670b93d4 Auto merge of #150546 - JonathanBrouwer:rollup-jkqji1j, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146798 (RISC-V: Implement (Zkne or Zknd) intrinsics correctly)
 - rust-lang/rust#150337 (docs: fix typo in std::io::buffered)
 - rust-lang/rust#150530 (Remove `feature(string_deref_patterns)`)
 - rust-lang/rust#150543 (`rust-analyzer` subtree update)
 - rust-lang/rust#150544 (Use --print target-libdir in run-make tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-31 18:42:17 +00:00
Jonathan Brouwer
552918bfcd
Rollup merge of #150544 - bjorn3:run_make_print_target_libdir, r=Urgau,jieyouxu
Use --print target-libdir in run-make tests

This makes the tests more robust against sysroot layout changes and slightly simplifies them.
2025-12-31 17:32:07 +01:00
Jonathan Brouwer
8dc15d2424
Rollup merge of #150543 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 76d44ffb3f.

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

r? `@ghost`
2025-12-31 17:32:06 +01:00
Jonathan Brouwer
15c467ba0c
Rollup merge of #150530 - Zalathar:string-deref-patterns, r=jackh726
Remove `feature(string_deref_patterns)`

The older `string_deref_patterns` feature has been superseded by the newer and more general `deref_patterns` feature. Removing string-deref-patterns allows us to get rid of a few tricky special cases in match lowering, which are different from the special cases used by deref-patterns.

The handful of existing tests for `string_deref_patterns` have been migrated to use `deref_patterns` instead. Current nightly users of the older feature should hopefully be able to migrate to the newer feature without too much trouble.

Note that `deref_patterns` is currently marked as an “incomplete” feature, because it doesn't have an accepted RFC. But `string_deref_patterns` doesn't appear to have ever had an accepted RFC either, so arguably it should have been marked incomplete too.

---
- Tracking issue for both features: https://github.com/rust-lang/rust/issues/87121
- Original implementation: https://github.com/rust-lang/rust/pull/98914
- [Zulip thread: Can we remove `#![feature(string_deref_patterns)]`?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Can.20we.20remove.20.60.23!.5Bfeature.28string_deref_patterns.29.5D.60.3F/with/565787352)
2025-12-31 17:32:06 +01:00
Jonathan Brouwer
f366fa5121
Rollup merge of #150337 - AsakuraMizu:main, r=jhpratt
docs: fix typo in std::io::buffered
2025-12-31 17:32:05 +01:00
Jonathan Brouwer
dc103c4cd9
Rollup merge of #146798 - a4lg:riscv-intrinsics-zkne_or_zknd, r=Amanieu
RISC-V: Implement (Zkne or Zknd) intrinsics correctly

On rust-lang/stdarch#1765, it has been pointed out that two RISC-V (64-bit only) intrinsics to perform AES key scheduling have wrong target feature.
`aes64ks1i` and `aes64ks2` instructions require *either* Zkne (scalar cryptography: AES encryption) or Zknd (scalar cryptography: AES decryption) extension (or both) but corresponding Rust intrinsics (in `core::arch::riscv64`) required *both* Zkne and Zknd extensions.

An excerpt from the original intrinsics:

```rust
#[target_feature(enable = "zkne", enable = "zknd")]
```

To fix that, we need to:

1.  Represent a condition where *either* Zkne or Zknd is available and
2.  Workaround an issue: `llvm.riscv.aes64ks1i` / `llvm.riscv.aes64ks2` LLVM intrinsics require either Zkne or Zknd extension.

This PR attempts to resolve them by:

1.  Adding a perma-unstable RISC-V target feature: `zkne_or_zknd` (implied from both `zkne` and `zknd`) and
2.  Using inline assembly to construct machine code directly (because `zkne_or_zknd` alone cannot imply neither Zkne nor Zknd, we cannot use LLVM intrinsics).

The author confirmed that we can construct an AES key scheduling function with decent performance using fixed `aes64ks1i` and `aes64ks2` intrinsics (with optimization enabled).
2025-12-31 17:32:04 +01:00
bors
a2bc948b7f Auto merge of #150542 - JonathanBrouwer:rollup-3fjgrji, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150193 (Port `#[instruction_set]` to attribute parser)
 - rust-lang/rust#150511 (Allow inline calls to offload intrinsic)
 - rust-lang/rust#150539 (Corretly link URL in internal Windows docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-31 15:26:49 +00:00
bjorn3
1a4e7f9aa9 Use --print target-libdir in run-make tests
This makes the tests more robust against sysroot layout changes and
slightly simplifies them.
2025-12-31 15:15:28 +00:00
Jonathan Brouwer
a7113d74eb
Rollup merge of #150539 - Noratrieb:mark-it-down, r=ChrisDenton
Corretly link URL in internal Windows docs

```
warning: this URL is not a hyperlink
   --> library/std/src/sys/pal/windows/mod.rs:337:5
    |
337 | /// https://docs.microsoft.com/en-us/cpp/intrinsics/fastfail
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: bare URLs are not automatically turned into clickable links
    = note: `#[warn(rustdoc::bare_urls)]` on by default
help: use an automatic link instead
    |
337 | /// <https://docs.microsoft.com/en-us/cpp/intrinsics/fastfail>
    |     +                                                        +
```
2025-12-31 14:30:48 +01:00
Jonathan Brouwer
d898dccc21
Rollup merge of #150511 - Sa4dUs:offload-inline, r=ZuseZ4
Allow inline calls to offload intrinsic

Removes explicit insertion point handling and recovers the pointer at the end of the saved basic block.

r? `@ZuseZ4`

fixes: https://github.com/rust-lang/rust/issues/150413
2025-12-31 14:30:48 +01:00
Jonathan Brouwer
5183d8f15d
Rollup merge of #150193 - Bryntet:parse_instruction_set, r=JonathanBrouwer
Port `#[instruction_set]` to attribute parser

Please note the test changes, and deprecation of `E0778` and `E0779`

In my opinion, all errors related to this attribute are improved I think, except for if you have `#[instruction_set(arm::)]` in which case there's an `error: expected identifier, found <eof>`, which is quite unhelpful I think, but this seems to be a limitation of the general attribute parsing flow

r? `@JonathanBrouwer`
2025-12-31 14:30:47 +01:00
Noratrieb
4e90a96542 Corretly link URL in internal Windows docs
```
warning: this URL is not a hyperlink
   --> library/std/src/sys/pal/windows/mod.rs:337:5
    |
337 | /// https://docs.microsoft.com/en-us/cpp/intrinsics/fastfail
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: bare URLs are not automatically turned into clickable links
    = note: `#[warn(rustdoc::bare_urls)]` on by default
help: use an automatic link instead
    |
337 | /// <https://docs.microsoft.com/en-us/cpp/intrinsics/fastfail>
    |     +                                                        +
```
2025-12-31 13:54:03 +01:00
Marcelo Domínguez
41a24c4b58 Add offload test for control flow handling 2025-12-31 13:11:28 +01:00
Marcelo Domínguez
9d8b4cc70d Restore builder at the end of saved bb 2025-12-31 13:10:29 +01:00
bors
2848c2ebe9 Auto merge of #147361 - saethlin:fallible-cycle-detection, r=oli-obk
Make inliner cycle detection a fallible process

The query `mir_callgraph_cyclic` is supposed to find _all_ callees that _may_ lead to a recursive call back to the given `LocalDefId`. But that query was built using a function which recurses through the call graph and tries to locally handle hitting the recursion limit during the walk. That is wrong. If the recursion limit is encountered, the set may be incomplete and thus useless. If we hit the recursion limit the only correct thing to do is bail.

Some benchmarks improve because for some functions we will bail out of the call graph walk faster. Some benchmarks regress because we do less inlining, but that is quite rare with the default recursion depth.

Originally I thought this might be a fix for https://github.com/rust-lang/rust/issues/131960, but it turns out that it is _actually_ a fix for https://github.com/rust-lang/rust/issues/146998.
2025-12-31 10:05:42 +00:00
Chayim Refael Friedman
6d0f23cbdc
Merge pull request #21375 from A4-Tacks/impl-trait-target-and-dyn-hint
Fix incorrect dyn hint in `impl Trait for`
2025-12-31 08:30:52 +00:00
A4-Tacks
c19e9ecdd9
Fix incorrect dyn hint in impl Trait for
Example
---
```rust
trait T {}
impl T for {}
```

**Before this PR**

```rust
trait T {}
impl T for {}
  // ^ dyn
```

**After this PR**

```rust
trait T {}
impl T for {}
```
2025-12-31 16:18:33 +08:00
Lukas Wirth
5bb8d5d1e3
Merge pull request #21370 from ChayimFriedman2/macro-brace-style
feat: Add #[rust_analyzer::macro_style()] attribute to control macro completion brace style
2025-12-31 07:39:54 +00:00
bors
629b092f8f Auto merge of #150525 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

9 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..b54051b1505281ec7a45a250140a0ff25d33f319
2025-12-26 19:39:15 +0000 to 2025-12-30 20:35:52 +0000
- fix(log): add `dependencies` field to `UnitRegistered` (rust-lang/cargo#16448)
- Implement fine grain locking for `build-dir` (rust-lang/cargo#16155)
- feat(resolver): List features when no close match (rust-lang/cargo#16445)
- feat(report): new command `cargo report sessions` (rust-lang/cargo#16428)
- feat (patch): Display where the patch was defined in patch-related error messages (rust-lang/cargo#16407)
- test(build-rs): Reduce from 'build' to 'check' where possible (rust-lang/cargo#16444)
- feat(toml): TOML 1.1 parse support (rust-lang/cargo#16415)
- feat(report): support --manifest-path in `cargo report timings` (rust-lang/cargo#16441)
- fix(vendor): recursively filter git files in subdirectories (rust-lang/cargo#16439)

r? ghost
2025-12-31 06:49:05 +00:00
Chayim Refael Friedman
a5e6198e70
Merge pull request #21374 from Jefffrey/excuse-non-camel-case-repr-c
fix: don't fire `non_camel_case_types` lint for structs/enums marked with `repr(C)`
2025-12-31 06:43:17 +00:00
Jefffrey
935e3cbb86 fix: don't fire non_camel_case_types lint for structs/enums marked with repr(C) 2025-12-31 15:29:51 +09:00
Zalathar
ef8d943ecd Remove feature(string_deref_patterns) 2025-12-31 14:21:38 +11:00
Ben Kimock
cee7f5ed31 Add a regression test 2025-12-30 22:21:03 -05:00
bors
ab32c26b49 Auto merge of #150516 - Ayush1325:uefi-fs-readdir-fix, r=jhpratt
std: sys: fs: uefi: Ignore "." and ".." when reading directory

- At least in Unix, "." and ".." are not returned as a directory entry. So ignore these in UEFI as well.
- Will also allow using the `remove_dir_all` implementation from `sys/fs/common`.
2025-12-31 03:13:08 +00:00
Ben Kimock
74e0a9aa81 Make inliner cycle detection a fallible process 2025-12-30 22:01:49 -05:00
Edvin Bryntesson
acd6ba4edb
Port #[instruction_set] to attribute parser 2025-12-31 03:01:05 +01:00
bors
94f8f4083e Auto merge of #150526 - JonathanBrouwer:rollup-j9hy7fm, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150058 (Enable file locking support for Hurd)
 - rust-lang/rust#150420 (Do not spill operand debuginfo to stack for AArch64 SVE predicates `<vscale x N x i1>` where `N != 16`)
 - rust-lang/rust#150501 (Fix Typos in Platform Support Tables)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-30 22:40:16 +00:00
Jonathan Brouwer
342a1acb71
Rollup merge of #150501 - qb42:patch-1, r=workingjubilee
Fix Typos in Platform Support Tables

3 recently demoted targets had their entries moved to the tier 3 table without adjusting for the extra "host" column, this PR adds an empty column so they display correctly.

2 recently promoted targets had the opposite problem, also fixed.

While doing that I noticed that empty columns were represented inconsistently throughout the file so I normalized them all to be 2 spaces, which seemed to be the majority opinion (139 instances vs 5 for 1 space and 19 for 3 spaces).

Closes: rust-lang/rust#150499
2025-12-30 23:27:45 +01:00
Jonathan Brouwer
4b49c9f9d8
Rollup merge of #150420 - h3fang:sve-debuginfo-fix, r=workingjubilee
Do not spill operand debuginfo to stack for AArch64 SVE predicates `<vscale x N x i1>` where `N != 16`

This pull request tries to fix rust-lang/rust#150419.

The debuginfo for AArch64 SVE predicates `<vscale x N x i1>` where `N != 16` should be ignored by this [commit](https://github.com/rust-lang/rust/pull/143924/changes/89eea57594e3e1d8e618dd530ea1c8e7c9b4c7a4).

89eea57594/compiler/rustc_codegen_ssa/src/mir/debuginfo.rs (L438-L452)

But in line 446, the `marker_type.kind()` is `ty::Bool` instead of `ty::Slice`, so the code doesn't work as intended.

This pull request uses the [`Ty::scalable_vector_element_count_and_type`](https://github.com/rust-lang/rust/blob/main/compiler/rustc_middle/src/ty/sty.rs#L1272) method to fix the condition checks for  `<vscale x N x i1>` where `N != 16` and add a compiletest for this case.
2025-12-30 23:27:44 +01:00
Jonathan Brouwer
de16c1aa4c
Rollup merge of #150058 - Fabian-Gruenbichler:main, r=workingjubilee
Enable file locking support for Hurd

like Illumos (rust-lang/rust#148322) and aix (rust-lang/rust#148619), Hurd was missed when originally
introducing locking gates per target OS in rust-lang/rust#132977. building rustc on Hurd was
broken as a result since 1.91.
2025-12-30 23:27:44 +01:00
Weihang Lo
62d19109c8
Update cargo submodule 2025-12-30 17:05:59 -05:00
Chayim Refael Friedman
df998811ce Adapt macros in rust-analyzer to new attribute
`match_ast!` cannot be ported because of a weird compiler bug: https://github.com/rust-lang/rust/issues/150518.
2025-12-30 22:44:23 +02:00
Chayim Refael Friedman
975aa0dc8a Add #[rust_analyzer::macro_style()] attribute to control macro completion brace style 2025-12-30 22:44:18 +02:00
bors
0e89999425 Auto merge of #147247 - Qelxiros:vecdeque_splice, r=Mark-Simulacrum
add VecDeque::splice

Tracking issue: rust-lang/rust#146975
2025-12-30 19:18:37 +00:00
Ayush Singh
c2fc43c7a2
std: sys: fs: uefi: Ignore "." and ".." when reading directory
At least in Unix, "." and ".." are not returned as a directory entry. So
ignore these in UEFI as well.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-12-30 23:05:36 +05:30
bors
f0864c89ea Auto merge of #150512 - JonathanBrouwer:rollup-a3xpskp, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#150422 (mir_build: Add a `SliceLenOp` enum for use by slice-length cases/tests)
 - rust-lang/rust#150509 (Adds a regression test for rust-lang/rust#137823)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-30 14:42:58 +00:00
Jonathan Brouwer
4b6f783e32
Rollup merge of #150509 - AprilNEA:fix-137823, r=petrochenkov
Adds a regression test for #137823

Adds a regression test for rust-lang/rust#137823. The test ensures that recursive generic function instantiation properly triggers the recursion limit error instead of ICE-ing with `type variables should not be hashed`.

Closes rust-lang/rust#137823
2025-12-30 15:06:17 +01:00
Jonathan Brouwer
e9d1e57767
Rollup merge of #150422 - Zalathar:slice-len, r=Nadrieril
mir_build: Add a `SliceLenOp` enum for use by slice-length cases/tests

The main change in this PR introduces a `SliceLenOp` enum, to be used by the enum variants for slice-length tests in match lowering.

Slice-length tests must distinguish between `==` tests, and `>=` tests. The existing code represents this distinction with either a boolean (in `TestableCase`) or a `mir::BinOp` (in `TestKind`). Using a dedicated enum makes it easier to see what the two possible values represent.

This PR also includes a few relevant cleanups that would otherwise conflict.

r? Nadrieril
2025-12-30 15:06:16 +01:00
AprilNEA
36f86f9e6a
Adds a regression test for 137823 2025-12-30 19:52:02 +08:00
bors
15f7c553a3 Auto merge of #150503 - JonathanBrouwer:rollup-15nukr5, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#150239 (Simplify `TypeFreshener` methods.)
 - rust-lang/rust#150344 (Cleanup linked list)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-30 11:20:56 +00:00
Chayim Refael Friedman
c24dff6682
Merge pull request #21363 from ChayimFriedman2/compress-spans-real
perf: Compress token trees for best memory usage
2025-12-30 11:07:12 +00:00
Chayim Refael Friedman
9508cd1cb7 Compress token trees for best memory usage 2025-12-30 12:56:56 +02:00
Jonathan Brouwer
596e1e3f88
Rollup merge of #150344 - hkBst:cleanup-linked-list, r=jhpratt
Cleanup linked list

 - Replaces some checked_sub().unwrap_or(0) with saturating_sub().
 - Replaces NonNull::from(Box::leak(node)) with Box::into_non_null(node)
2025-12-30 10:42:28 +01:00
Jonathan Brouwer
be715d4685
Rollup merge of #150239 - nnethercote:simplify-TypeFreshener-methods, r=lcnr
Simplify `TypeFreshener` methods.

`freshen_{ty,const}` take a `Result` and just do a fold if the input is `Ok`. It's simpler to do those folds at the call site, and only call `freshen_{ty,const}` in the `Err` case. That way we can also avoid useless fold operations on the results of `new_{int,uint,float}`.

Also, make some `bug!` calls more concise.

r? `@lcnr`
2025-12-30 10:42:27 +01:00
Lukas Wirth
3d9856d950
Merge pull request #21367 from ChayimFriedman2/upvars
fix: Have an `upvars_mentioned()` query that only computes what upvars a closure captures
2025-12-30 09:00:13 +00:00
bors
d465f99043 Auto merge of #150500 - jhpratt:rollup-ei77kqi, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#146792 (Implement `TryFrom<char>` for `usize`.)
 - rust-lang/rust#150484 (Mark set_times as unavailable for RTEMS target)
 - rust-lang/rust#150498 (mir_build: Remove several remnants of `#![feature(inline_const_pat)]`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-30 08:02:56 +00:00
qb42
841091b846
Remove extra columns from promoted targets 2025-12-30 06:44:28 +00:00