Commit Graph

5195 Commits

Author SHA1 Message Date
bjorn3 53f8a7bd0b Make it clearer what exactly is being benchmarked 2025-11-20 12:09:39 +01:00
bjorn3 0670b60de3 Use the rust-std manifest file in build_llvm_sysroot_for_triple
This is far more accurate than filtering based on filename and as such
allows building the sysroot a bit quicker. In addition the code is a bit
simpler.
2025-11-19 15:16:35 +00:00
bjorn3 8ad6e38384 Remove no longer necessary portable-simd patch 2025-11-19 15:02:42 +00:00
bjorn3 98bf9c4857 Rustup to rustc 1.93.0-nightly (3d461af2a 2025-11-18) 2025-11-19 14:49:43 +00:00
bjorn3 d6eb3bd724 Sync from rust 3d461af2a2 2025-11-19 14:43:04 +00:00
Camille Gillot 94ff1de61e Replace OffsetOf by an actual sum. 2025-11-18 00:10:03 +00:00
bjorn3 201734496e Remove usage of function const promotion in the build system 2025-11-17 19:00:26 +00:00
srosefield-riverside 726b7360cf Only allocate the minimal alignment requested for a type when possible. (#1604)
* Only allocate the minimal alignment requested for a type when possible.

* Code review: make an assertion a debug assert. Adjust an out-of-date comment.
2025-11-17 15:31:02 +01:00
bjorn3 614349ab2c Rustup to rustc 1.93.0-nightly (b6d7ff3aa 2025-11-14) 2025-11-15 16:18:36 +00:00
bjorn3 699fa9a912 Sync from rust b6d7ff3aa7 2025-11-15 16:13:16 +00:00
bjorn3 a842469f0d Adjust for rust-lang/rust default branch rename 2025-11-15 16:08:59 +00:00
Tamir Duberstein d1c33c3e84 rustc_target: introduce Os
Improve type safety by using an enum rather than strings.
2025-11-11 18:55:40 -05:00
Tamir Duberstein 46f27590af rustc_target: introduce Env
Improve type safety by using an enum rather than strings.
2025-11-11 18:34:47 -05:00
Tamir Duberstein 032ba980b1 rustc_target: introduce Abi
Improve type safety by using an enum rather than strings.
2025-11-11 18:22:38 -05:00
Tamir Duberstein 35a99c1d41 rustc_target: hide TargetOptions::vendor 2025-11-09 17:43:36 -05:00
Stuart Cook 5873ee5bb6 Rollup merge of #128666 - pitaj:intrinsic-overflow_checks, r=BoxyUwU
Add `overflow_checks` intrinsic

This adds an intrinsic which allows code in a pre-built library to inherit the overflow checks option from a crate depending on it. This enables code in the standard library to explicitly change behavior based on whether `overflow_checks` are enabled, regardless of the setting used when standard library was compiled.

This is very similar to the `ub_checks` intrinsic, and refactors the two to use a common mechanism.

The primary use case for this is to allow the new `RangeFrom` iterator to yield the maximum element before overflowing, as requested [here](https://github.com/rust-lang/rust/issues/125687#issuecomment-2151118208). This PR includes a working `IterRangeFrom` implementation based on this new intrinsic that exhibits the desired behavior.

[Prior discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Ability.20to.20select.20code.20based.20on.20.60overflow_checks.60.3F)
2025-11-09 13:22:23 +11:00
bjorn3 a44af2ba0a Add missing --check-cfg 2025-11-08 15:04:45 +00:00
bjorn3 9d292ca475 Add missing --check-cfg 2025-11-08 15:03:47 +00:00
bjorn3 1bd57ebb41 Merge branch 'sync_from_rust' 2025-11-08 14:28:51 +00:00
bjorn3 c90a9d836b Merge commit 'a0b865dc8782500efe9623859017dd5e16f85407' into sync_cg_clif-2025-11-08 2025-11-08 14:18:53 +00:00
bjorn3 a0b865dc87 Fix simd_gather intrinsic 2025-11-08 13:35:51 +00:00
bjorn3 18882dd547 Rustup to rustc 1.93.0-nightly (843f8ce2e 2025-11-07) 2025-11-08 13:25:51 +00:00
bjorn3 0e41b6302b Sync from rust 843f8ce2eb 2025-11-08 13:18:47 +00:00
bjorn3 28eb8499c3 Allow f16 and f128 on s390x and non-mingw windows 2025-11-05 13:29:42 +00:00
bjorn3 2073d1209d Unify the configuration of the compiler docs
Previously it was rather inconsistent which crates got the rust logo and
which didn't and setting html_root_url was forgotten in many cases.
2025-11-05 11:25:27 +00:00
bjorn3 296501b2fa Fix rustc test suite 2025-11-05 11:07:47 +00:00
bjorn3 bb6f965464 Rustup to rustc 1.93.0-nightly (f15a7f385 2025-11-04) 2025-11-05 10:21:42 +00:00
bors c2d6d4a0b5 Auto merge of #148507 - Zalathar:rollup-vvz4knr, r=Zalathar
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#147355 (Add alignment parameter to `simd_masked_{load,store}`)
 - rust-lang/rust#147925 (Fix tests for big-endian)
 - rust-lang/rust#148341 (compiler: Fix a couple issues around cargo feature unification)
 - rust-lang/rust#148371 (Dogfood `trim_{suffix|prefix}` in compiler)
 - rust-lang/rust#148495 (Implement Path::is_empty)
 - rust-lang/rust#148502 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-05 07:25:39 +00:00
Tamir Duberstein f47ad44886 rustc_target: allow unenumerated architectures 2025-11-04 21:28:28 -05:00
Tamir Duberstein b49a1f7aad rustc_target: introduce Arch
Improve type safety by using an enum rather than strings.
2025-11-04 21:27:22 -05:00
sayantn d28c5a51c4 Implement the alignment parameter in cg_clif 2025-11-04 03:02:44 +05:30
bjorn3 ca44758e50 Fix a bunch of clippy lints in the build system 2025-10-28 16:08:46 +00:00
bjorn3 eaa91b8f04 Bunch of clippy fixes 2025-10-28 16:05:34 +00:00
bjorn3 bbedad249c Error when combining check mode and jit mode 2025-10-28 15:34:36 +00:00
bjorn3 022bb60b8e Rustup to rustc 1.93.0-nightly (adaa83897 2025-10-27) 2025-10-28 15:17:46 +00:00
bjorn3 6f1899c373 Sync from rust adaa838976 2025-10-28 15:11:14 +00:00
Peter Jaszkowiak 482feee311 refactor ub_checks and contract_checks to share logic 2025-10-25 14:30:04 -06:00
bjorn3 5aabbb6321 Fix dev release after renaming the default branch to main 2025-10-24 19:54:43 +00:00
bjorn3 b548b29e10 Skip codegen_crate call in check mode 2025-10-24 10:25:13 +00:00
bjorn3 bc6f1ef74a Rustup to rustc 1.92.0-nightly (1d23d0680 2025-10-22) 2025-10-23 11:43:38 +00:00
bjorn3 2e8f8d5414 Sync from rust 1d23d06800 2025-10-23 11:36:50 +00:00
Camille Gillot cc27b04473 Replace NullOp::SizeOf and NullOp::AlignOf by lang items. 2025-10-23 00:38:28 +00:00
bors 0eae3a2bed Auto merge of #147687 - cjgillot:noshallow-init-box, r=nnethercote
Forbid ShallowInitBox after box deref elaboration.

MIR currently contains a `ShallowInitBox` rvalue. Its principal usage is to allow for in-place initialization of boxes. Having it is necessary for drop elaboration to be correct with that in-place initialization.

As part of analysis->runtime MIR lowering, we canonicalize deref of boxes to use the stored raw pointer. But we did not perform the same change to the construction of the box.

This PR replaces `ShallowInitBox` by the pointer manipulation it represents.

Alternatives:
- fully remove `ShallowInitBox` and implement `Box` in-place initialization differently;
- remove the `ElaborateBoxDeref` pass and keep dereferencing `Box` in runtime MIR.
2025-10-22 09:53:50 +00:00
Camille Gillot 9d63e8c135 Elaborate ShallowInitBox too. 2025-10-22 00:52:52 +00:00
Oli Scherer 6031dfdaed Allow unsizing pattern types with pointer base 2025-10-21 11:22:51 +00:00
bjorn3 a20a4c2513 Update to Cranelift 0.125 2025-10-21 09:22:56 +00:00
Matthias Krüger 71068af640 Rollup merge of #145724 - folkertdev:track-caller-drop-no-mangle, r=fee1-dead
the `#[track_caller]` shim should not inherit `#[no_mangle]`

fixes https://github.com/rust-lang/rust/issues/143162

builds on https://github.com/rust-lang/rust/pull/143293 which introduced a mechanism to strip attributes from shims.

cc `@Jules-Bertholet` `@workingjubilee` `@bjorn3`

---

Summary:

This PR fixes an interaction between `#[track_caller]`, `#[no_mangle]`, and casting to a function pointer.

A function annotated with `#[track_caller]` internally has a hidden extra argument for the panic location. The `#[track_caller]` attribute is only allowed on `extern "Rust"` functions. When a function is annotated with both `#[no_mangle]` and `#[track_caller]`, the exported symbol has the signature that includes the extra panic location argument. This works on stable rust today:

```rust
extern "Rust" {
    #[track_caller]
    fn rust_track_caller_ffi_test_tracked() -> &'static Location<'static>;
}

mod provides {
    use std::panic::Location;
    #[track_caller] // UB if we did not have this!
    #[no_mangle]
    fn rust_track_caller_ffi_test_tracked() -> &'static Location<'static> {
        Location::caller()
    }
}
```

When a `#[track_caller]` function is converted to a function pointer, a shim is added to drop the additional argument. So this is a valid program:

```rust
#[track_caller]
fn foo() {}

fn main() {
    let f = foo as fn();
    f();
}
```

The issue arises when `foo` is additionally annotated with `#[no_mangle]`, the generated shim currently inherits this attribute, also exporting a symbol named `foo`, but one without the hidden panic location argument. The linker rightfully complains about a duplicate symbol.

The solution of this PR is to have the generated shim drop the `#[no_mangle]` attribute.
2025-10-18 08:08:36 +02:00
bjorn3 ca23203edb Fix rustc test suite 2025-10-17 11:35:42 +00:00
bjorn3 2d8a0c1816 Rustup to rustc 1.92.0-nightly (53a741fc4 2025-10-16) 2025-10-17 10:54:47 +00:00
bjorn3 48fc410b72 Sync from rust 53a741fc4b 2025-10-17 10:35:32 +00:00