Commit Graph

314660 Commits

Author SHA1 Message Date
joboet 7834c43ea6 beautify comment in sys::helpers 2026-01-02 18:32:35 +01:00
joboet fc9f0fbf56 bless UI test referencing outdated paths 2026-01-02 18:32:34 +01:00
joboet d8489c1ea0 std: remove outdated documentation in sys 2026-01-02 18:23:40 +01:00
joboet f4fe287d87 std: update imports of sys::helpers 2026-01-02 18:23:40 +01:00
joboet ae09be5968 std: unify sys::pal::common and sys_common into sys::helpers 2026-01-02 18:23:39 +01:00
bors 8a24a202aa Auto merge of #150534 - Kobzol:dist-test-rustdoc, r=Urgau
Run rustdoc tests in opt-dist tests

Context: https://github.com/rust-lang/rust/issues/150287

try-job: dist-x86_64-linux
2026-01-02 13:12:34 +00:00
bors bf6b5b9ded Auto merge of #150577 - wesleywiser:cleanup_debuginfo_compression, r=mati865
Cleanup `debuginfo_compression` unstable flag

It isn't necessary to declare the option as a top-level flag when it is accessible from `unstable_opts`.

cc rust-lang/rust#120953
2026-01-02 09:57:48 +00:00
bors 1b4325211c Auto merge of #150582 - jhpratt:rollup-3mal3wc, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#150073 (Make `asm_experimental_arch` work in `allow_internal_unstable` macros)
 - rust-lang/rust#150445 (resolve: Preserve binding scopes in ambiguity errors)
 - rust-lang/rust#150580 (Document `panic!` in `Iterator::last` for rust-lang/rust#149707)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-02 05:37:45 +00:00
Jacob Pratt 9c5bdbd960 Rollup merge of #150580 - CieriA:patch-3, r=jhpratt
Document `panic!` in `Iterator::last` for #149707

This PR adds a section `# Panics` to the method `Iterator::last` equal to the section `# Panics` of the method `Iterator::count`, because now, after the changes made in Rust 1.92.0, both methods in `std::iter::Repeat` panics instead of doing an infinite loop.

`Iterator::count` already has documentation for this behavior ("This function might panic if the iterator has more than `usize::MAX` elements."), but `Iterator::last` does not. This PR adds documentation for this panic in the same way as `Iterator::count` does.

Issue: rust-lang/rust#149707
2026-01-01 23:27:56 -05:00
Jacob Pratt 97050d4174 Rollup merge of #150445 - petrochenkov:keepscope, r=nnethercote
resolve: Preserve binding scopes in ambiguity errors

It allows to get rid of `AmbiguityErrorMisc`, `Flags` and `extern_prelude_flag_binding`.

Also keep all encountered bindings in `resolve_ident_in_scope_set`, it allows to get rid of `extern_prelude_item_binding`.

This also unblocks https://github.com/rust-lang/rust/pull/149681 because the newly preserved data will help to fix the regressions in https://github.com/rust-lang/rust/pull/149681#issuecomment-3679059703 in a reasonable way.
2026-01-01 23:27:55 -05:00
Jacob Pratt 57b2e6579a Rollup merge of #150073 - daxpedda:internal-unstable-asm-experimental-arch, r=nnethercote
Make `asm_experimental_arch` work in `allow_internal_unstable` macros

This change makes it possible to use unstable `asm!`, usually requiring `feature(asm_experimental_arch)`, in proc-macros with the `allow_internal_unstable` attribute.

The test was added on a target where `asm!` is unstable: Wasm. However, this affects *any* target with an unstable `asm!` implementation.
2026-01-01 23:27:54 -05:00
Alessio d68c980c22 library: Document panic condition for Iterator::last
Added a `# Panics` section to `Iterator::last` to match `Iterator::count`, after the change made in Rust 1.92.0 where now `std::iter::Repeat` panics in these methods instead of doing an infinite `loop`.

Cites https://github.com/rust-lang/rust/issues/149707
2026-01-02 03:53:02 +01:00
bors a47f4dfd7f Auto merge of #150519 - camelid:mgca-forbid-params-properly, r=BoxyUwU
Use more principled check for generics in const ops

Fixes rust-lang/rust#144547.
Fixes rust-lang/rust#140891.

In the future, we likely want to make the check less likely to be missed by reducing the number of external entry points to HIR type lowering.

Note: If this causes pass->error regressions (not truly regressions because those cases were mistakenly accepted), they can easily be avoided for the time being by only running the check if `is_self_alias` is true or mgca is enabled.

- **Fix parsing of mgca const blocks in array repeat exprs**
- **Use more principled check for generics in const ops**
2026-01-02 02:23:07 +00:00
Noah Lev f71e93821e mgca: Re-merge split out tests
Now that we avoid a fatal error, they can all be one test.
2026-01-01 18:12:34 -08:00
Noah Lev bad0c3230f mgca: Remove resolved FIXME 2026-01-01 18:12:34 -08:00
Noah Lev c7e368543c Use more principled check for generics in const ops
Instead of using a visitor in typeck, we just check, whenever lowering a
use of a param, whether the parent item is an MCG anon const during hir
ty lowering (and instantiate_value_path). If so, we report an error
since MCG anon consts should never be able to use generics. All other
kinds of anon consts are at least syntactically allowed to use generic
params.

