Commit graph

164232 commits

Author SHA1 Message Date
A4-Tacks
9909a37fdc
Use hir::Trait in parameter 2025-07-16 19:51:16 +08:00
A4-Tacks
9ba661ebdb
Remove redundant type parameters 2025-07-16 17:17:00 +08:00
A4-Tacks
e0bb7299d0
Add AsRef and Borrow for generate_mut_trait_impl
- AsRef -> AsMut
- Borrow -> BorrowMut

Example
====================

```rust
//- minicore: as_ref
struct Foo(i32);

impl<T> core::convert::AsRef$0<i32> for Foo {
    fn as_ref(&self) -> &i32 {
        &self.0
    }
}
```
->
```rust
struct Foo(i32);

$0impl<T> core::convert::AsMut<i32> for Foo {
    fn as_mut(&mut self) -> &mut i32 {
        &self.0
    }
}

impl<T> core::convert::AsRef<i32> for Foo {
    fn as_ref(&self) -> &i32 {
        &self.0
    }
}
```
2025-07-16 17:16:56 +08:00
Shoyu Vanilla (Flint)
42758bbbd5
Merge pull request #20178 from ShoyuVanilla/cargo-config-cleanup
chore: Cleanup cargo config queries
2025-07-15 16:13:30 +00:00
Laurențiu Nicola
28f822f100 Format and bump rustc crates 2025-07-15 17:41:08 +03:00
Laurențiu Nicola
48f9a7cb3c Merge from rust-lang/rust 2025-07-15 17:27:46 +03:00
Laurențiu Nicola
ec3443f573 Preparing for merge from rust-lang/rust 2025-07-15 17:27:21 +03:00
Shoyu Vanilla
a65e2f0e90 Further decrease number of cargo metadata invokes 2025-07-15 22:49:16 +09:00
Shoyu Vanilla
0a037425ca chore: Cleanup cargo config queries 2025-07-15 22:49:16 +09:00
Chayim Refael Friedman
1d3ea1fd6e Infer lifetimes for GATs in expression/pattern position
We should not only in type position.
2025-07-15 01:15:33 +03:00
bors
a001497644 Auto merge of #143745 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Cargo.lock update due to `ui_test` bump and restructure.
2025-07-14 19:53:18 +00:00
Samuel Tardieu
084bd581b7
Rollup merge of #143870 - jieyouxu:compiletest-maintenance-6, r=Kobzol
[COMPILETEST-UNTANGLE 6/N] Use `TestSuite` enum instead of stringly-typed test suites

This is part of a patch series to untangle `compiletest` to hopefully nudge it towards being more maintainable.

This PR should contain no functional changes.
2025-07-14 18:05:46 +02:00
Samuel Tardieu
c59bc44ca9
Rollup merge of #143848 - makai410:smir-rename, r=oli-obk
Rename `stable_mir` and `rustc_smir`

This PR only renames the two crate names.

There is no doubt that we want to rename `stable_mir` to `rustc_public`, while it hasn't been discussed yet that what the new name for `rustc_smir` should be.

This PR proposes a new name for `rustc_smir`, that is `rustc_public_shim`, since `rustc_smir` now is mostly a proxy to do calls to rustc queries and the public API of rustc that is invoked by the `rustc_public` crate.

However, I don't think that name is good enough. I hope there would be a way better name.

r? `@oli-obk`
2025-07-14 18:05:44 +02:00
Samuel Tardieu
30b46e3f8c
Rollup merge of #143710 - joshtriplett:random-updates, r=joshtriplett
Updates to random number generation APIs

Updates based on discussions about random number generation.

- Add comment on `RandomSource::fill_bytes` about multiple calls, to allow
  efficient implementations for random sources that generate a word at a time.

- Drop the `Random` trait in favor of `Distribution<T>`, which will let people
  make calls like random(1..=6), and which allows for future expansion to
  non-uniform distributions, as well as floating-point. (For now, this is only
  implemented for `RangeFull`, to get the interface in place. Subsequent PRs
  will implement it for other range types.)
