about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-07-16Auto merge of #144019 - RalfJung:miri-sync, r=RalfJungbors-590/+1149
Miri subtree update r? `@ghost`
2025-07-16use `codegen_instance_attrs` where an instance is (easily) availableFolkert de Vries-2/+2
2025-07-16set S-waiting-on labels on new PRsRalf Jung-0/+6
2025-07-16triagebot: tweak welcome messageRalf Jung-9/+4
2025-07-17Add tailexpr & -> &mut for generate_mut_trait_implA4-Tacks-5/+20
2025-07-16Merge pull request #19917 from A4-Tacks/ext-generate-mutShoyu Vanilla (Flint)-28/+93
Add AsRef and Borrow for generate_mut_trait_impl
2025-07-16Rollup merge of #143968 - Stypox:tracing-FnAbiOf, r=RalfJungSamuel Tardieu-1/+1
Add tracing to `InterpCx::fn_abi_of_instance/fn_abi_of_fn_ptr` This PR adds tracing to the `InterpCx::fn_abi_of_instance`/`::fn_abi_of_fn_ptr` functions by shadowing `FnAbiOf`'s trait methods with inherent methods on `InterpCx`, like done in rust-lang/rust#142721. The reason why I am targeting these two functions is because they are used for Miri interpretation, and they make a `layout_of` query down the line without passing through the `layout_of` that was traced in rust-lang/rust#142721. There are other places where `layout_of` is called without being traced (see the analysis below), but that's because the `Machine` used there is not `MiriMachine` but rather `CompileTimeMachine` which does not implement `enter_trace_span()`. But after discussing with ```````@RalfJung``````` we agreed that the const-eval part should not be traced together with Miri, that's why I am ignoring the other places where `layout_of` is called. r? ```````@RalfJung``````` <details><summary>Analysis of the places where <code>layout_of</code> is called</summary> I did some analysis for https://github.com/rust-lang/rust/pull/142721#discussion_r2171494841, and these are all the places where the query `tcx.layout_of` is called (directly or indirectly) outside of a traced `InterpCx::layout_of` while a program is being interpreted by Miri: ``` adjust_for_rust_scalar at ./compiler/rustc_ty_utils/src/abi.rs:302:35 {closure#2} at ./compiler/rustc_ty_utils/src/abi.rs:522:25 eval_body_using_ecx<> at ./compiler/rustc_const_eval/src/const_eval/eval_queries.rs:49:22 {closure#1}<> at ./compiler/rustc_const_eval/src/interpret/operand.rs:851:76 {closure#0}<> at ./compiler/rustc_const_eval/src/interpret/stack.rs:612:18 size_and_align at ./compiler/rustc_middle/src/mir/interpret/mod.rs:387:38 ``` I got these by: - patching rustc with this patch that adds a span to the `layout_of` query which prints the backtrace: [layout_of_other_places.diff.txt](https://github.com/user-attachments/files/21235523/layout_of_other_places.diff.txt) - adding this to my bootstrap.toml to have debug symbols inside the Miri binary: `rust.debuginfo-level = "line-tables-only"` and also `build.tool.miri.features = ["tracing"]` - obtaining a trace file with `MIRI_TRACING=1 ./x.py run miri --stage 1 --warnings warn --args src/tools/miri/tests/pass/hello.rs` (note: maybe using a file different than "src/tools/miri/tests/pass/hello.rs" would lead to more places where layout_of is called?) - running this query in Perfetto to select all `layout_of` spans that have as a direct parent a span named "frame" (as opposed to the parent being `InterpCx::layout_of`) and extract their backtrace: `select args.string_value from slice left join args on slice.arg_set_id = args.id where slice.name = "tcx.layout_of" and slice.parent_id in (select slice2.id from slice as slice2 where slice2.name = "frame") group by args.string_value` - exporting the data as `.tsv` and processing that file through this Python script. It finds the first path in the backtraces where "layout" isn't mentioned, which imo is a good heuristic to not consider `layout_of` wrappers/friends as call places, but rather go down the backtrace until an actual call place is reached. [layout_of_other_places.py.txt](https://github.com/user-attachments/files/21235529/layout_of_other_places.py.txt) </details>
2025-07-16Rollup merge of #143957 - samueltardieu:tidy-filenames, r=KobzolSamuel Tardieu-0/+43
tidy: check for invalid file names Check for file names added to git with: - non-UTF8 filenames (this would fail "fmt check" with a decoding error for the moment, but maybe we should not count on it as it is an accidental failure) - control characters (such as "\n" or "\r" in file names) - ":" (which is a special character on Windows, made rust-lang/rust#142936 fail in bors while it could have be caught earlier) It only checks files known by git as a developer might want to have "strange" file names alongside their local repository as long as they don't check them in. r? jieyouxu as he stumbled upon such a file in rust-lang/rust#142936
2025-07-16Rollup merge of #143948 - ehuss:update-mdbook, r=Mark-SimulacrumSamuel Tardieu-3/+3
Update mdbook to 0.4.52 Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0452 This primarily picks up a few fixes.
2025-07-16Rollup merge of #143692 - RalfJung:miri-oob, r=oli-obkSamuel Tardieu-0/+53
miri: fix out-of-bounds error for ptrs with negative offsets r? ```````@oli-obk```````
2025-07-16Rollup merge of #143448 - Enselic:remote-test-client-signals, r=Mark-SimulacrumSamuel Tardieu-1/+3
remote-test-client: Exit code `128 + <signal-number>` instead of `3` If the remote process is terminated by a signal, make `remote-test-client` exit with the code `128 + <signal-number>` instead of always `3`. This follows common practice among tools such as bash [^1]: > When a command terminates on a fatal signal whose number is N, Bash uses the > value 128+N as the exit status. It also allows us to differentiate between `run-pass` and `run-crash` ui tests without special case code in compiletest for that when `remote-test-client` is used. See https://github.com/rust-lang/rust/pull/143002 and in particular https://github.com/rust-lang/rust/pull/143002#issuecomment-3037061667. Exiting with code `3` has been done from the start (see https://github.com/rust-lang/rust/pull/39400) and seems arbitrary rather than a deliberate design decision, so changing it does not seem like an extraordinarily big deal. ### Regression testing Note that https://github.com/rust-lang/rust/pull/143002 will act as a regression test once it is rebased on this PR. ### Why a separate PR I think it is comforting to know that CI does not break with just this change. But if my reviewer prefers, we can move this commit to be part of https://github.com/rust-lang/rust/pull/143002 instead. [^1]: https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html
2025-07-16Add AsMut to minicore prelude::v1A4-Tacks-0/+1
2025-07-16Update rustdoc search tester to new alias outputGuillaume Gomez-25/+46
2025-07-16triagebot welcome message for new usersRalf Jung-1/+12
2025-07-16Use hir::Trait in parameterA4-Tacks-37/+24
2025-07-16Merge pull request #4459 from ibraheemdev/ibraheem/global-ctorRalf Jung-30/+216
Add support for global constructors (i.e. life before main)
2025-07-16minor tweaks and commentsRalf Jung-25/+35
2025-07-16Remove redundant type parametersA4-Tacks-4/+4
2025-07-16Add AsRef and Borrow for generate_mut_trait_implA4-Tacks-18/+96
- 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-16Merge pull request #4456 from nia-e/trace-incorporate-eventsRalf Jung-25/+314
trace: incorporate events
2025-07-16update comment to reference legacy `.ctors` sectionIbraheem Ahmed-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-07-16hook up native-lib bitsNia Espera-25/+314
2025-07-16Make frame spans appear on a separate trace lineStypox-21/+51
This was done by making the tracing_chrome tracing layer check if "tracing_separate_line" was in the arguments of a span, and act accordingly.
2025-07-15Update cargoEric Huss-0/+0
2025-07-15add test for global constructorsIbraheem Ahmed-0/+43
2025-07-15add support for global constructors (i.e. life before main)Ibraheem Ahmed-32/+165
2025-07-15ci cleanup: rustdoc-gui-test now installs browser-ui-testbinarycat-80/+13
this removes the need for --unsafe-perm in the Dockerfile.
2025-07-15Merge pull request #20178 from ShoyuVanilla/cargo-config-cleanupShoyu Vanilla (Flint)-374/+419
chore: Cleanup cargo config queries
2025-07-15Consider outlives assumptions when proving auto traits for coroutine interiorsMichael Goulet-2/+0
2025-07-15Format and bump rustc cratesLaurențiu Nicola-32/+30
2025-07-15Merge pull request #4469 from Patrick-6/add-spinloop-hintsRalf Jung-15/+31
Add std::hint::spin_loop() to tests
2025-07-15Merge from rust-lang/rustLaurențiu Nicola-2784/+7327
2025-07-15Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-07-15Make spin function naming more consistentPatrick-6-17/+17
2025-07-15Further decrease number of `cargo metadata` invokesShoyu Vanilla-243/+270
2025-07-15chore: Cleanup cargo config queriesShoyu Vanilla-133/+151
2025-07-15Merge pull request #4452 from Stypox/trace-borrow-trackerRalf Jung-1/+62
Add tracing spans to borrow tracker functions
2025-07-15Add InterpCx::fn_abi_of_instance/_fn_ptr with tracing, shadowing FnAbiOfStypox-1/+1
2025-07-15Add tracing calls to borrow tracker under the same nameStypox-0/+18
... but the function name is specified in the arguments, see https://github.com/rust-lang/miri/pull/4452#discussion_r2204958019
2025-07-15Add enter_trace_span! that checks #[cfg("tracing")]Stypox-1/+44
Includes a custom syntax shortand to enter_trace_span! with NAME::SUBNAME. MaybeEnteredTraceSpan is `pub use`d in lib.rs to make it available also in bin/, just in case.
2025-07-15Rollup merge of #143905 - xizheyin:143828, r=compiler-errorsSamuel Tardieu-2/+1
Recover and suggest to use `;` to construct array type Fixes rust-lang/rust#143828 r? compiler
2025-07-15Rollup merge of #143837 - jieyouxu:symbol-apis, r=ChrisDentonSamuel Tardieu-25/+159
Adjust `run_make_support::symbols` helpers Massage the `symbols` helpers to fill out {match all, match any} x {substring match, exact match}: | | Substring match | Exact match | |-----------|----------------------------------------|-------------------------------| | Match any | `object_contains_any_symbol_substring` | `object_contains_any_symbol` | | Match all | `object_contains_all_symbol_substring` | `object_contains_all_symbols` | As I'd like to use `object_contains_all_symbols` for rust-lang/rust#143669. As part of this: - Rename `any_symbol_contains` to `object_contains_any_symbol_substring` for accuracy, as `any_symbol_contains` is actually "contains any matching substring". - Remove `with_symbol_iter`. Noticed while working on https://github.com/rust-lang/rust/pull/143669. r? ``@ChrisDenton`` (or compiler)
2025-07-15Rollup merge of #143630 - jieyouxu:drop-suggest, r=Mark-SimulacrumSamuel Tardieu-237/+0
Drop `./x suggest` This PR removes the current `./x suggest` implementation (rust-lang/rust#109933, rust-lang/rust#106249) and associated docs for several reasons: 1. Primarily, `./x suggest` is another "flow" in bootstrap that incurs extra complexity and more invariants that bootstrap has to maintain. This causes more friction when trying to investigate and fix staging problems. As far as I know, this flow has not been actively maintained in quite a while, and I'm not aware of interest in maintaining it. Bootstrap really could use less implementation complexity with a very limited maintenance bandwidth. 2. The current `./x suggest` implementation "bypasses" the usual stage defaults for the various check/build/test/etc. flows, and it's not really possible to have a stage default because `./x suggest --run` produces a *sequence* of suggestions like [`./x check`, `./x test library/std`, ..] and then tries to run all of them in sequence, based on which files are modified. 3. We've not seen a lot of interest both in using it or extending static/dynamic test suggestions. Last extensions were rust-lang/rust#117961 and rust-lang/rust#120763. I'm not convinced the extra implementation complexity is worth it. This was discussed in: - [#t-infra/bootstrap > Dropping the current &#96;./x suggest&#96; flow implementation](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Dropping.20the.20current.20.60.2E.2Fx.20suggest.60.20flow.20implementation/with/527456699) - [#t-compiler > Dropping current &#96;./x suggest&#96; implementation](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Dropping.20current.20.60.2E.2Fx.20suggest.60.20implementation/with/527528696) Closes rust-lang/rust#109933 (the current implementation is being removed). Closes rust-lang/rust#143569 (by removing `./x suggest` altogether).
2025-07-15Rollup merge of #142301 - Gelbpunkt:duplicated-path-in-error-musl, ↵Samuel Tardieu-0/+1
r=workingjubilee,fmease,jieyouxu tests: Fix duplicated-path-in-error fail with musl musl's dlopen returns a different error than glibc, which contains the name of the file. This would cause the test to fail, since the filename would appear twice in the output (once in the error from rustc, once in the error message from musl). Split the expected test outputs for the different libc implementations. Fixes rust-lang/rust#128474
2025-07-15tidy: check for invalid file namesSamuel Tardieu-0/+43
2025-07-15tidy: improve commentMarijn Schouten-1/+1
2025-07-15tidy static regex: OnceLock -> LazyLockMarijn Schouten-2/+3
2025-07-15Add std::hint::spin_loop()Patrick-6-6/+22
2025-07-15tidy: more clippy fixesMarijn Schouten-112/+110
2025-07-15Merge from rustcThe Miri Cronjob Bot-456/+942