306244 Commits

Author SHA1 Message Date
Jonathan Brouwer
6abcadc235
Port #[macro_export] to the new attribute parsing infrastructure
Co-authored-by: Anne Stijns <anstijns@gmail.com>
2025-09-21 10:42:47 -04:00
bors
1d23da6b73 Auto merge of #146779 - GuillaumeGomez:gcc-ignore-test_ui_abi, r=Kobzol,jieyouxu
Ignore tests in `tests/ui/abi` for the GCC backend

Needed for https://github.com/rust-lang/rust/pull/146414.

Currently we ignore them in the GCC backend and until this situation changes, it'll block rust-lang/rust#146414.

r? `@Kobzol`
2025-09-21 07:52:56 +00:00
bors
dfa22235d8 Auto merge of #146830 - Zalathar:rollup-lj8jfok, r=Zalathar
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#140983 (Improve doc of some methods that take ranges)
 - rust-lang/rust#144091 (Stabilize `new_zeroed_alloc`)
 - rust-lang/rust#145664 (Stabilize `std::panic::Location::file_as_c_str`)
 - rust-lang/rust#146551 (fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadic)
 - rust-lang/rust#146744 (Deref related cleanups in ref_prop)
 - rust-lang/rust#146793 (naked_asm: emit a label starting with `func_end`)
 - rust-lang/rust#146820 (Add unstable attribute to BTreeMap-related allocator generics)
 - rust-lang/rust#146822 (Fix old typo in lang_start_internal comment)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-21 04:45:12 +00:00
Stuart Cook
5224279572
Rollup merge of #146822 - saethlin:bbbbbstd, r=Noratrieb
Fix old typo in lang_start_internal comment

Noticed this when reading the rt cleanup code; the typo was introduced during a mass port of libstd to std in comments.
2025-09-21 14:42:37 +10:00
Stuart Cook
be395723b5
Rollup merge of #146820 - cammeresi:alloc-20250919, r=tgross35
Add unstable attribute to BTreeMap-related allocator generics

Although these types aren't directly constructable externally, since they're pub, I think this omission was an oversight.

r? libs-api
2025-09-21 14:42:36 +10:00
Stuart Cook
92ea947c78
Rollup merge of #146793 - folkertdev:naked-asm-func-end, r=Amanieu
naked_asm: emit a label starting with `func_end`

The `cargo asm` tool (`cargo install cargo-show-asm`) pattern matches on such labels to figure out where functions end: normal functions generated by LLVM always do have such a label. We don't guarantee that naked functions emit such a label, but having `cargo asm` work is convenient.

be45f67454/src/asm/statements.rs (L897-L901)

To make the label name unique it's suffixed with the name of the current symbol.

r? ```@Amanieu```
2025-09-21 14:42:35 +10:00
Stuart Cook
5c1c47925e
Rollup merge of #146744 - beepster4096:derefs_in_ref_prop, r=cjgillot
Deref related cleanups in ref_prop

Cherry picked from rust-lang/rust#146710

r? cjgillot
2025-09-21 14:42:35 +10:00
Stuart Cook
6333a8b9fe
Rollup merge of #146551 - folkertdev:cmse-entry-c-variadic, r=workingjubilee
fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadic

tracking issue: https://github.com/rust-lang/rust/issues/75835
fixes https://github.com/rust-lang/rust/issues/132142

