Commit Graph

323177 Commits

Author SHA1 Message Date
Folkert de Vries ca43552c13 add the mem feature back to compiler-builtins/Cargo.toml
this was removed by accident before, and only discovered now that we're syncing with the main repo
2026-04-23 00:59:32 +02:00
Trevor Gross 90a0227843 support: Update vendored cfg-if to upstream for true and false support
Link: https://github.com/rust-lang/cfg-if/commit/15aec4a67e633254e726bf477b8b86c65687bfc6
2026-04-20 07:08:20 -04:00
Trevor Gross 996b57d5bc test: Fix printing bitwise float reprs in error printing
In commit "test: Consolidate `Hexf`, `Hexi`, and the `Hex` trait" we
unintentionally lost the difference between float hex and bitwise hex
formatting; instead, the float hex was getting printed twice. Resolve
this by printing the integer hex whenever the `-` format modifier is
specified.  This also makes things simpler because we no longer need to
keep track of whether an `impl DisplayHex` is a float with `.to_bits()`
available or an integer without it, we can always just try to print both
forms.

As a result, we can use a common error message for all validation
checks.
2026-04-18 23:51:56 -04:00
Daniel Scherzer 0cc3a7d6fe c-b: add missing word in src/mem/impls.rs docs 2026-04-18 21:42:33 -04:00
Trevor Gross 5d4b1764c1 bench: Use a group with many benches rather than many groups 2026-04-16 18:18:54 -04:00
Spxg dcb70deadf Fix the type of CmpResult on wasm64
resolve rust-lang/compiler-builtins#1199
2026-04-16 17:27:08 -04:00
gamma0987 32ccc13554 fix: Remove duplicate icount_bench_gef128_group in libm-test benches 2026-04-16 14:03:15 -04:00
Trevor Gross c7c1c1a8d0 c-b: Better document where CmpResult comes from 2026-04-16 13:52:11 -04:00
Mend Renovate b61f1716c7 chore(deps): update rust crate gungraun to 0.18.0 2026-04-16 13:44:34 -04:00
Trevor Gross b2877ac70d ci: Exclude update-api-list from libm tests 2026-04-16 05:24:29 -04:00
Mend Renovate fd47f70790 chore(deps): update rust crate rand to v0.10.1 [security] 2026-04-14 01:19:53 -04:00
Trevor Gross 3af9faa6cd test: Move tidy_lists from update-api-list.py to a new crate
This is the first step of migrating `update-api-list.py` to something
that handles the compiler-builtins functions.
2026-04-10 06:30:25 -04:00
Trevor Gross 5c66a58083 hex: Always print a leading + sign and the NaN payload
This is for debugging so always give us all useful output.
2026-04-09 21:02:32 -04:00
Trevor Gross c2c30c9037 hex: Eliminate parser hacks needed for the previous MSRV 2026-04-09 21:02:32 -04:00
Brian Cain a4fe265df0 hexagon: Implement __clear_cache using inline assembly
Implement `__clear_cache` for Hexagon targets in Rust. Hexagon has
separate instruction and data caches, so this flushes dirty data cache
lines with `dccleaninva`, invalidates stale instruction cache lines
with `icinva`, then issues an `isync` barrier.

Based on the compiler-rt implementation from
llvm/llvm-project#188411.
2026-04-09 20:10:55 -04:00
Trevor Gross a6de51188b libm: Add tests against rug for i256 2026-04-09 20:05:51 -04:00
Trevor Gross 06ea8566a1 libm: Add basic tests for u256::shl
Duplicate the shr test style to have a simple check for edge cases.
2026-04-09 20:05:51 -04:00
The rustc-josh-sync Cronjob Bot 6ea1978117 Merge ref 'd0442e2800d3' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@d0442e2800
Filtered ref: rust-lang/compiler-builtins@9ead3e918f
Upstream diff: https://github.com/rust-lang/rust/compare/0e95a0f4c677002a5d4ac5bc59d97885e6f51f71...d0442e2800d356ae282ddcdbe0eff8798fe648b6

