Commit Graph

298223 Commits

Author SHA1 Message Date
Kurt Heiritz (pseudo)
09295af867 Add Sub, Mul, Div, Rem as const_traits 2025-06-25 17:41:27 +05:30
bors
2801f9aaf9 Auto merge of #142746 - compiler-errors:super-implied-outlives, r=lcnr
Apply `impl_super_outlives` optimization to new trait solver

I never did rust-lang/rust#128746 for the new solver.

r? lcnr
2025-06-25 10:10:21 +00:00
Jubilee Young
c24914ec83 compiler: fussily sort the huge AbiMap match 2025-06-25 01:20:14 -07:00
Jubilee Young
087dabfca7 Sprinkle breadcrumbs around to lead people to the rust-invalid ABI 2025-06-25 00:54:02 -07:00
Jubilee Young
78652b783d tests: specify why extern "rust-invalid" cannot be used in varargs test 2025-06-25 00:54:02 -07:00
Jubilee Young
12d05d868f tests: migrate unsupported-abi-transmute.rs to extern "rust-invalid" 2025-06-25 00:54:02 -07:00
Jubilee Young
586a9d1c25 tests: split out unsupported-in-impls.rs
The cross-build megatest gets extremely conflict-prone, so
start cutting it into smaller pieces.
2025-06-25 00:54:02 -07:00
Jubilee Young
3beed38ef6 unstable-book: Update cmse feature descriptions 2025-06-25 00:52:11 -07:00
Jubilee Young
9cfee735f4 move unstable book page and account for it 2025-06-25 00:52:11 -07:00
Jubilee Young
02a00dfbe4 tests: bless s/C-cmse/cmse/ 2025-06-25 00:52:11 -07:00
Jubilee Young
1400e2d9f5 tests: s/C-cmse/cmse/ 2025-06-25 00:52:10 -07:00
Jubilee Young
383d76106b compiler: Trim the misleading C of C-cmse from errors 2025-06-25 00:52:10 -07:00
Jubilee Young
4bdf1c574a compiler: remove misleading 'c' from abi_c_cmse_nonsecure_call feature 2025-06-25 00:52:10 -07:00
Jubilee Young
35deb5bce4 compiler: Trim the misleading C from ExternAbi::CCmse* 2025-06-25 00:52:09 -07:00
Jakub Beránek
e69c0231f0 Apply review comments 2025-06-25 07:58:05 +02:00
bit-aloo
f908939630 rename run_always to run_in_dry_run 2025-06-25 11:26:53 +05:30
bors
a17780db7b Auto merge of #142997 - workingjubilee:rollup-6lxec87, r=workingjubilee
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#135731 (Implement parsing of pinned borrows)
 - rust-lang/rust#138780 (Add `#[loop_match]` for improved DFA codegen)
 - rust-lang/rust#142453 (Windows: make `read_dir` stop iterating after the first error is encountered)
 - rust-lang/rust#142633 (Error on invalid signatures for interrupt ABIs)
 - rust-lang/rust#142768 (Avoid a bitcast FFI call in transmuting)
 - rust-lang/rust#142825 (Port `#[track_caller]` to the new attribute system)
 - rust-lang/rust#142844 (Enable short-ice for Windows)
 - rust-lang/rust#142934 (Tweak `-Zmacro-stats` measurement.)
 - rust-lang/rust#142955 (Couple of test suite fixes for cg_clif)
 - rust-lang/rust#142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠)
 - rust-lang/rust#142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect)
 - rust-lang/rust#142982 (Corrected spelling mistake in c_str.rs)
 - rust-lang/rust#142983 (Taint body on invalid call ABI)
 - rust-lang/rust#142988 (Update wasm-component-ld to 0.5.14)
 - rust-lang/rust#142993 (Update cargo)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-25 04:05:47 +00:00
Jubilee
2d73e6c6fe Rollup merge of #142993 - ehuss:update-cargo, r=ehuss
Update cargo