2025-07-14 18:05:44 +02:00
bors
cccf075eba Auto merge of #143919 - Kobzol:rollup-acyaygs, r=Kobzol
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#143217 (Port #[link_ordinal] to the new attribute parsing infrastructure)
 - rust-lang/rust#143681 (bootstrap/miri: avoid rebuilds for test builds)
 - rust-lang/rust#143724 (Tidy cleanup)
 - rust-lang/rust#143733 (Change bootstrap's `tool.TOOL_NAME.features` to work on any subcommand)
 - rust-lang/rust#143850 (Compiletest: Simplify {Html,Json}DocCk directive handling)
 - rust-lang/rust#143875 (update issue number for `const_trait_impl`)
 - rust-lang/rust#143881 (Use zero for initialized Once state)
 - rust-lang/rust#143887 (Run bootstrap tests sooner in the `x test` pipeline)
 - rust-lang/rust#143917 (Change "allocated object" to "allocation".)
 - rust-lang/rust#143918 (Tier check cleanup)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-14 12:17:15 +00:00
Jieyou Xu
b19a508b90
Use TestSuite enum instead of stringly-typed test suites 2025-07-14 17:44:50 +08:00
Makai
6598c61725 rename stable_mir to rustc_public, and rustc_smir to rustc_public_bridge 2025-07-14 09:25:54 +00:00
Jakub Beránek
0d69847b3c
Rollup merge of #143918 - hkBst:tier-check-cleanup, r=Kobzol
Tier check cleanup

clippy cleanup + edition 2024
2025-07-14 11:04:57 +02:00
Jakub Beránek
37b5d79108
Rollup merge of #143887 - Kobzol:reroder-bootstrap-tests, r=jieyouxu
Run bootstrap tests sooner in the `x test` pipeline

With the recently added bootstrap snapshot tests, and in general with our plans to test more things in bootstrap, I feel like the original comment isn't accurate anymore. Recently, on several occasions I had to wait for 40+ minutes of CI just to find out that the bootstrap snapshot tests have failed. I think we should run bootstrap tests towards the beginning instead now.

r? ```@jieyouxu```
2025-07-14 11:04:56 +02:00
Jakub Beránek
a7ad680269
Rollup merge of #143875 - fee1-dead-contrib:push-zvqrmzrprpzt, r=compiler-errors
update issue number for `const_trait_impl`

r? project-const-traits

cc rust-lang/rust#67792 rust-lang/rust#143874
2025-07-14 11:04:55 +02:00
Jakub Beránek
2ec48e0489
Rollup merge of #143850 - fmease:comptest-simp-docck-handling, r=jieyouxu
Compiletest: Simplify {Html,Json}DocCk directive handling

So much more maintainable and extensible.

r? ````@jieyouxu```` as discussed
2025-07-14 11:04:54 +02:00
Jakub Beránek
197ba7e4f1
Rollup merge of #143733 - Stypox:bootstrap-tool-config-any, r=Kobzol
Change bootstrap's `tool.TOOL_NAME.features` to work on any subcommand

This is a followup to rust-lang/rust#142379 to make the bootstrap option `tool.TOOL_NAME.features` work on any subcommand instead of just build (so also run/test/...). I also made the `TOOL_NAME` comparisons look at the tool path instead of the tool name to determine to which tool a `TOOL_NAME` refers to, so you can specify tools by path like in other places of the bootstrap (e.g. `tool."tools/miri".features`).
2025-07-14 11:04:54 +02:00
Jakub Beránek
0d4d85b9ea
Rollup merge of #143724 - hkBst:tidy-cleanup, r=Mark-Simulacrum
Tidy cleanup
2025-07-14 11:04:53 +02:00
Jakub Beránek
33d477fe31
Rollup merge of #143681 - RalfJung:bootstrap-miri-rebuilds, r=Kobzol
bootstrap/miri: avoid rebuilds for test builds

When building Miri in its own repo, we always build with `--all-targets`:
a009612691/src/tools/miri/miri-script/src/util.rs (L167-L174)
This saves a bunch of time since some of Miri's dependencies get more features enabled by some of Miri's dev-dependencies, and they all get built twice otherwise if you do `cargo build && cargo test` (which is typically what you end up doing inside `./miri test` and also inside `./x test miri`).

This applies the same approach to bootstrap, drastically reducing the edit-compile cycle for Miri work here. :)
2025-07-14 11:04:52 +02:00
bors
64b185edda Auto merge of #143873 - dianqk:update-llvm, r=nikic
Update LLVM to 20.1.8