This merge was created using https://github.com/rust-lang/josh-sync.
2026-04-09 04:58:31 +00:00
The rustc-josh-sync Cronjob Bot 5fd302043b Prepare for merging from rust-lang/rust
This updates the rust-version file to d0442e2800.
2026-04-09 04:56:10 +00:00
bors d0442e2800 Auto merge of #155011 - JonathanBrouwer:rollup-9GJWM3g, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#154912 (Remove `BuiltinLintDiag`)
 - rust-lang/rust#154598 (test `#[naked]` with `#[link_section = "..."]` on windows)
 - rust-lang/rust#154719 (Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg register classes)
 - rust-lang/rust#154057 (Parenthesize block-like expressions in index base of pretty printer)
 - rust-lang/rust#154893 (make `expected_literal` positive)
 - rust-lang/rust#155002 (Clarify that `core::range` ranges do not have special syntax)
2026-04-08 23:20:07 +00:00
Jonathan Brouwer efa922478b Rollup merge of #155002 - shepmaster:clarify-new-range, r=tgross35
Clarify that `core::range` ranges do not have special syntax

r? @tgross35
2026-04-08 23:04:36 +02:00
Jonathan Brouwer 83e81337ad Rollup merge of #154893 - jdonszelmann:expected-literal-positive, r=JonathanBrouwer
make `expected_literal` positive

r? @JonathanBrouwer
2026-04-08 23:04:36 +02:00
Jonathan Brouwer 8be4c463be Rollup merge of #154057 - aytey:fix-block-index-paren, r=fmease
Parenthesize block-like expressions in index base of pretty printer

The AST pretty printer produces invalid Rust when a block expression is the base of an index operation inside a macro expansion. This is a gap in the parenthesization fix from rust-lang/rust#119105 — the `FixupContext` approach handles statement position but not the case where a block-index is nested inside another expression.

The following is a correct program:

```rust
macro_rules! block_arr {
    () => {{ [0u8; 4] }};
}

macro_rules! as_slice {
    () => {{ &block_arr!()[..] }};
}

fn main() { let _: &[u8] = as_slice!(); }
```

But `rustc -Zunpretty=expanded` produces output that is not valid Rust, because the closing brace of `{ [0u8; 4] }` creates a statement boundary, causing the parser to treat `[..]` as a separate expression:

```rust
fn main() { let _: &[u8] = { &{ [0u8; 4] }[..] }; }
```

