Commit Graph

291081 Commits

Author SHA1 Message Date
Lukas Wirth
23738b5d17 Merge pull request #19890 from Veykril/push-kzzntrpllsqx
fix: Fix import insertion not being fully cfg aware
2025-05-29 13:06:12 +00:00
Guillaume Gomez
b1723fc83b Centralize the eslint version between tidy and docker 2025-05-29 15:06:08 +02:00
Lukas Wirth
087cfe3c9f fix: Fix import insertion not being fully cfg aware 2025-05-29 14:55:09 +02:00
Mu001999
6eb6010368 Add test for issue 127911 and 128839 2025-05-29 20:51:51 +08:00
Guillaume Gomez
f0f661db2b Install eslint in host-x86_64 Dockerfile 2025-05-29 14:50:48 +02:00
onur-ozkan
0d9f25bb4f resolve target-libdir directly from rustc
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-29 15:45:32 +03:00
onur-ozkan
0565d43060 resolve stage0 sysroot from rustc
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-29 15:40:07 +03:00
bors
13718eb788 Auto merge of #141595 - bjorn3:rustc_no_sysroot_proc_macro, r=onur-ozkan
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-29 12:07:53 +00:00
Michael Goulet
9871e160ea Normalize possibly unnormalized type in relate_type_and_user_type 2025-05-29 11:20:45 +00:00
Piotr Osiewicz
8c8d2c2e12 creader: Remove extraenous String::clone 2025-05-29 13:17:29 +02:00
Michael Goulet
2a339ce492 Structurally normalize types as needed in projection_ty_core 2025-05-29 11:16:44 +00:00
Michael Goulet
f1da288557 Tweak fast path trait handling 2025-05-29 11:14:36 +00:00
Piotr Osiewicz
9b3be2599a cstore: Use IndexSet as backing store for postorder dependencies
<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-29 13:02:20 +02:00
Esteban Küber
f80e3ac4ed Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics
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-29 10:24:23 +00:00
Ralf Jung
af48d429a3 Merge pull request #4355 from RalfJung/rustup
Rustup
2025-05-29 10:21:35 +00:00
Jonathan Brouwer
8e5d57902f Fix false documentation 2025-05-29 12:10:50 +02:00
Ralf Jung
1b6a290656 Merge from rustc 2025-05-29 11:51:37 +02:00
Ralf Jung
c9addbe0e5 Preparing for merge from rustc 2025-05-29 11:51:21 +02:00
Folkert de Vries
b2e9c72e72 emit_xtensa_va_arg: use inbounds_ptradd instead of inbounds_gep 2025-05-29 11:21:19 +02:00
Michael Goulet
73382e4417 Bump rustc-perf and update PGO crates 2025-05-29 09:00:36 +00:00
bors
8afd71079a Auto merge of #141717 - jhpratt:rollup-neu8nzl, r=jhpratt
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-29 08:53:27 +00:00
bors
660aede530 Auto merge of #141717 - jhpratt:rollup-neu8nzl, r=jhpratt
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-29 08:53:27 +00:00
许杰友 Jieyou Xu (Joe)
1c7bcb19b4 Merge pull request #2425 from jieyouxu/adjust-triagebot 2025-05-29 16:38:11 +08:00
Jieyou Xu
c0f73ad591 triagebot: update [issue-links] config 2025-05-29 16:37:09 +08:00
Jieyou Xu
b0da981afd triagebot: add doc backlink for [no-mentions] 2025-05-29 16:37:09 +08:00
Jieyou Xu
c7fe997e98 triagebot: enable note functionality 2025-05-29 16:37:06 +08:00
Jieyou Xu
effdfb4bb3 triagebot: enable issue transfer 2025-05-29 16:37:02 +08:00
Jieyou Xu
cc9dca1bcf triagebot: enable PR review status flipping and its shortcuts 2025-05-29 16:15:04 +08:00
Jieyou Xu
a8464e6145 triagebot: apply needs-triage label for new issues 2025-05-29 16:13:03 +08:00
Jieyou Xu
dc345b0eb1 triagebot: adjust allow-unauthenticated labels 2025-05-29 16:12:35 +08:00
Jakub Beránek
059bc382aa Provide secrets to try builds with new bors 2025-05-29 09:49:59 +02:00
Lukas Wirth
f06e37674d Merge pull request #19888 from Veykril/push-wylsryzpnnop
fix: Recognize salsa cycles in `thread_result_to_response`
2025-05-29 07:10:03 +00:00
Lukas Wirth
d2bc36821f fix: Recognize salsa cycles in thread_result_to_response 2025-05-29 08:57:45 +02:00
bors
38081f22c2 Auto merge of #141716 - jhpratt:rollup-9bjrzfi, r=jhpratt
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-29 05:41:04 +00:00
Deadbeef
367a877147 avoid some usages of &mut P<T> in AST visitors 2025-05-29 12:54:55 +08:00
Deadbeef
5e7185583f remove visit_clobber and move DummyAstNode to rustc_expand
`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-29 12:46:26 +08:00
Jacob Pratt
ee3e807f90 Rollup merge of #141656 - ehuss:cargo-aarch64-macos, r=marcoieni,jieyouxu
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-29 04:50:48 +02:00
Jacob Pratt
bf1343b963 Rollup merge of #141571 - RalfJung:float-tests, r=tgross35
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-29 04:50:47 +02:00
Jacob Pratt
ba042d7cb1 Rollup merge of #139994 - tamird:cstr-display, r=Amanieu
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-29 04:50:47 +02:00
Jacob Pratt
8951c74e2a Rollup merge of #138285 - beetrees:repr128-stable, r=traviscross,bjorn3
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](385970f0c1/tests/ui/enum-discriminant/repr128.rs): checks that 128-bit enum discriminants have the correct values.
- [debuginfo/msvc-pretty-enums.rs](385970f0c1/tests/debuginfo/msvc-pretty-enums.rs): checks the PDB debuginfo is correct.
- [run-make/repr128-dwarf](385970f0c1/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-29 04:50:46 +02:00
Jacob Pratt
4327a7c202 Rollup merge of #141702 - eholk:eholk-reviewers, r=aDotInTheVoid
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-29 04:49:47 +02:00
Jacob Pratt
e7ef07a523 Rollup merge of #141690 - Patrick-6:intercept-mutex, r=m-ou-se
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-29 04:49:47 +02:00
Jacob Pratt
f4dcb7fad0 Rollup merge of #141687 - RalfJung:atomic_compare_exchange, r=bjorn3
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](8764244589/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-29 04:49:46 +02:00
Jacob Pratt
643f9c2f11 Rollup merge of #141684 - petrochenkov:bumponig, r=ehuss
rustbook: Bump versions of `onig` and `onig_sys`

This fixes the build on GCC 15.
2025-05-29 04:49:46 +02:00
Jacob Pratt
dc22509663 Rollup merge of #141683 - compiler-errors:unsafe-binder-capture, r=oli-obk
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-29 04:49:45 +02:00
Jacob Pratt
e987a99ed2 Rollup merge of #141682 - nia-e:fixup-alloc, r=RalfJung
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-29 04:49:45 +02:00
Jacob Pratt
bab9879932 Rollup merge of #141680 - davidjsonn:master, r=oli-obk
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
2025-05-29 04:49:44 +02:00
Jacob Pratt
f7a97cc7b2 Rollup merge of #141675 - nnethercote:ItemKind-field-order, r=fee1-dead
Reorder `ast::ItemKind::{Struct,Enum,Union}` fields.

So they match the order of the parts in the source code, e.g.:
```
struct Foo<T, U> { t: T, u: U }
       <-><----> <------------>
       /   |       \
   ident generics  variant_data
```

r? `@fee1-dead`
2025-05-29 04:49:43 +02:00
Jacob Pratt
0ac0285c3f Rollup merge of #141675 - nnethercote:ItemKind-field-order, r=fee1-dead
Reorder `ast::ItemKind::{Struct,Enum,Union}` fields.

So they match the order of the parts in the source code, e.g.:
```
struct Foo<T, U> { t: T, u: U }
       <-><----> <------------>
       /   |       \
   ident generics  variant_data
```

r? `@fee1-dead`
2025-05-29 04:49:43 +02:00
Jacob Pratt
e96b112672 Rollup merge of #141643 - marcoieni:codebuild-check, r=Kobzol
ci: verify that codebuild jobs use ghcr.io
2025-05-29 04:49:43 +02:00