about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-29Centralize the eslint version between tidy and dockerGuillaume Gomez-9/+19
2025-05-29fix: `collapsible_else_if` FP on conditionally compiled stmtyanglsh-3/+52
2025-05-29Remove `i128` and `u128` from `improper_ctypes_definitions`Trevor Gross-235/+75
Rust's 128-bit integers have historically been incompatible with C [1]. However, there have been a number of changes in Rust and LLVM that mean this is no longer the case: * Incorrect alignment of `i128` on x86 [1]: adjusting Rust's alignment proposed at https://github.com/rust-lang/compiler-team/issues/683, implemented at https://github.com/rust-lang/rust/pull/116672. * LLVM version of the above: resolved in LLVM, including ABI fix. Present in LLVM18 (our minimum supported version). * Incorrect alignment of `i128` on 64-bit PowerPC, SPARC, and MIPS [2]: Rust's data layouts adjusted at https://github.com/rust-lang/rust/pull/132422, https://github.com/rust-lang/rust/pull/132741, https://github.com/rust-lang/rust/pull/134115. * LLVM version of the above: done in LLVM 20 https://github.com/llvm/llvm-project/issues/102783. * Incorrect return convention of `i128` on Windows: adjusted to match GCC and Clang at https://github.com/rust-lang/rust/pull/134290. At [3], the lang team considered it acceptable to remove `i128` from `improper_ctypes_definitions` if the LLVM version is known to be compatible. Time has elapsed since then and we have dropped support for LLVM versions that do not have the x86 fixes, meaning a per-llvm-version lint should no longer be necessary. The PowerPC, SPARC, and MIPS changes only came in LLVM 20 but since Rust's datalayouts have also been updated to match, we will be using the correct alignment regardless of LLVM version. `repr(i128)` was added to this lint in [4], but is also removed here. Part of the decision is that `i128` should match `__int128` in C on platforms that provide it, which documentation is updated to indicate. We will not guarantee that `i128` matches `_BitInt(128)` since that can be different from `__int128`. Some platforms (usually 32-bit) do not provide `__int128`; if any ABIs are extended in the future to define it, we will need to make sure that our ABI matches. Closes: https://github.com/rust-lang/rust/issues/134288 Closes: https://github.com/rust-lang/rust/issues/128950 [1]: https://github.com/rust-lang/rust/issues/54341 [2]: https://github.com/rust-lang/rust/issues/128950 [3]: https://github.com/rust-lang/lang-team/issues/255#issuecomment-2088855084 [4]: https://github.com/rust-lang/rust/pull/138282
2025-05-29fix: Fix import insertion not being fully cfg awareLukas Wirth-128/+214
2025-05-29Add test for issue 127911 and 128839Mu001999-0/+50
2025-05-29Install eslint in host-x86_64 DockerfileGuillaume Gomez-0/+7
2025-05-29resolve target-libdir directly from rustconur-ozkan-10/+26
Leaving stage0 target-libdir resolution to rustc. This should also fix the issue with hard-coding `$sysroot/lib` which fails on systems that use `$sysroot/lib64` or `$sysroot/lib32`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-29resolve stage0 sysroot from rustconur-ozkan-1/+3
Instead of manually navigating directories based on stage0 rustc, use `--print sysroot` to get the sysroot directly. This also works when using the bootstrap `rustc` shim. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-29Auto merge of #141595 - bjorn3:rustc_no_sysroot_proc_macro, r=onur-ozkanbors-20/+60
Do not get proc_macro from the sysroot in rustc With the stage0 refactor the proc_macro version found in the sysroot will no longer always match the proc_macro version that proc-macros get compiled with by the rustc executable that uses this proc_macro. This will cause problems as soon as the ABI of the bridge gets changed to implement new features or change the way existing features work. To fix this, this commit changes rustc crates to depend directly on the local version of proc_macro which will also be used in the sysroot that rustc will build.
2025-05-29Normalize possibly unnormalized type in relate_type_and_user_typeMichael Goulet-0/+34
2025-05-29creader: Remove extraenous String::clonePiotr Osiewicz-1/+1
2025-05-29Structurally normalize types as needed in projection_ty_coreMichael Goulet-45/+81
2025-05-29Tweak fast path trait handlingMichael Goulet-34/+54
2025-05-29cstore: Use IndexSet as backing store for postorder dependenciesPiotr Osiewicz-7/+9
<rustc_metadata::creader::CStore>::push_dependencies_in_postorder showed up in new benchmarks from https://github.com/rust-lang/rustc-perf/pull/2143, hence I gave it a shot to remove an obvious O(n) there.
2025-05-29Use `cfg_attr` AST placeholder AST `cfg_attr_trace` for diagnosticsEsteban Küber-27/+227
PR 138515, we insert a placeholder attribute so that checks for attributes can still know about the placement of `cfg` attributes. When we suggest removing items with `cfg_attr`s (fix Issue 56328) and make them verbose. We tweak the wording of the existing "unused `extern crate`" lint. ``` warning: unused extern crate --> $DIR/removing-extern-crate.rs:9:1 | LL | extern crate removing_extern_crate as foo; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | note: the lint level is defined here --> $DIR/removing-extern-crate.rs:6:9 | LL | #![warn(rust_2018_idioms)] | ^^^^^^^^^^^^^^^^ = note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]` help: remove the unused `extern crate` | LL - #[cfg_attr(test, macro_use)] LL - extern crate removing_extern_crate as foo; LL + | ```
2025-05-29Merge pull request #4355 from RalfJung/rustupRalf Jung-2193/+3311
Rustup
2025-05-29Fix false documentationJonathan Brouwer-1/+3
2025-05-29Merge from rustcRalf Jung-2192/+3310
2025-05-29Preparing for merge from rustcRalf Jung-1/+1
2025-05-29`emit_xtensa_va_arg`: use `inbounds_ptradd` instead of `inbounds_gep`Folkert de Vries-7/+5
2025-05-29Bump rustc-perf and update PGO cratesMichael Goulet-11/+11
2025-05-29Auto merge of #141717 - jhpratt:rollup-neu8nzl, r=jhprattbors-101/+94
Rollup of 4 pull requests Successful merges: - rust-lang/rust#138285 (Stabilize `repr128`) - rust-lang/rust#139994 (add `CStr::display`) - rust-lang/rust#141571 (coretests: extend and simplify float tests) - rust-lang/rust#141656 (CI: Add cargo tests to aarch64-apple-darwin) Failed merges: - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`) - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-29Auto merge of #141717 - jhpratt:rollup-neu8nzl, r=jhprattbors-459/+291
Rollup of 4 pull requests Successful merges: - rust-lang/rust#138285 (Stabilize `repr128`) - rust-lang/rust#139994 (add `CStr::display`) - rust-lang/rust#141571 (coretests: extend and simplify float tests) - rust-lang/rust#141656 (CI: Add cargo tests to aarch64-apple-darwin) Failed merges: - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`) - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-29Merge pull request #2425 from jieyouxu/adjust-triagebot许杰友 Jieyou Xu (Joe)-5/+58
2025-05-29triagebot: update `[issue-links]` configJieyou Xu-1/+4
2025-05-29triagebot: add doc backlink for `[no-mentions]`Jieyou Xu-0/+2
2025-05-29triagebot: enable note functionalityJieyou Xu-0/+4
2025-05-29triagebot: enable issue transferJieyou Xu-0/+4
2025-05-29triagebot: enable PR review status flipping and its shortcutsJieyou Xu-0/+19
2025-05-29triagebot: apply `needs-triage` label for new issuesJieyou Xu-0/+10
2025-05-29triagebot: adjust `allow-unauthenticated` labelsJieyou Xu-4/+15
2025-05-29Provide secrets to try builds with new borsJakub Beránek-2/+2
2025-05-29Merge pull request #19888 from Veykril/push-wylsryzpnnopLukas Wirth-3/+6
fix: Recognize salsa cycles in `thread_result_to_response`
2025-05-29fix: Recognize salsa cycles in `thread_result_to_response`Lukas Wirth-3/+6
2025-05-29Auto merge of #141716 - jhpratt:rollup-9bjrzfi, r=jhprattbors-145/+322
Rollup of 16 pull requests Successful merges: - rust-lang/rust#136429 (GCI: At their def site, actually wfcheck the where-clause & always eval free lifetime-generic constants) - rust-lang/rust#138139 (Emit warning while outputs is not exe and prints linkage info) - rust-lang/rust#141104 (Test(fs): Fix `test_eq_windows_file_type` for Windows 7) - rust-lang/rust#141477 (Path::with_extension: show that it adds an extension where one did no…) - rust-lang/rust#141533 (clean up old rintf leftovers) - rust-lang/rust#141612 (Call out possibility of invariant result in variance markers) - rust-lang/rust#141638 (Use `builtin_index` instead of hand-rolling it) - rust-lang/rust#141643 (ci: verify that codebuild jobs use ghcr.io) - rust-lang/rust#141675 (Reorder `ast::ItemKind::{Struct,Enum,Union}` fields.) - rust-lang/rust#141680 (replace TraitRef link memory.md) - rust-lang/rust#141682 (interpret/allocation: Fixup type for `alloc_bytes`) - rust-lang/rust#141683 (Handle ed2021 precise capturing of unsafe binder) - rust-lang/rust#141684 (rustbook: Bump versions of `onig` and `onig_sys`) - rust-lang/rust#141687 (core: unstably expose atomic_compare_exchange so stdarch can use it) - rust-lang/rust#141690 (Add `rustc_diagnostic_item` to `sys::Mutex` methods) - rust-lang/rust#141702 (Add eholk to compiler reviewer rotation) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-29avoid some usages of `&mut P<T>` in AST visitorsDeadbeef-33/+30
2025-05-29remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`Deadbeef-146/+95
`visit_clobber` is not really useful except for one niche purpose involving generic code. We should just use the replace logic where we can.
2025-05-29Reuse `libm`'s `Caat` and `CastFrom` in `compiler-builtins`Trevor Gross-52/+16
2025-05-29cleanup: Reuse `MinInt` and `Int` from `libm` in `compiler-builtins`Trevor Gross-345/+168
Since the two crates are now in the same repo, it is easier to share code. Begin some deduplication with the integer traits.
2025-05-29Rollup merge of #141656 - ehuss:cargo-aarch64-macos, r=marcoieni,jieyouxuJacob Pratt-1/+3
CI: Add cargo tests to aarch64-apple-darwin This adds running of cargo's tests to the aarch64-apple-darwin job. The reason for this is that tier-1 targets are ostensibly supposed to run tests for host tools, but we are not doing that here. We do have fairly good coverage in Cargo's CI, but we don't cover the beta or stable branches here. I think it would be good to have a fallback here. I think this should only add about 7 minutes of CI time, but I have not measured it. The current job is about 1.5 hours. In summary of the tier-1 targets: | Target | rust-lang/cargo | rust-lang/rust | |--------|-----------------|----------------| | aarch64-apple-darwin | stable/nightly | ❌ (this PR) | | aarch64-unknown-linux-gnu | stable/nightly | ✓ | | x86_64-apple-darwin | nightly | ❌ | | x86_64-pc-windows-gnu | nightly | ❌ | | x86_64-pc-windows-msvc | stable | ✓ | | x86_64-unknown-linux-gnu | stable/beta/nightly | ✓ | | i686-pc-windows-msvc | ❌ | ❌ | | i686-unknown-linux-gnu | ❌ | ❌ | try-job: aarch64-apple
2025-05-29Rollup merge of #141571 - RalfJung:float-tests, r=tgross35Jacob Pratt-181/+114
coretests: extend and simplify float tests Also de-duplicate tests by removing a ui test that duplicates the tests in core. r? `@tgross35`
2025-05-29Rollup merge of #139994 - tamird:cstr-display, r=AmanieuJacob Pratt-0/+31
add `CStr::display` The implementation delegates to `<ByteStr as Display>::fmt`. Link: https://github.com/rust-lang/libs-team/issues/550 Link: https://github.com/rust-lang/rust/issues/139984. r? ```@BurntSushi``` cc ```@Darksonn``` ```@tgross35``` ```@ojeda``` ```@joshtriplett```
2025-05-29Rollup merge of #138285 - beetrees:repr128-stable, r=traviscross,bjorn3Jacob Pratt-277/+143
Stabilize `repr128` ## Stabilisation report The `repr128` feature ([tracking issue](https://github.com/rust-lang/rust/issues/56071)) allows the use of `#[repr(u128)]` and `#[repr(i128)]` on enums in the same way that other primitive representations such as `#[repr(u64)]` can be used. For example: ```rust #[repr(u128)] enum Foo { One = 1, Two, Big = u128::MAX, } #[repr(i128)] enum Bar { HasThing(u16) = 42, HasSomethingElse(i64) = u64::MAX as i128 + 1, HasNothing, } ``` This is the final part of adding 128-bit integers to Rust ([RFC 1504](https://rust-lang.github.io/rfcs/1504-int128.html)); all other parts of 128-bit integer support were stabilised in #49101 back in 2018. From a design perspective, `#[repr(u128)]`/`#[repr(i128)]` function like `#[repr(u64)]`/`#[repr(i64)]` but for 128-bit integers instead of 64-bit integers. The only differences are: - FFI safety: as `u128`/`i128` are not currently considered FFI safe, neither are `#[repr(u128)]`/`#[repr(i128)]` enums (I discovered this wasn't the case while drafting this stabilisation report, so I have submitted #138282 to fix this). - Debug info: while none of the major debuggers currently support 128-bit integers, as of LLVM 20 `rustc` will emit valid debuginfo for both DWARF and PDB (PDB makes use of the same natvis that is also used for all enums with fields, whereas DWARF has native support). Tests for `#[repr(u128)]`/`#[repr(i128)]` enums include: - [ui/enum-discriminant/repr128.rs](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/ui/enum-discriminant/repr128.rs): checks that 128-bit enum discriminants have the correct values. - [debuginfo/msvc-pretty-enums.rs](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/debuginfo/msvc-pretty-enums.rs): checks the PDB debuginfo is correct. - [run-make/repr128-dwarf](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/run-make/repr128-dwarf/rmake.rs): checks the DWARF debuginfo is correct. Stabilising this feature does not require any changes to the Rust Reference as [the documentation on primitive representations](https://doc.rust-lang.org/nightly/reference/type-layout.html#r-layout.repr.primitive.intro) already includes `u128` and `i128`. Closes #56071 Closes https://github.com/rust-lang/reference/issues/1368 r? lang ```@rustbot``` label +I-lang-nominated +T-lang
2025-05-29Rollup merge of #141702 - eholk:eholk-reviewers, r=aDotInTheVoidJacob Pratt-0/+1
Add eholk to compiler reviewer rotation Now that we have work queue limits on triagebot, I'm happy to share some of the review load. r? ``@wesleywiser``
2025-05-29Rollup merge of #141690 - Patrick-6:intercept-mutex, r=m-ou-seJacob Pratt-1/+16
Add `rustc_diagnostic_item` to `sys::Mutex` methods For an ongoing project for adding a concurrency model checker to Miri we need to be able to intercept locking/unlocking operations on standard library mutexes. This PR adds diagnostic items to the relevant calls `lock`, `try_lock` and `unlock` for the `sys::Mutex` implementation on the targets we care about. This PR also makes the internals of `pthread::Mutex` less public, to reduce the chance of anyone locking/unlocking a mutex without going through the intercepted methods. r? ``@RalfJung``
2025-05-29Rollup merge of #141687 - RalfJung:atomic_compare_exchange, r=bjorn3Jacob Pratt-1/+4
core: unstably expose atomic_compare_exchange so stdarch can use it Due to https://github.com/rust-lang/stdarch/issues/1655, cleaning up the atomic intrinsics will be a bunch of extra work: stdarch directly calls them [here](https://github.com/rust-lang/stdarch/blob/8764244589373b8b48864c0ad11fd9233c672249/crates/core_arch/src/x86_64/cmpxchg16b.rs#L58-L74). Instead of duplicating that match, stdarch should use what we have in libcore, so let's expose that. r? `@bjorn3`
2025-05-29Rollup merge of #141684 - petrochenkov:bumponig, r=ehussJacob Pratt-5/+5
rustbook: Bump versions of `onig` and `onig_sys` This fixes the build on GCC 15.
2025-05-29Rollup merge of #141683 - compiler-errors:unsafe-binder-capture, r=oli-obkJacob Pratt-2/+9
Handle ed2021 precise capturing of unsafe binder Missing pieces from last pr. r? oli-obk Fixes https://github.com/rust-lang/rust/issues/141655
2025-05-29Rollup merge of #141682 - nia-e:fixup-alloc, r=RalfJungJacob Pratt-1/+1
interpret/allocation: Fixup type for `alloc_bytes` This can be `FnOnce`, which helps us avoid an extra clone in rust-lang/miri#4343 r? RalfJung
2025-05-29Rollup merge of #141680 - davidjsonn:master, r=oli-obkJacob Pratt-1/+1
replace TraitRef link memory.md Hi, I fixed broken links in the documentation and replaced them with working ones. https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TraitRef.html - old link https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/type.TraitRef.html - new link