I made a new branch with patches that aren't yet in LLVM 20.1.8.
2025-07-14 08:58:27 +00:00
Marijn Schouten
39059f6181 tiercheck: edition 2024 2025-07-14 08:30:27 +00:00
Marijn Schouten
90660f4d50 tiercheck: clippy fixes 2025-07-14 08:19:58 +00:00
Stypox
b3ed03529f
Only compare tool name to apply features to 2025-07-14 09:37:24 +02:00
Stypox
937ef9381c
Bootstrap's tool.TOOL_NAME.features now works on any subcommand 2025-07-14 09:37:23 +02:00
Shoyu Vanilla (Flint)
356a54df2e
Merge pull request #20234 from Hmikihiro/migrate_ted_remove_default
Remove `ConstParam::remove_default` and `TypeParam::remove_default` to migrate from ted
2025-07-14 06:42:36 +00:00
bors
ad635e5d06 Auto merge of #143779 - JonathanBrouwer:automatically_derived_parser, r=oli-obk
Port `#[automatically_derived]` to the new attribute parsing infrastructure

Ports `#[automatically_derived]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163

r? `@oli-obk`
cc `@jdonszelmann`
2025-07-14 04:29:53 +00:00
bors
9c3064e131 Auto merge of #143357 - cjgillot:no-assoc-item-kind, r=compiler-errors
Retire hir::*ItemRef.

This information was kept for various places that iterate on HIR to know about trait-items and impl-items.

This PR replaces them by uses of the `associated_items` query that contain pretty much the same information.

This shortens many spans to just `def_span`, which can be easier to read.
2025-07-13 22:39:10 +00:00
Chayim Refael Friedman
a96ad09757
Merge pull request #20236 from gvozdvmozgu/patch-1
remove now useless `#[allow(unused_lifetimes)]`
2025-07-13 17:45:06 +00:00
Deadbeef
6b02597ed3 update issue number for const_trait_impl 2025-07-13 23:55:06 +08:00
León Orell Valerian Liehr
25794b14c1
Compiletest: Simplify {Html,Json}DocCk directive handling 2025-07-13 16:00:23 +02:00
Camille GILLOT
21fd82adbc Retire hir::*ItemRef. 2025-07-13 13:50:01 +00:00
Camille GILLOT
5bd3841668 Retire hir::ForeignItemRef. 2025-07-13 13:50:00 +00:00
Camille GILLOT
277b0ecf34 Remove hir::AssocItemKind. 2025-07-13 13:50:00 +00:00
Matthias Krüger
3ff549f6d3
Rollup merge of #143826 - Shourya742:2025-07-12-fix-command-trace, r=Kobzol
Fix command trace

With the recent developments in centralization of command execution, we somehow broke the traces for command execution. This PR fixes that and add trace to stream command execution as well.

r? ````@Kobzol````
2025-07-13 15:16:02 +02:00
Matthias Krüger
5284c84725
Rollup merge of #143825 - RalfJung:clippy-test-filter, r=llogiq
clippy: fix test filtering when TESTNAME is empty

Fixes https://github.com/rust-lang/rust/issues/143824. Turns out bootstrap was just fine, the TESTNAME logic in clippy was wrong... I still made this a rustc PR as that's where I did all the debugging.

The bootstrap change is not really related, but it's comment-only so not worth a separate PR... adding the `test_args` is also part of what `prepare_cargo_test` would usually do so let's group the code properly.
2025-07-13 15:16:02 +02:00
Matthias Krüger
ee1595cc68
Rollup merge of #143786 - nikic:ci-job-name-fallback, r=marcoieni
Fix fallback for CI_JOB_NAME

If CI_JOB_NAME is not specified, it's supposed to fall back to the image name, which is `$image`, not `$IMAGE`.

Failing to set the correct CI_JOB_NAME causes failures when running `dist-ohos-*` images locally.
2025-07-13 15:16:01 +02:00
Matthias Krüger
b4b00c7d10
Rollup merge of #143785 - bjorn3:faster_ra_build_script_build, r=Kobzol
Add --compile-time-deps argument for x check

Together with skipping building C++ code in rustc_llvm for check, this reduces the amount of time it takes to do the x check for rust-analyzer analysis from 12m16s to 3m06s when the bootstrap compiler is already downloaded.
2025-07-13 15:16:00 +02:00
Matthias Krüger
762b3143fc
Rollup merge of #143634 - nia-e:init-and-wildcards, r=RalfJung
interpret/allocation: expose init + write_wildcards on a range