2 commits in 84709f085062cbf3c51fa507527c1b2334015178..409fed7dc1553d49cb9a8c0637d12d65571346ce
2025-06-22 23:58:39 +0000 to 2025-06-23 15:55:04 +0000
- Fix potential deadlock in `CacheState::lock` (rust-lang/cargo#15698)
- feat(toml): Parse support for multiple build scripts (rust-lang/cargo#15630)
2025-06-24 19:45:37 -07:00
Jubilee
1d4955461b Rollup merge of #142988 - alexcrichton:update-wasm-component-ld, r=Mark-Simulacrum
Update wasm-component-ld to 0.5.14

This brings in a few updates to the bundled `wasm-component-ld` dependency used by the `wasm32-wasip2` target. This primarily includes support for upcoming component model async/WASIp3 support which will be convenient to have native support for a few months from now.
2025-06-24 19:45:36 -07:00
Jubilee
0f77e836c6 Rollup merge of #142983 - compiler-errors:taint-invalid-call-abi, r=workingjubilee
Taint body on invalid call ABI

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

I'm not certain if there are any other paths that should be tainted, but they would operate similarly. Perhaps pointer coercion.

Introduces `extern "rust-invalid"` for testing purposes.

r? ```@workingjubilee``` or ```@oli-obk``` (or anyone)
2025-06-24 19:45:36 -07:00
Jubilee
d392e8803b Rollup merge of #142982 - MetaNova:patch-1, r=jhpratt
Corrected spelling mistake in c_str.rs

Changed "you're" to "your" on line 470.
2025-06-24 19:45:35 -07:00
Jubilee
ced61092ac Rollup merge of #142980 - shepmaster:mismatched-syntaxes-multi-suggestions, r=ehuss
Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect

`cargo fix` does not have a way of distinguishing a suggestion with
multiple spans which should all be applied from multiple suggestions
where only one should be applied (see rust-lang/rust#53934). `cargo fix` only works
with `MachineApplicable` suggestions, so downgrading the applicability
will stop `cargo` from suggesting the user run `cargo
fix`. rust-analyzer does work with `MaybeIncorrect`, so interactive
fixes are still available.

r? `@ehuss`
2025-06-24 19:45:35 -07:00
Jubilee
c3816350ef Rollup merge of #142977 - aDotInTheVoid:rustdochtml-targetfeature, r=GuillaumeGomez
rustdoc: Don't mark `#[target_feature]` functions as ⚠

Closes https://github.com/rust-lang/rust/issues/142952
2025-06-24 19:45:34 -07:00
Jubilee
c062c495a0 Rollup merge of #142955 - bjorn3:cg_clif_test_fixes, r=jieyouxu
Couple of test suite fixes for cg_clif

Most of these are required for getting the test suite running with panic=unwind for cg_clif.
2025-06-24 19:45:34 -07:00
Jubilee
b5631095cd Rollup merge of #142934 - nnethercote:tweak-macro-stats, r=petrochenkov
Tweak `-Zmacro-stats` measurement.

It currently reports net size, i.e. size(output) - size(input). After some use I think this is sub-optimal, and it's better to just report size(output). Because for derive macros the input size is always 1, and for attribute macros it's almost always 1.

r? ```@petrochenkov```
2025-06-24 19:45:33 -07:00
Jubilee
4af75b24e4 Rollup merge of #142844 - dpaoliello:short-ice, r=jieyouxu
Enable short-ice for Windows

Works fine for x64 without modifications.

x86 MSVC is still failing.

Addresses item in rust-lang/rust#128602

---

try-job: x86_64-mingw-*
try-job: x86_64-msvc-*
try-job: i686-msvc-*
2025-06-24 19:45:32 -07:00
Jubilee
2ad6272649 Rollup merge of #142825 - jdonszelmann:track-caller, r=oli-obk
Port `#[track_caller]` to the new attribute system

r? ``@oli-obk``

depends on https://github.com/rust-lang/rust/pull/142493

Closes rust-lang/rust#142783

(didn't add a test for this, this situation should simply never come up again, the code was simply wrong. lmk if I should add it, but it won't test something very useful)
2025-06-24 19:45:32 -07:00
Jubilee
adaf340455 Rollup merge of #142768 - scottmcm:avoid-unneeded-bitcast, r=WaffleLapkin
Avoid a bitcast FFI call in transmuting

For things that only change the valid ranges, we can just return the input, rather than making the `LLVMBuildBitCast` call and having *it* then do nothing.

I tried to tweak this a bit more and broke stuff, so I also added some extra tests for that as we apparently didn't have coverage.
2025-06-24 19:45:31 -07:00
Jubilee
891dc0fb09 Rollup merge of #142633 - folkertdev:interrupt-abi-restrict-signature, r=workingjubilee
Error on invalid signatures for interrupt ABIs

We recently added `extern "custom"`, which must have type `fn()`. The various `extern "interrupt"` ABIs impose similar constraints on the signature of functions with that ABI: `x86-interrupt` should not have a return type (linting on the exact argument types is left as future work), and the other interrupt ABIs cannot have any parameters or a return type.

r? ```@workingjubilee```
2025-06-24 19:45:31 -07:00
Jubilee
d46903b2b6 Rollup merge of #142453 - ChrisDenton:fused, r=Amanieu
Windows: make `read_dir` stop iterating after the first error is encountered

This also essentially makes the `ReadDir` iterator fused. Which I think is pretty much what people expect anyway.

[`FindNextFileW`](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findnextfilew) doesn't document what happens if you call it after iteration ends or after an error so we're probably in implementation defined territory at that point.
2025-06-24 19:45:30 -07:00
Jubilee
f542909d1c Rollup merge of #138780 - trifectatechfoundation:loop_match_attr, r=oli-obk,traviscross
Add `#[loop_match]` for improved DFA codegen

tracking issue: https://github.com/rust-lang/rust/issues/132306
project goal: https://github.com/rust-lang/rust-project-goals/issues/258

This PR adds the `#[loop_match]` attribute, which aims to improve code generation for state machines. For some (very exciting) benchmarks, see https://github.com/rust-lang/rust-project-goals/issues/258#issuecomment-2732965199

Currently, a very restricted syntax pattern is accepted. We'd like to get feedback and merge this now before we go too far in a direction that others have concerns with.

## current state

We accept code that looks like this

```rust
#[loop_match]
loop {
    state = 'blk: {
        match state {
            State::A => {
                #[const_continue]
                break 'blk State::B
            }
            State::B => { /* ... */ }
            /* ... */
        }
    }
}
```

- a loop should have the same semantics with and without `#[loop_match]`: normal `continue` and `break` continue to work
- `#[const_continue]` is only allowed in loops annotated with `#[loop_match]`
- the loop body needs to have this particular shape (a single assignment to the match scrutinee, with the body a labelled block containing just a match)

## future work

- perform const evaluation on the `break` value
- support more state/scrutinee types

## maybe future work

- allow `continue 'label value` syntax, which `#[const_continue]` could then use.
- allow the match to be on an arbitrary expression (e.g. `State::Initial`)
- attempt to also optimize `break`/`continue` expressions that are not marked with `#[const_continue]`

r? ``@traviscross``
2025-06-24 19:45:30 -07:00
Jubilee
4f477427b8 Rollup merge of #135731 - frank-king:feature/pin-borrow, r=eholk,traviscross
Implement parsing of pinned borrows

This PR implements part of #130494.

EDIT: It introduces `&pin mut $place` and `&pin const $place` as sugars for `std::pin::pin!($place)` and its shared reference equivalent, except that `$place` will not be moved when borrowing. The borrow check will be in charge of enforcing places cannot be moved or mutably borrowed since being pinned till dropped.

### Implementation steps:
- [x] parse the `&pin mut $place` and `&pin const $place` syntaxes
- [ ] borrowck of `&pin mut|const`
- [ ] support autoref of `&pin mut|const` when needed
2025-06-24 19:45:29 -07:00
Karan Janthe
7b1c89f2b5 added PrintTAFn flag for autodiff
Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-06-25 02:11:29 +00:00
Karan Janthe
066ae4cf98 submodule update
Signed-off-by: Karan Janthe <karanjanthe@gmail.com>
2025-06-25 02:11:29 +00:00
bors
2c2bb995af Auto merge of #140999 - hkBst:update-escaper, r=nnethercote
update to literal-escaper 0.0.4 for better API without `unreachable` and faster string parsing

This is the replacement for just the part of https://github.com/rust-lang/rust/pull/138163 dealing with the changed API of unescape functionality, since that got moved into its own crate.

<del>This uses an unpublished version of literal-escaper (https://github.com/rust-lang/literal-escaper/pull/8).</del>

r? `@nnethercote`
2025-06-25 01:03:30 +00:00
Eric Huss
041fbe8543 Update cargo 2025-06-24 17:21:19 -07:00
Alex Crichton
4a112db96b Update wasm-component-ld to 0.5.14
This brings in a few updates to the bundled `wasm-component-ld`
dependency used by the `wasm32-wasip2` target. This primarily includes
support for upcoming component model async/WASIp3 support which will be
convenient to have native support for a few months from now.
2025-06-24 15:59:35 -07:00
Michael Goulet
e776065164 Taint body on invalid call ABI 2025-06-24 22:43:00 +00:00
Michael Goulet
e245570def Add rust-invalid ABI 2025-06-24 22:34:30 +00:00
bors
3de5b08ef6 Auto merge of #142979 - matthiaskrgr:rollup-szqah4e, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#142645 (Also emit suggestions for usages in the `non_upper_case_globals` lint)
 - rust-lang/rust#142657 (mbe: Clean up code with non-optional `NonterminalKind`)
 - rust-lang/rust#142799 (rustc_session: Add a structure for keeping both explicit and default sysroots)
 - rust-lang/rust#142805 (Emit a single error when importing a path with `_`)
 - rust-lang/rust#142882 (Lazy init diagnostics-only local_names in borrowck)
 - rust-lang/rust#142883 (Add impl_trait_in_bindings tests from rust-lang/rust#61773)
 - rust-lang/rust#142943 (Don't include current rustc version string in feature removed help)
 - rust-lang/rust#142965 ([RTE-497] Ignore `c-link-to-rust-va-list-fn` test on SGX platform)
 - rust-lang/rust#142972 (Add a missing mailmap entry)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-24 21:58:31 +00:00
Daniel Paoliello
4c7f0549ba Enable short-ice for Windows 2025-06-24 14:16:23 -07:00
Jana Dönszelmann
f9cdf3fd74 fix 142783 2025-06-24 23:00:31 +02:00
Jana Dönszelmann
40a33af0f3 fix clippy 2025-06-24 23:00:31 +02:00
Jana Dönszelmann
5d44fdd972 Rewrite #[track_caller] 2025-06-24 23:00:31 +02:00
MetaNova
1080b571ec Corrected spelling mistake in c_str.rs
Changed "you're" to "your" on line 470.
2025-06-24 15:30:32 -04:00
Alona Enraght-Moony
84f92f3211 rustdoc: Don't mark #[target_feature] functions as ⚠
Closes https://www.github.com/rust-lang/rust/issues/142952
2025-06-24 18:55:45 +00:00
Jake Goulding
46e9d2f9fc Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect
`cargo fix` does not have a way of distinguishing a suggestion with
multiple spans which should all be applied from multiple suggestions
where only one should be applied (see issue 53934). `cargo fix` only
works with `MachineApplicable` suggestions, so downgrading the
applicability will stop `cargo` from suggesting the user run `cargo
fix`. rust-analyzer does work with `MaybeIncorrect`, so interactive
fixes are still available.
2025-06-24 14:53:22 -04:00
bors
28f1c80791 Auto merge of #142959 - bjorn3:sync_cg_clif-2025-06-24, r=bjorn3
Subtree sync for rustc_codegen_cranelift

The main highlight this time is a Cranelift update.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2025-06-24 18:48:12 +00:00
Matthias Krüger
f299456597 Rollup merge of #142972 - tgross35:dwood-mailmap, r=davidtwco
Add a missing mailmap entry

There aren't too many commits with the new emails, but per https://github.com/rust-lang/rust/pull/142470#issuecomment-3000079137 they belong to the same person so we may as well map them.
2025-06-24 20:46:07 +02:00
Matthias Krüger
0089095331 Rollup merge of #142965 - raoulstrackx:raoul/rte-497-fix_c-link-to-rust-va-list-fn_test, r=jieyouxu
[RTE-497] Ignore `c-link-to-rust-va-list-fn` test on SGX platform

rust-lang/rust#141856 enables using the runner defined in bootstrap.toml to execute run-make tests. A test was added for this feature that compiles a Rust library and C code, links them together and passes the result to the runner. Unfortunately, that's not sufficient for the SGX platform; x86 machine code cannot be directly executed. This PR fixes the issue by disabling this test for SGX.
2025-06-24 20:46:07 +02:00