We use a `TypeFolder` to accomplish this; this way, we look at the
fully explicit semantic representation of the type/const/whatever and
don't miss subtle cases like `Self` type aliases.
2026-01-01 18:12:34 -08:00
Wesley Wiser f74896fc01 Cleanup debuginfo_compression unstable flag
It isn't necessary to declare the option as a top-level flag when
it is accessible from `unstable_opts`.
2026-01-01 19:30:02 -06:00
bors 056908d7f4 Auto merge of #150575 - JonathanBrouwer:rollup-veh2d0h, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#150382 (Tweak wording of diff marker diagnostic)
 - rust-lang/rust#150431 (test and document that `proc_macro::Ident` is NFC-normalized)
 - rust-lang/rust#150504 (Add regression test for issue rust-lang/rust#99173)
 - rust-lang/rust#150568 (Update triagebot config for `compiler-errors`, `tests/{run-make,run-make-cargo}` and `fallback` adhoc_group)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-01 23:06:37 +00:00
Jonathan Brouwer ecee483ff7 Rollup merge of #150568 - jieyouxu:triagebot-updates, r=Kivooeo
Update triagebot config for `compiler-errors`, `tests/{run-make,run-make-cargo}` and `fallback` adhoc_group

- Commit 1: Updates triagebot entries for `compiler-errors` (context: https://github.com/rust-lang/team/pull/2205)
- Commit 2: Expand `tests/{run-make,run-make-cargo}` reviewer pool to the `compiler` `adhoc_group` instead of just me for weighting reasons, so I don't become the sole assigned reviewer even when I'm off rotation.
- Commit 3: Add myself to `fallback` adhoc_group so there's `n > 1` pool there, in case one of the reviewers go off rotation.
2026-01-02 00:04:08 +01:00
Jonathan Brouwer ed5a529df1 Rollup merge of #150504 - AprilNEA:fix-99173, r=JonathanBrouwer
Add regression test for issue #99173

Close rust-lang/rust#99173.

Adds a regression test for rust-lang/rust#99173, which was an ICE that occurred when a proc-macro generated code that invoked another proc-macro returning an empty `TokenStream`.
2026-01-02 00:04:08 +01:00
Jonathan Brouwer 745368c7d8 Rollup merge of #150431 - cyrgani:nfc-proc-macro-test, r=nnethercote
test and document that `proc_macro::Ident` is NFC-normalized

Previously, this was not tested at all and the test suite would pass even when replacing the `normalize_and_validate_ident` implementation with a `panic!`.
2026-01-02 00:04:07 +01:00
Jonathan Brouwer 21d3df6268 Rollup merge of #150382 - estebank:git-markers-wording, r=nnethercote
Tweak wording of diff marker diagnostic
2026-01-02 00:04:07 +01:00
Jieyou Xu f716d6ca97 triagebot: add jieyouxu to fallback adhoc_group
So that there's `n > 1` selection pool in case one of the eligible
reviewers go off rotation.
2026-01-02 00:51:22 +08:00
Jieyou Xu d7f3c3995c triagebot: expand eligible reviewer pool for tests/{run-make,run-make-cargo} to compiler
So that I don't become the only automatically-assigned reviewer due to
weighting reasons.
2026-01-02 00:41:07 +08:00
Jieyou Xu c71381f55f triagebot: remove compiler-errors triagebot entries
Since they became alumni and don't want to receive pings anymore.
2026-01-02 00:40:58 +08:00
bors fcd630976c Auto merge of #150565 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/cb3bfe8ef402e23fbc0fc9541438eed6bf4294d3.

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

r? `@ghost`
2026-01-01 14:25:01 +00:00
bors cc08b553b8 Auto merge of #150563 - JonathanBrouwer:rollup-9ncjbou, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#150454 (cleanup: move c-variadic arguments handling into compute_inputs_and_output)
 - rust-lang/rust#150529 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-01 11:09:18 +00:00
Jonathan Brouwer cef03a789a Rollup merge of #150529 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/reference

21 commits in ec78de0ffe2f8344bd0e222b17ac7a7d32dc7a26..6363385ac4ebe1763f1e6fb2063c0b1db681a072
2025-12-15 16:17:43 +0000 to 2025-12-31 21:12:35 +0000
- Remove cargo workspace inheritance (rust-lang/reference#2129)
- identifiers: bump Unicode from 16 to 17 (rust-lang/reference#2071)
- Fix alternation order of lexical rules (rust-lang/reference#2126)
- Fix overly greedy digits (rust-lang/reference#2124)
- Clarify UNICODE_ESCAPE valid token value (rust-lang/reference#2123)
- Fix ambiguity of RESERVED_RAW_IDENTIFIER (rust-lang/reference#2122)
- Document how closure capturing interacts with discriminant reads (rust-lang/reference#1837)
- operator-expr: remove stray word in footnote (rust-lang/reference#2118)
- await-expr: add a missing space (rust-lang/reference#2120)
- attributes: add missing punctuation to instruction_set (rust-lang/reference#2117)
- associated-items: add missing periods (rust-lang/reference#2116)
- Move tools into a consolidated cargo workspace (rust-lang/reference#2115)
- Unwrap all of the lexical chapters (rust-lang/reference#2113)
- Unwrap const_eval.md (rust-lang/reference#2112)
- Add section on expansion-time (early) name resolution (rust-lang/reference#2055)
- const_eval.md: add missing word (rust-lang/reference#2068)
- path-expr.md: use a more suitable punctuation (rust-lang/reference#2082)
- items: clarify label for type-aliases documentation (rust-lang/reference#2110)
- do not mix singular and plural (rust-lang/reference#2101)
- external-blocks: add missing "and" in list (rust-lang/reference#2111)
- conditional-compilation: add a space in `cfg.cfg_attr.attribute-list` (rust-lang/reference#2109)

## rust-lang/rust-by-example

2 commits in 7d21279e40e8f0e91c2a22c5148dd2d745aef8b6..2e02f22a10e7eeb758e6aba484f13d0f1988a3e5
2025-12-21 08:47:57 UTC to 2025-12-21 08:46:33 UTC

- docs(comments): improve readability and formatting (rust-lang/rust-by-example#1981)
- Fix HOF.MD sum of odd squares algorithm (rust-lang/rust-by-example#1980)
2026-01-01 12:04:17 +01:00
Jonathan Brouwer 36457ce8f9 Rollup merge of #150454 - tiif:move_variadic, r=oli-obk
cleanup: move c-variadic arguments handling into compute_inputs_and_output

Previously, ``unnormalized_input_tys`` needs to be mutable because the c_variadic arguments are added to ``unnormalized_input_tys`` outside of ``compute_inputs_and_output``. This could have been done together in ``compute_inputs_and_output``.
2026-01-01 12:04:16 +01:00
bors b49c7d784e Auto merge of #150523 - Kivooeo:add-check-for-u8, r=BoxyUwU
add check for `u8`s in `lit_to_const`

Fixes rust-lang/rust#131052

r? BoxyUwU
2026-01-01 07:53:41 +00:00
bors 6e48b44e77 Auto merge of #150559 - JonathanBrouwer:rollup-59hbbmm, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#149778 (`crate::io::Result` → `io::Result` in most places)
 - rust-lang/rust#150264 (split up tracking issue for target feature feature gates)
 - rust-lang/rust#150548 (`region_scope_tree`: Rewrite a `loop` as tail recursion)
 - rust-lang/rust#150555 (Enable thumb interworking on ARMv7A/R and ARMv8R bare-metal targets)

r? `@ghost`
`@rustbot` modify labels: rollup
2026-01-01 04:32:55 +00:00
Kivooeo c6b03ae9b2 add check for u8s and update test 2026-01-01 02:24:05 +00:00
Jonathan Brouwer 767e7dae25 Rollup merge of #150555 - adamgreig:armv7-thumb-interwork, r=chenyukang
Enable thumb interworking on ARMv7A/R and ARMv8R bare-metal targets

This flag enables the `#[instruction_set(arm::t32)]` for the armv7a/armv7r/armv8r targets, which all support Thumb interwork but were missing this flag.

Target maintainers are `@chrisnc,` `@rust-lang/arm-maintainers,` `@rust-embedded/arm` (including me).
2026-01-01 02:47:21 +01:00
Jonathan Brouwer f5803f0610 Rollup merge of #150548 - dianne:temp-scope-extension-loop-rewrite, r=BoxyUwU
`region_scope_tree`: Rewrite a `loop` as tail recursion

This addresses https://github.com/rust-lang/rust/pull/146098#discussion_r2652130775, hopefully making `record_subexpr_extended_temp_scopes` a bit more legible.

I removed a `debug!` in the process, since the function it calls every iteration, [`ScopeTree::record_extended_temp_scope`](https://github.com/rust-lang/rust/blob/2848c2ebe9a8a604cd63455263299d7258bc8252/compiler/rustc_middle/src/middle/region.rs#L264-L271), does the same `debug!`. Keeping the behavior of having an additional `debug!` for the top-level expression would hurt legibility, and having a duplicate `debug!` at each iteration seems excessive. No information is lost from the debug output, so I think it's fine to just have the inner `debug!`s.

r? BoxyUwU or anyone
2026-01-01 02:47:20 +01:00
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 4c62aa4468 Auto merge of #150520 - malbarbo:case_get_unchecked, r=jhpratt
Avoid index check in char::to_lowercase and char::to_uppercase

This generates a panic free code, with is helpful for smaller binary sizes.
2026-01-01 01:15:38 +00: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
rustbot a3d829175a Update books 2025-12-31 13:52:32 -08: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
dianne 6b60e81e8c Rewrite a loop as tail recursion 2025-12-31 08:51:49 -08: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 https://github.com/rust-lang/rust-analyzer/commit/76d44ffb3f86b87771b2bb5e808d42992c1ad745.

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