Part of https://github.com/rust-lang/miri/pull/4456, so that we can mark down when a foreign access to our memory happened. Should this also move `prepare_for_native_access()` itself into Miri, given that everything there can be implemented on Miri's side?

r? `````@RalfJung`````
2025-07-13 15:15:58 +02:00
Jakub Beránek
a3c90b69af
Run bootstrap tests sooner in the x test pipeline 2025-07-13 14:38:33 +02:00
Andrey Nikolaev
7f2064e080
remove now useless [allow(unused_lifetimes)] 2025-07-13 05:43:05 -04:00
bors
0fb279be1d Auto merge of #143867 - fmease:rollup-5tll6m9, r=fmease
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#143776 (std: move NuttX to use arc4random for random number generation)
 - rust-lang/rust#143778 (Some const_trait_impl test cleanups)
 - rust-lang/rust#143782 (Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests)
 - rust-lang/rust#143791 (Update sysinfo version to `0.36.0`)
 - rust-lang/rust#143796 (Fix ICE for parsed attributes with longer path not handled by CheckAttribute)
 - rust-lang/rust#143798 (Remove format short command trait)
 - rust-lang/rust#143803 (New tracking issues for const_ops and const_cmp)
 - rust-lang/rust#143814 (htmldocck: better error messages for some negative directives)
 - rust-lang/rust#143817 (Access `wasi_sdk_path` instead of reading environment variable in bootstrap)
 - rust-lang/rust#143822 (./x test miri: fix cleaning the miri_ui directory)
 - rust-lang/rust#143823 ([COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups)
 - rust-lang/rust#143841 (Label clippy changes with `T-clippy`)

Failed merges:

 - rust-lang/rust#143850 (Compiletest: Simplify {Html,Json}DocCk directive handling)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-13 08:24:04 +00:00
dianqk
0ba392c9bd
Update LLVM to 20.1.8 2025-07-13 15:45:56 +08:00
León Orell Valerian Liehr
bb330bbc50
Rollup merge of #143823 - jieyouxu:compiletest-maintenance-5, r=Kobzol
[COMPILETEST-UNTANGLE 5/N] Test mode adjustments and other assorted cleanups

This is part of a patch series to untangle `compiletest` to hopefully nudge it towards being more maintainable.

This PR should contain no functional changes modulo the removed debugger version warning.

- Commit 1: Removes a very outdated debugger version warning.
- Commit 2: Moves `string_enum` out of `common` into `util` module.
- Commit 3: Remove `#[derive(Default)` for `Mode` and `Config`. It is very important for correctness that we *don't* `#[derive(Default)]`, because there are no sensible defaults, so stop pretending there is.
- Commit 4: Rename `Mode` -> `TestMode`, because I would like to introduce a `TestSuite` enum to stop using stringly-typed test suite names where test mode names can be the same as test suite names, and we also have a bunch of other "modes" in compiletest. Make this as unambiguous as possible. A corollary is that now it's more natural to reference via intra-doc links as ``[`TestMode`]``.
- Commit 5: Ditto on `TestSuite`, stop glob-reexporting `TestMode::*` variants, and always use `EnumName::VariantName` form.
- Commit 6: Apparently, `src/tools/rustdoc-gui-test/` depends on `compiletest` for `//@ {compile,run}-paths` directive parsing and extraction, which involves creating a dummy `compiletest` config (hence the existence of the default impls removed in Commit 3). Make this a specific associated function with a FIXME pointing to rust-lang/rust#143827 as I think this setup is quite questionable.

Commits {4, 5} are also intended to help improve the self-consistency in nomenclature used within compiletest.

Best reviewed commit-by-commit.
2025-07-13 07:21:25 +02:00
León Orell Valerian Liehr
2cbd0bc27c
Rollup merge of #143822 - RalfJung:miri-ui-clean, r=jieyouxu
./x test miri: fix cleaning the miri_ui directory

Fixes https://github.com/rust-lang/rust/issues/143680
2025-07-13 07:21:24 +02:00
León Orell Valerian Liehr
886ad3a947
Rollup merge of #143817 - Kobzol:wasi-sdk-path, r=jieyouxu
Access `wasi_sdk_path` instead of reading environment variable in bootstrap

Small cleanup to remove an environment variable read that we have performed earlier in bootstrap already.
2025-07-13 07:21:24 +02:00