```
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `[`
```

Fixed output after this change:

```rust
fn main() { let _: &[u8] = { &({ [0u8; 4] })[..] }; }
```

Since `{ ... }[...]` never parses as indexing a block regardless of context, the fix unconditionally parenthesizes "complete" expressions (block, match, if, loop, etc.) when they appear as the base of an index operation.
2026-04-08 23:04:35 +02:00
Jonathan Brouwer 3fb712c80a Rollup merge of #154719 - androm3da:hexagon-inline-asm-register-classes, r=JohnTitor
Hexagon inline asm: add reg_pair, vreg, vreg_pair, and qreg register classes

Add three new register classes for the Hexagon inline assembly backend:

* `reg_pair`: GPR double registers (r1:0 through r27:26)
* `vreg`: HVX vector registers (v0-v31)
* `qreg`: HVX predicate registers (q0-q3), clobber-only for now
2026-04-08 23:04:34 +02:00
Jonathan Brouwer b040d5493e Rollup merge of #154598 - folkertdev:windows-naked-link-section, r=mati865
test `#[naked]` with `#[link_section = "..."]` on windows

As a part of https://github.com/rust-lang/rust/pull/147811 I ran into that we actually don't match (current) LLVM output.

r? @mati865
2026-04-08 23:04:33 +02:00
Jonathan Brouwer 1d0d17207c Rollup merge of #154912 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Remove `BuiltinLintDiag`

Part of https://github.com/rust-lang/rust/issues/153099.

We're finally getting rid of `BuiltinLintDiag`! \o/

Next step, `AttributeLint`. :3

r? @JonathanBrouwer
2026-04-08 23:04:32 +02:00
bors 9004856428 Auto merge of #153838 - oli-obk:use-tree-span, r=davidtwco
Use fine grained component-wise span tracking in use trees

This often produces nicer spans and even doesn't need a Span field anymore (not that I expect the unused field to affect any perf, but still neat).
2026-04-08 20:09:27 +00:00
Jake Goulding eef4363403 Clarify that core::range::{Range,RangeFrom,RangeToInclusive} do not have special syntax
I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.
2026-04-08 14:05:12 -04:00
Jake Goulding 092f0ca1bd Clarify that core::range::RangeInclusive does not have special syntax
I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.
2026-04-08 14:02:37 -04:00
bors 033b9255d4 Auto merge of #154987 - weihanglo:update-cargo, r=weihanglo
Cargo submodule update

11 commits in a357df4c26fc14514e66aae2a269456b5545c7db..101549dddbd2b08e806f50154e3aa4cb3374cc21
2026-04-03 16:47:15 +0000 to 2026-04-08 12:51:20 +0000
- Never include use extra-filename in build scripts (rust-lang/cargo#16855)
- fix(toml): Force script edition warnings on quiet  (rust-lang/cargo#16848)
- GitHub fast path uses `http_async` (rust-lang/cargo#16847)
- feat(manifest): allow git dependency alongside alternate registry (rust-lang/cargo#16810)
- fix(auth): add auth scheme hint to token rejected error for alt registries (rust-lang/cargo#16794)
- Warn on invalid jobserver file descriptors (rust-lang/cargo#16843)
- docs(unstable): List the minimum required MSRV for 'public' field (rust-lang/cargo#16841)
- feat(lints): Emit unused_dependencies lint (rust-lang/cargo#16600)
- fix(tree): clarify error message when `-i` is used without a package name (rust-lang/cargo#16818)
- fix: Typo in target.<cfg>.linker (rust-lang/cargo#16839)
- Send Content-Type header with cargo publish requests (rust-lang/cargo#16832)

r? ghost
2026-04-08 16:54:41 +00:00
Jana Dönszelmann fbdcd191a9 make expected_literal positive 2026-04-08 16:17:27 +02:00
Jana Dönszelmann 1e8c6f04d4 Nooooo my workflow relied on programs using niko as an identifier
being faster to compile 😭
2026-04-08 16:17:27 +02:00
Weihang Lo a7c49ec700 Cargo submodule update 2026-04-08 10:11:15 -04:00
Andrew V. Teylu 27e3d26dfb rename test 2026-04-08 15:01:38 +01:00
Andrew V. Teylu 56f43b5142 Parenthesize block-like expressions in call callee of pretty printer
When a macro expands to a call whose callee is a block (or other
"complete" expression like `match`, `if`, `loop`), the AST pretty
printer emits the callee without parentheses. In statement position
the closing brace ends the expression and the argument list is parsed
as a separate tuple expression, producing a parse error.
2026-04-08 14:52:01 +01:00
bors c771f6ee80 Auto merge of #154985 - JonathanBrouwer:rollup-a467ECK, r=JonathanBrouwer
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#153995 (Use convergent attribute to funcs for GPU targets)
 - rust-lang/rust#154184 (stabilize s390x vector registers)
 - rust-lang/rust#151898 (constify DoubleEndedIterator)
 - rust-lang/rust#154235 (remove unnecessary variables and delimiter check)
 - rust-lang/rust#154473 (move borrow checker tests)
 - rust-lang/rust#154745 (Replace span_look_ahead with span_followed_by)
 - rust-lang/rust#154778 (make field representing types invariant over the base type)
 - rust-lang/rust#154867 (Fix private fields diagnostics and improve error messages)
 - rust-lang/rust#154879 (Don't store `pattern_ty` in `TestableCase`)
 - rust-lang/rust#154910 (Suppress `unreachable_code` lint in `derive(PartialEq, Clone)`)
 - rust-lang/rust#154923 (Fix ICE in next-solver dyn-compatibility check)
 - rust-lang/rust#154934 (Add getters for `rustc_pattern_analysis::constructor::Slice` fields)
 - rust-lang/rust#154938 (match exhaustiveness: Show the guard exhaustivity note only when it's the guards alone that cause non-exhaustiveness)
 - rust-lang/rust#154961 (Use derived impl for `GappedRange` subdiagnostic)
 - rust-lang/rust#154980 (rustc-dev-guide subtree update)
2026-04-08 13:30:13 +00:00
Jonathan Brouwer aa6dfed2d6 Rollup merge of #154980 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/912f6c606ab85868f773db8ee72605f957103da5.

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

r? @ghost
2026-04-08 14:22:08 +02:00
Jonathan Brouwer 5ef7a3d73f Rollup merge of #154961 - mejrs:yeet_the_fixme, r=Nadrieril
Use derived impl for `GappedRange` subdiagnostic
2026-04-08 14:22:07 +02:00
Jonathan Brouwer 6b8320f4b7 Rollup merge of #154938 - jakubadamw:issue-104653, r=Nadrieril
match exhaustiveness: Show the guard exhaustivity note only when it's the guards alone that cause non-exhaustiveness

Only show the "match arms with guards don't count towards exhaustivity" note when removing all guards would make the match exhaustive, but also in the cases when the match contains arms without guards. Previously, this note was shown only if all arms had guards, but even if the patterns themselves were insufficient to cover all valid values of a type.

Do this by rerunning the exhaustiveness analysis with guards stripped to determine whether the guards are actually the cause of non-exhaustiveness. This only happens on an actual exhaustiveness error, so should not be a performance concern.

This will make a program like:

```rust
fn main() {
    let some_condition = true;
    let some_option: Option<u8> = None;

    let _res = match some_option {
        Some(val) if some_condition => val,
        None => 0,
    };
}
```

produce the note ”match arms with guards don't count towards exhaustivity” that previously would not have been appearing.

Closes rust-lang/rust#104653 as I think this addresses the spirit of that issue. I don’t believe it’s necessary to be any more elaborate in the diagnostics here?
2026-04-08 14:22:06 +02:00
Jonathan Brouwer e1b15f4397 Rollup merge of #154934 - ChayimFriedman2:export-pat-slice, r=Nadrieril
Add getters for `rustc_pattern_analysis::constructor::Slice` fields

rust-analyzer needs that.

r? @Nadrieril
2026-04-08 14:22:05 +02:00
Jonathan Brouwer faefad7c24 Rollup merge of #154923 - cijiugechu:fix-ice-unsafe-binders-next-solver, r=TaKO8Ki
Fix ICE in next-solver dyn-compatibility check

The next solver treated error-containing dispatchability goals as proven and misclassified the trait as dyn compatible. Short-circuit receivers with type errors so object-method confirmation stays on the normal error path.

Tracking issue: rust-lang/rust#130516
Closes: rust-lang/rust#151311
2026-04-08 14:22:05 +02:00
Jonathan Brouwer 839aaee4c3 Rollup merge of #154910 - WaffleLapkin:unreachable-derive, r=nnethercote
Suppress `unreachable_code` lint in `derive(PartialEq, Clone)`

Resolves https://github.com/rust-lang/rust/issues/154900
2026-04-08 14:22:04 +02:00
Jonathan Brouwer 03cf715a05 Rollup merge of #154879 - Zalathar:pattern-ty, r=Nadrieril
Don't store `pattern_ty` in `TestableCase`

This field's only remaining use was in an assertion, but we can perform the same assertion earlier when constructing `TestableCase::Range`.

---

For background, the `pattern_ty` field was introduced in https://github.com/rust-lang/rust/pull/136435 to replace a reference to the full THIR pattern node. Since then, most uses of `pattern_ty` were removed by https://github.com/rust-lang/rust/pull/150238.
2026-04-08 14:22:03 +02:00
Jonathan Brouwer 7300b254cd Rollup merge of #154867 - chenyukang:yukang-fix-151408-private-fields-diagnostic, r=Kivooeo
Fix private fields diagnostics and improve error messages

Fixes rust-lang/rust#151408

while the best solution may be check whether the code is under user's control, e.g. in the same workspace. but if user does not provide some fields, mention other private fields seems weird, see the test case:

```console
LL |     let _ = std::collections::HashMap {};
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: private field `base` that was not provided
```

since we already suggested to use associated function to construct, it's better to remove the note.

this fix only provide note on private fields when `did.is_local()` or user have already provide some fields.
2026-04-08 14:22:03 +02:00
Jonathan Brouwer 532c2b64d8 Rollup merge of #154778 - BennoLossin:frt-invariant, r=oli-obk
make field representing types invariant over the base type

We probably don't want to have any subtype relationship between any FRTs.

Reported-by: @dvdhrm "David Rheinsberg" <david@readahead.eu>
Link: https://rust-for-linux.zulipchat.com/#narrow/channel/288089-General/topic/Multiple.20LockedBy.20with.20Single.20Lock/near/579275908

r? @oli-obk
2026-04-08 14:22:02 +02:00
Jonathan Brouwer 4a3978abad Rollup merge of #154745 - chenyukang:yukang-fix-span-api, r=nnethercote
Replace span_look_ahead with span_followed_by

While reviewing that PR https://github.com/rust-lang/rust/pull/154703#discussion_r3031067780, I found that magic number 100, let's remove it, and seems `span_followed_by` is a better name.
2026-04-08 14:22:01 +02:00
Jonathan Brouwer 4ba9940cfc Rollup merge of #154473 - danieljofficial:move-tests-borrowck, r=Kivooeo
move borrow checker tests

Hi, I have moved some tests I think should be in the borrowck category. Please let me know if there are issues.  r? @Kivooeo
Related to rust-lang/rust#133895
2026-04-08 14:22:00 +02:00
Jonathan Brouwer 404ee74367 Rollup merge of #154235 - bb1yd:simplify-delim-check, r=fmease
remove unnecessary variables and delimiter check

Zulip discussion: https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/question.20about.20lex_token_tree_open_delim.20in.20rustc_parse/with/580552157

In `lex_token_tree_open_delim`, after calling `self.lex_token_trees(/* is_delimited */ true)`:
 - If the delimiters are well-balanced, the value  popped from the stack will always equal to `open_delim` and `pre_span`.
 - If the delimiters are not balanced, `self.lex_token_trees(/* is_delimited */ true)` will return an error so this branch will not be reached

Therefore `open_delimiter` and `open_delimiter_span` can be removed.

Test `tests/ui/parser` all passed
2026-04-08 14:22:00 +02:00
Jonathan Brouwer c8b04b6468 Rollup merge of #151898 - Randl:const-double-iter, r=oli-obk
constify DoubleEndedIterator

The only functions that can't be constified are `advance_back_by` (requires const range or const-hack), `nth_back` (requires `advance_back_by`), and `rfind` (requires const closures).

I've put it under `const_iter`, but I can open a separate tracking issue, though I think tracking all `Iterator` traits separately would be quite annoying, and we probably would prefer to constify them together anyway.
2026-04-08 14:21:59 +02:00
Jonathan Brouwer 3e027ff0f0 Rollup merge of #154184 - folkertdev:stabilize-s390x-vector-registers, r=Amanieu
stabilize s390x vector registers

tracking issue: https://github.com/rust-lang/rust/issues/133416
reference PR: https://github.com/rust-lang/reference/pull/2215

Stabilizes s390x vector registers, e.g.

```rust
unsafe fn vreg_128(x: i128) -> i128 {
    let y;
    asm!("vlr {}, {}", out(vreg) y, in(vreg) x);
    y
}
```

The types that are accepted for vreg registers are

- all float types `f16`,  `f32`, `f64`, `f128`
- integer types `i32`, `i64` and `i128` and their unsigned counterparts
- integer vector types `i8x16`, `i16x8`, `i32x4`, `i64x2` and their unsigned counterparts
- float vector types `f16x8`, `f32x4` and `f64x2`

Support for all of these is tested in https://github.com/rust-lang/rust/blob/main/tests/assembly-llvm/asm/s390x-types.rs, and the types correspond with the LLVM definition in https://github.com/llvm/llvm-project/blob/df9eb79970c012990e829d174d181d575d414efe/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L312-L339

The `f16`, `f16x8` and `f128` types are unstable, and so can't be used on stable in practice. They do show up in some error messages though.

`vreg` was previously only accepted as a clobber.

---

Currently the vector types in `core::arch::s390x` are still unstable. Separately stabilizing `vreg` is still useful because scalar types can also be put into `vreg`s.

## Implementation history

- https://github.com/rust-lang/rust/pull/131664
- https://github.com/rust-lang/rust/pull/150826

cc @uweigand @taiki-e
r? @Amanieu
2026-04-08 14:21:58 +02:00