An `extern "cmse-nonsecure-entry"` function cannot be c-variadic (or, in any case, clang/LLVM does not support it, see  https://godbolt.org/z/MaPjzGcE1). So just stop looking at the type if we know it'll be invalid anyway.

I'm not entirely sure how to test this. The ICE is only possible on the `thumbv8m.main-none-eabi` and some related targets. I think using `minicore` is the most convenient, but use of `async` requires quite a long list of lang items to be present. Maybe we want that anyway though? On the other hand, it's extra `minicore` surface that might go out of date.

An alternative is `run-make`, that should work, but is much less convenient. See also [#t-compiler/help > &#96;async fn&#96; and &#96;minicore&#96;](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.60async.20fn.60.20and.20.60minicore.60/with/539427262).

r? `@ghost`
2025-09-21 14:42:34 +10:00
Stuart Cook
b0c55c8554
Rollup merge of #145664 - Darksonn:stab-file-with-nul, r=Mark-Simulacrum
Stabilize `std::panic::Location::file_as_c_str`

Closes: rust-lang/rust#141727

Nominating this for T-lang as per ```@traviscross```  https://github.com/rust-lang/rust/issues/141727#issuecomment-3201318429
2025-09-21 14:42:34 +10:00
Stuart Cook
7a5819d154
Rollup merge of #144091 - thaliaarchi:stabilize-new-zeroed, r=Mark-Simulacrum
Stabilize `new_zeroed_alloc`

The corresponding `new_uninit` and `new_uninit_slice` functions were stabilized in rust-lang/rust#129401, but the zeroed counterparts were left for later out of a [desire](https://github.com/rust-lang/rust/issues/63291#issuecomment-2161039756) to stabilize only the minimal set. These functions are straightforward mirrors of the uninit functions and well-established. Since no blockers or design questions have surfaced in the past year, I think it's time to stabilize them.

Tracking issue: rust-lang/rust#129396
2025-09-21 14:42:33 +10:00
Stuart Cook
d2533189de
Rollup merge of #140983 - tkr-sh:master, r=ibraheemdev
Improve doc of some methods that take ranges

Some methods that were taking some range in parameter were a bit inconsistent / unclear in the panic documentation.

Here is the recap:
- Replaced "start/end point" by "start/end bound" to be coherent with [`RangeBounds`](https://doc.rust-lang.org/stable/std/ops/trait.RangeBounds.html) naming (it's also easier to understand I think)
- Previously, it was written "_[...] or if the end point is greater than the length of [...]_", but this is not entirely true! Actually, you can have a start bound that is greater than the length, with an end bound that is unbounded and it will also panic. Therefore I think that "_[...] one of the range bound is bounded and greater than the length of [...]_" is better!
- `String` methods weren't mentionning that the method panics if `start_bound > end_bound` but it actually does! It uses `slice::range` which panics when `start > end`.  (https://doc.rust-lang.org/stable/src/alloc/string.rs.html#1932-1934, https://doc.rust-lang.org/stable/src/core/slice/index.rs.html#835-837).
You can also test it with:
```rs
struct MyRange;
impl std::ops::RangeBounds<usize> for MyRange {
    fn start_bound(&self) -> std::ops::Bound<&usize> {
        std::ops::Bound::Included(&3usize)
    }
    fn end_bound(&self) -> std::ops::Bound<&usize> {
        std::ops::Bound::Included(&1usize)
    }
}

fn main() {
    let mut s = String::from("I love Rust!");
    s.drain(MyRange); // panics!
}
```
2025-09-21 14:42:32 +10:00
Ben Kimock
5c0cb3af59 Fix old typo in lang_start_internal comment 2025-09-20 18:27:33 -04:00
bors
dd7fda5700 Auto merge of #146812 - matthiaskrgr:rollup-aiap18m, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144592 (generate list of all variants with `target_spec_enum`)
 - rust-lang/rust#146762 (Fix and provide instructions for running test suite on Apple simulators)
 - rust-lang/rust#146770 (fixes for numerous clippy warnings)
 - rust-lang/rust#146774 (Allow running `x <cmd> <path>` from a different directory)
 - rust-lang/rust#146800 (Fix unsupported `std::sys::thread` after move)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-20 16:33:23 +00:00
Guillaume Gomez
fd7f8b2b25 [GCC backend] Ignore failing ui abi tests 2025-09-20 17:58:32 +02:00
Matthias Krüger
48c1249bff
Rollup merge of #146800 - thaliaarchi:fix-move-pal-thread, r=joboet
Fix unsupported `std::sys::thread` after move

Fixes building std for any platform with an unsupported thread abstraction. This includes {aarch64,armv7,x86_64}-unknown-trusty and riscv32im-risc0-zkvm-elf, which explicitly include the unsupported module, and platforms with no PAL.

Bug fix for rust-lang/rust#145177 (std: move thread into sys).

Also fix the `std` build for xtensa, which I incidentally found while looking for an unsupported platform.

r? ``@joboet``
2025-09-20 17:55:05 +02:00
Matthias Krüger
f5725f0182
Rollup merge of #146774 - Kobzol:bootstrap-relative-path, r=jieyouxu
Allow running `x <cmd> <path>` from a different directory

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

r? ``@jieyouxu``
2025-09-20 17:55:05 +02:00
Matthias Krüger
016420a603
Rollup merge of #146770 - hkBst:clippy-fix-10, r=fmease
fixes for numerous clippy warnings
2025-09-20 17:55:04 +02:00
Matthias Krüger
8904ff135f
Rollup merge of #146762 - madsmtm:test-apple-sim, r=jieyouxu
Fix and provide instructions for running test suite on Apple simulators

The following now works:

```sh
./x test --host='' --target aarch64-apple-ios-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-tvos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-watchos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-visionos-sim --skip tests/debuginfo
```

I have documented the setup I used [in the `rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/tests/running.html#testing-on-emulators), it's fairly standard use of `remote-test-server` (with a small fix to library load paths which I've made in the first commit).

I first tried the somewhat simpler `target.aarch64-apple-ios-sim.runner = "xcrun simctl spawn $UDID"`, but that doesn't work as required libraries etc. also need to be copied to the device.

The debuginfo tests fail, I think because the debug info in `.dSYM` isn't available. I am yet unsure exactly how to fix this, either we need to copy that directory to the target as well, or we need to configure `lldb` somehow to read it from the host.

I decided to not add this to our CI, since I suspect we wouldn't gain much from it? Running on the simulator still uses the host Darwin kernel, it's basically just configured to run in another mode with more restricted permissions and different system libraries.

r? jieyouxu
CC ``@simlay,`` you're a lot more familiar with `xcrun simctl` than I.
2025-09-20 17:55:04 +02:00
Matthias Krüger
5f8062bfcc
Rollup merge of #144592 - fee1-dead-contrib:target_spec, r=Noratrieb
generate list of all variants with `target_spec_enum`

This helps us avoid the hardcoded lists elsewhere.

r? ``@Noratrieb``
2025-09-20 17:55:03 +02:00
bors
9f2ef0f14d Auto merge of #146805 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 0c62c01aae.

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

r? `@ghost`
2025-09-20 11:17:44 +00:00
tk
ac3c480388 docs: improve doc of some methods w/ ranges 2025-09-20 10:17:56 +00:00
bors
b00998aaa5 Auto merge of #146771 - Kobzol:download-ci-llvm-default-value, r=jieyouxu
Simplify default value of `download-ci-llvm`

Just set it to true, rather than having different default values on CI and locally, and then only deny `true` on our own CI, not elsewhere.

Closes: https://github.com/rust-lang/rust/issues/146768

r? `@jieyouxu`
2025-09-20 08:04:38 +00:00
Laurențiu Nicola
0afd767bac
Merge pull request #20707 from lnicola/bump-rustc
minor: Bump rustc crates once more
2025-09-20 06:50:11 +00:00
Laurențiu Nicola
4d8655e8d0 Bump rustc crates once more 2025-09-20 09:38:53 +03:00
bors
e4b521903b Auto merge of #146621 - cammeresi:peek-20250915, r=Amanieu
Make `PeekMut` generic over the allocator

- plumb in allocator generic
- additional testing

Related: rust-lang/rust#122742
2025-09-20 04:43:19 +00:00
Sidney Cammeresi
42b38e3781
Add unstable attribute to BTreeMap-related allocator generics
Although these types aren't directly constructable externally, since
they're pub, I think this omission was an oversight.
2025-09-19 21:32:15 -07:00
Thalia Archibald
db4d4eff56 Update cfg_if! to cfg_select!
The macro is now builtin.
2025-09-19 19:18:10 -06:00
Thalia Archibald
776c199c7b Fix std build for xtensa 2025-09-19 19:18:10 -06:00
Thalia Archibald
6a5838105d Fix unsupported std::sys::thread
Fixes building std for any platform with an unsupported thread
abstraction. This includes {aarch64,armv7,x86_64}-unknown-trusty and
riscv32im-risc0-zkvm-elf, which explicitly include the unsupported
module, and platforms with no PAL.

Bug fix for PR 145177 (std: move thread into sys).
2025-09-19 19:18:10 -06:00
Deadbeef
4841d8c5ff generate list of all variants with target_spec_enum
This helps us avoid the hardcoded lists elsewhere.
2025-09-19 22:14:50 +00:00
bors
ec38671075 Auto merge of #146797 - matthiaskrgr:rollup-xy0g8n7, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146690 (add `[const] PartialEq` bound to `PartialOrd`)
 - rust-lang/rust#146776 (fixes for numerous clippy warnings)
 - rust-lang/rust#146777 (fix ./x readdir logic when CDPATH is set)
 - rust-lang/rust#146781 (mbe: Fix feature gate for `macro_derive`)
 - rust-lang/rust#146785 (btree: safety comments for init and new)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-19 21:41:28 +00:00
Marijn Schouten
54b15a66d8 fixes for numerous clippy warnings 2025-09-19 20:56:07 +00:00
Matthias Krüger
6f9e6c9935
Rollup merge of #146785 - hkBst:btree-1, r=joboet
btree: safety comments for init and new
2025-09-19 22:53:56 +02:00
Matthias Krüger
02faee6044
Rollup merge of #146781 - joshtriplett:mbe-derive-fix-feature-gate, r=wesleywiser
mbe: Fix feature gate for `macro_derive`
2025-09-19 22:53:56 +02:00
Matthias Krüger
dc3c62a179
Rollup merge of #146777 - RalfJung:x-cdpath, r=Kobzol
fix ./x readdir logic when CDPATH is set

Fixes https://github.com/rust-lang/rust/issues/146769
r? ``@Kobzol``
2025-09-19 22:53:55 +02:00
Matthias Krüger
29f39426c5
Rollup merge of #146776 - hkBst:clippy-fix-12, r=jdonszelmann
fixes for numerous clippy warnings
2025-09-19 22:53:55 +02:00
Matthias Krüger
96a4ae3ab9
Rollup merge of #146690 - npmccallum:convo, r=tgross35
add `[const] PartialEq` bound to `PartialOrd`

This change is included for discussion purposes.

The PartialOrd bound on PartialEq is not strictly necessary. It is, rather, logical: anything which is orderable should by definition have equality. Is the same true for constness? Should every type which is const orderable also have const equality?
2025-09-19 22:53:54 +02:00
Folkert de Vries
b27942853e
naked_asm: emit a label starting with func_end
The `cargo asm` tool pattern matches on such labels to figure out where functions end: normal functions generated by LLVM always do have such a label. We don't guarantee that naked functions emit such a label, but having `cargo asm` work is convenient
2025-09-19 21:53:06 +02:00
bors
0be8e16088 Auto merge of #146700 - Zalathar:quoted-args, r=nikic
cg_llvm: Move target machine command-line quoting from C++ to Rust

When this code was introduced in rust-lang/rust#130446 and rust-lang/rust#131805, it was complicated by the need to maintain compatibility with earlier versions of LLVM.

Now that LLVM 20 is the baseline (rust-lang/rust#145071), we can do all of the quoting in pure Rust code, and pass two flat strings to LLVM to be used as-is.

---

In this PR, my priority has been to preserve the existing behaviour as much as possible, without worrying too much about what the behaviour *should* be. (Though I did avoid a leading space before the first argument.)
2025-09-19 18:32:17 +00:00
Jakub Beránek
4b755141bc
Simplify default value of download-ci-llvm 2025-09-19 20:12:30 +02:00
Marijn Schouten
e2de670558 btree: safety comments for init and new 2025-09-19 17:21:55 +00:00
bors
59043567a5 Auto merge of #146765 - Zalathar:rollup-ewh4s9o, r=Zalathar
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#146229 (Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set)
 - rust-lang/rust#146484 (rustdoc-search: JavaScript optimization based on Firefox Profiler output)
 - rust-lang/rust#146541 (std: simplify host lookup)
 - rust-lang/rust#146615 (rustc_codegen_llvm: Feature Conversion Tidying)
 - rust-lang/rust#146638 (`rustc_next_trait_solver`: canonical out of `EvalCtxt`)
 - rust-lang/rust#146663 (Allow windows resource compiler to be overridden)
 - rust-lang/rust#146691 (std: Fix WASI implementation of `remove_dir_all`)
 - rust-lang/rust#146709 (stdarch subtree update)
 - rust-lang/rust#146738 (Fix tidy spellchecking on Windows)
 - rust-lang/rust#146740 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-19 15:22:22 +00:00
Josh Triplett
3ab89abac4 mbe: Fix feature gate for macro_derive 2025-09-19 23:17:12 +08:00
Chayim Refael Friedman
300aee8239
Merge pull request #20701 from A4-Tacks/track-caller-assist-test
Add `#[track_caller]` for check_assist_by_label
2025-09-19 15:07:17 +00:00
Ralf Jung
04f6b8f992 fix ./x readdir logic when CDPATH is set 2025-09-19 16:48:05 +02:00
Marijn Schouten
e500dd820b fixes for numerous clippy warnings 2025-09-19 14:46:12 +00:00
Jakub Beránek
58814bce6c
Allow running x <cmd> <path> from a different directory 2025-09-19 16:21:34 +02:00
Shoyu Vanilla (Flint)
6ec196a748
Merge pull request #20697 from Oblarg/fix-negative-const-generic-literals
fix negative const generic integer literals
2025-09-19 14:13:54 +00:00
Oblarg
9ba9869b33 address review feedback 2025-09-19 10:03:14 -04:00
Laurențiu Nicola
b1d9569443
Merge pull request #20703 from ShoyuVanilla/remove-chalk-solve
minor: Get rid of unused deps `chalk-solve` and `chalk-recursive`
2025-09-19 13:47:35 +00:00