Commit graph

298901 commits

Author SHA1 Message Date
Jakub Beránek
e036a564e4
Rollup merge of #142431 - Kobzol:bootstrap-snapshot-tests, r=jieyouxu
Add initial version of snapshot tests to bootstrap

When making any changes to bootstrap (steps), it is very difficult to realize how does it affect various common bootstrap commands, and if everything still works as we expect it to. We are far away from having actual end-to-end tests, but what we could at least do is have a way of testing what steps does bootstrap execute in dry run mode. Now, we already have something like this in `src/bootstrap/src/core/builder/tests.rs`, however that is quite limited, because it only checks executed steps for a specific impl of `Step` and it does not consider step order.

Recently, when working on what I thought was one of the simplest possible step untanglings in bootstrap (https://github.com/rust-lang/rust/pull/142357), I ran into errors in tests that were quite hard to debug. Partly also because the current staging test diffs are multiline and use `Debug` output, so it's quite difficult for me to make sense of them.

In this PR, I introduce `insta`, which allows writing snapshot tests in a very simple way. With it, I want to allow writing tests that will clearly show us what is going on during bootstrap execution, and then write golden tests for `build/check/test` stage `0/1/2` for compiler/std/tools etc., to make sure that we don't regress something, and also to help with [#t-infra/bootstrap > Proposal to cleanup stages and steps after the redesign](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Proposal.20to.20cleanup.20stages.20and.20steps.20after.20the.20redesign/with/523488806), to help avoid a situation where we would (again) have to make a flurry of staging changes because of unexpected consequences.

In the snapshot tests, we currently render the build of rustc, std and LLVM. Currently I render the executed steps using downcasting, which is not super pretty, but it allows us to make the test rendering localized in one place, and it's IMO enough for now.

I implemented only a single test using the new machinery. Maybe if you take a look at it, you will understand why 😆 Bootstrap currently does some peculiar things, such as running a stage 0 std step (even though stage 0 std no longer exists) and running the Rustc stage 0 -> 1 step twice, once with a single crates, once with all rustc crates. So I think that even with this single step, there will be a bunch of things to fix in the near future...

The way we currently prepare the Config test fixtures is far from ideal, this is something I think ``@Shourya742`` could work on as a part of their GSoC project (remove as much command execution from Config construction as possible, actually run bootstrap on a temporary directory instead of running it on the rustc checkout, create a Builder-like API for creating the Config test fixtures).

r? ``@jieyouxu``
2025-06-16 14:31:12 +02:00
Jakub Beránek
ac8a48dad2
Rollup merge of #142416 - Kobzol:bootstrap-cleanup-2, r=jieyouxu
Assorted bootstrap cleanups (step 2)

Very small improvements designed towards making bootstrap tests less hacky/special, and towards making it possible to run bootstrap tests in parallel.

Best reviewed commit by commit.

r? ``@jieyouxu``
2025-06-16 14:31:11 +02:00
Jakub Beránek
d9c83bb033
Rollup merge of #142373 - m-ou-se:debug-for-location, r=tgross35
Fix Debug for Location

Fixes https://github.com/rust-lang/rust/issues/142279
2025-06-16 14:31:11 +02:00
Jakub Beránek
6092c1a074
Rollup merge of #142236 - yotamofek:pr/std/pathbuf-extend-docs, r=tgross35
Add documentation for `PathBuf`'s `FromIterator` and `Extend` impls

I think it's not very obvious that `PathBuf`'s `Extend` and `FromIterator` impls work like `PathBuf::push`, so I think these should be documented.
I'm not very happy with the wording and examples, open to suggestions :)
2025-06-16 14:31:10 +02:00
Jakub Beránek
c4e11743b2
Rollup merge of #142125 - cberner:file_lock_stable, r=ChrisDenton
Stabilize "file_lock" feature

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

r? ```@joshtriplett```
2025-06-16 14:31:10 +02:00
Jakub Beránek
3795658357
Rollup merge of #142082 - xizheyin:rustc_attr_data_structures, r=jdonszelmann
Refactor `rustc_attr_data_structures` documentation

I was reading through `AttributeKind` and realized that attributes like `InlineAttr` didn't appear in it, however, I found them in `rustc_codegen_ssa` and understood why (guessing).

There's almost no overall documentation for this crate, I've added the organized documentation at the top of `lib.rs`, and I've grouped the Attributes into two categories: `AttributeKind` that run all through the compiler, and the ones that are only used in `codegen_ssa`, such as `InlineAttr`, `OptimizeAttr`, `InstructionSetAttr`.

Also, I've added documentation for `AttributeKind` that further explains why attributes like `InlineAttr` don't appear in it, with examples for each variant.

r? ```@jdonszelmann```
2025-06-16 14:31:09 +02:00
Jakub Beránek
34160872f2
Rollup merge of #141639 - NotLebedev:stable-mir-93, r=oli-obk
Expose discriminant values in stable_mir

Resolves https://github.com/rust-lang/project-stable-mir/issues/93
* Added `Discr` struct to stable mir as stable version of struct with same name
* Added `discriminant_for_variant`  method to `AdtDef` and `CoroutineDef`
2025-06-16 14:31:08 +02:00
Guillaume Gomez
9848c66a36 Fix warnings 2025-06-16 14:23:45 +02:00
Marijn Schouten
de5c5065fc update to literal-escaper 0.0.4 for better API without unreachable and faster string parsing 2025-06-16 15:12:24 +03:00
lcnr
7fb9284fb3 candidate_is_applicable to method 2025-06-16 14:01:01 +02:00
Mark Rousskov
7c1553c85b Bless unicode test
Most likely caused by updating unicode-width v0.2.0 -> v0.2.1,
the change seems reasonable enough.
2025-06-16 07:30:09 -04:00
bors
d9ca9bd014 Auto merge of #142556 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-06-16 11:25:56 +00:00
Guillaume Gomez
9b09948897 Extend num tests on usize and isize as well 2025-06-16 11:54:15 +02:00
Guillaume Gomez
aec32486a8 Specialize ToString implementation on u128 and i128 2025-06-16 11:54:15 +02:00
Jieyou Xu
32c0cb0f5a
Add union with default field values case test
In particular, there should be no additional errors (default field
values for `union` fields are currently erroneously accepted).
2025-06-16 17:54:13 +08:00
Jakub Beránek
60a59ae523
Emit linker timing section 2025-06-16 11:51:17 +02:00
Jakub Beránek
c9d305952e
Add infrastructure for emitting timing sections 2025-06-16 11:51:17 +02:00
Jakub Beránek
7ad5248c95
Add parsing of --json=timings 2025-06-16 11:28:42 +02:00
Guillaume Gomez
0e141a2be1 Implement _fmt on u128 2025-06-16 11:27:28 +02:00
beetrees
e3916036f9 Fix RISC-V C function ABI when passing/returning structs containing floats 2025-06-16 10:14:07 +01:00
beetrees
308ca33774 Fix RISC-V C function ABI when passing/returning structs containing floats 2025-06-16 10:14:07 +01:00
beetrees
5723c9997c
Fix RISC-V C function ABI when passing/returning structs containing floats 2025-06-16 10:14:07 +01:00
Jakub Beránek
743c2a4c71
Fix -nopt CI jobs
They were using `--config` instead of `--set`, which overrides too much stuff.
2025-06-16 10:28:55 +02:00
bjorn3
d28fabeb6c Test naked asm for wasm32-unknown-unknown 2025-06-16 08:26:17 +00:00
bjorn3
b7cfe2f4db Use the new --debug flag of abi-cafe
As opposed to patching abi-cafe itself.
2025-06-16 08:23:24 +00:00
bjorn3
1ade48fde9 Rustup to rustc 1.89.0-nightly (586ad391f 2025-06-15) 2025-06-16 08:15:58 +00:00
bjorn3
ab385a9916 Sync from rust 586ad391f5 2025-06-16 08:10:49 +00:00
NotLebedev
9505b6e914
Fix test description 2025-06-16 10:51:59 +03:00
NotLebedev
4fc768e097
Add test for AdtDef::discriminant_for_variant polymorphic over parameter 2025-06-16 10:51:59 +03:00
NotLebedev
91a3630f3b
Add test for AdtDef::discriminant_for_variant 2025-06-16 10:51:58 +03:00
NotLebedev
7ce7fc56b8
Implement Stable for Discr 2025-06-16 10:51:58 +03:00
NotLebedev
d4de03208b
Add discriminant_for_variant to CoroutineDef 2025-06-16 10:51:57 +03:00
NotLebedev
94f7790b19
Add discriminant_for_variant to AdtDef 2025-06-16 10:51:47 +03:00
Yotam Ofek
45bbb3dfbf Add documentation for PathBuf's FromIterator and Extend impls 2025-06-16 07:49:27 +00:00
xizheyin
ade2ad9d52
Add documentation on top of rustc_middle/src/query/mod.rs
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-06-16 15:39:32 +08:00
Michał Łowicki
426ab14250
Set MSG_NOSIGNAL for UnixSteam
https://github.com/rust-lang/rust/issues/139956

fix
2025-06-16 09:15:17 +02:00
Laurențiu Nicola
36f2e8fff2
Merge pull request #19994 from sourcefrog/book-links
Fix some links in the book
2025-06-16 07:02:59 +00:00
Trevor Gross
c2b1692be5 Update the backtrace submodule
Pick up the following pull requests:

* ci: remove binary size check (not relevant in rust-lang/rust)
  <https://github.com/rust-lang/backtrace-rs/pull/710>
* Upgrade `ruzstd`, `object`, and `addr2line` to the latest versions
  <https://github.com/rust-lang/backtrace-rs/pull/718>
2025-06-16 07:00:13 +00:00
Nicholas Nethercote
87456e15b2 Remove an njn: comment accidentaly left behind. 2025-06-16 15:18:48 +10:00
Marijn Schouten
e8dfd812dd linked_list tests: less static mut 2025-06-16 04:46:06 +00:00
bors
68ac5abb06 Auto merge of #142521 - sayantn:simplify-intrinsics, r=nikic,workingjubilee
Use `LLVMIntrinsicGetDeclaration` to completely remove the hardcoded intrinsics list

Follow-up to rust-lang/rust#142259

This also needs a rustc-perf run, because `Intrinsic::getType` can be expensive

`@rustbot` label A-LLVM A-codegen T-compiler
r? `@workingjubilee`
cc `@nikic`
2025-06-16 03:40:18 +00:00
Mara Bos
5ac1cd9c7d Test Debug for Location. 2025-06-16 03:14:44 +00:00
王宇逸
3cb0cba054 Handle win32 separator & prefixes for cygwin paths 2025-06-16 09:24:07 +08:00
bors
e314b97ee5 Auto merge of #142550 - fmease:rollup-fteyzcv, r=fmease
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#133952 (Remove wasm legacy abi)
 - rust-lang/rust#134661 (Reduce precedence of expressions that have an outer attr)
 - rust-lang/rust#141769 (Move metadata object generation for dylibs to the linker code )
 - rust-lang/rust#141937 (Report never type lints in dependencies)
 - rust-lang/rust#142347 (Async drop - fix for StorageLive/StorageDead codegen for pinned future)
 - rust-lang/rust#142389 (Apply ABI attributes on return types in `rustc_codegen_cranelift`)
 - rust-lang/rust#142470 (Add some missing mailmap entries)
 - rust-lang/rust#142481 (Add `f16` inline asm support for LoongArch)
 - rust-lang/rust#142499 (Remove check run bootstrap)
 - rust-lang/rust#142543 (Suggest adding semicolon in user code rather than macro impl details)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-16 00:39:47 +00:00
Nicholas Nethercote
248b7a9490 Fix PathSource lifetimes.
It currently has two, which don't accurately capture what's happening --
the `TupleStruct` spans are allocated in `ResolverArenas`, which is
different to where the `Expr` is allocated -- and require some
"outlives" constraints to be used.

This commit adds another lifetime, renames the existing ones, and
removes the "outlives" constraints.
2025-06-16 10:33:00 +10:00
Samuel Tardieu
4d67a1c64a
Fix FP of identity_op when encountering Default::default() (#15028)
Fixes: rust-lang/rust-clippy#14932

changelog: Fix false positive of [`identity_op`] when encountering
`Default::default()`.
2025-06-15 22:16:14 +00:00
León Orell Valerian Liehr
07048643dd
Rollup merge of #142543 - Urgau:span-borrowck-semicolon, r=fmease
Suggest adding semicolon in user code rather than macro impl details

This PR tries to find the right span (by peeling expansion) so that the suggestion for adding a semicolon is suggested in user code rather than in the expanded code (in the example a macro impl).

Fixes rust-lang/rust#139049
r? `@fmease`
2025-06-15 23:51:58 +02:00
León Orell Valerian Liehr
b83fb800a7
Rollup merge of #142499 - Shourya742:2025-06-14-remove-check-run-bootstrap, r=Kobzol
Remove check run bootstrap

This PR migrates all usage of check_run to new execution context api's.

r? `@Kobzol`
2025-06-15 23:51:58 +02:00
León Orell Valerian Liehr
5cce691c5a
Rollup merge of #142481 - heiher:loong-asm-f16, r=Amanieu
Add `f16` inline asm support for LoongArch

r? `````@Amanieu`````
2025-06-15 23:51:57 +02:00
León Orell Valerian Liehr
1c99762df8
Rollup merge of #142470 - tgross35:mailmap, r=Mark-Simulacrum
Add some missing mailmap entries
2025-06-15 23:51:57 +02:00