about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-07-16Auto merge of #144028 - samueltardieu:rollup-x6f9h8n, r=samueltardieubors-1174/+1150
Rollup of 12 pull requests Successful merges: - rust-lang/rust#142936 (rustdoc-json: Structured attributes) - rust-lang/rust#143355 (wrapping shift: remove first bitmask and table) - rust-lang/rust#143448 (remote-test-client: Exit code `128 + <signal-number>` instead of `3`) - rust-lang/rust#143692 (miri: fix out-of-bounds error for ptrs with negative offsets) - rust-lang/rust#143738 (Move several float tests to floats/mod.rs) - rust-lang/rust#143920 (Make more of codegen_llvm safe) - rust-lang/rust#143921 (Constify `Index` traits) - rust-lang/rust#143939 (Add 0323pin as maintainer of NetBSD targets, fix link to pkgsrc-wip and explain.) - rust-lang/rust#143948 (Update mdbook to 0.4.52) - rust-lang/rust#143957 (tidy: check for invalid file names) - rust-lang/rust#143968 (Add tracing to `InterpCx::fn_abi_of_instance/fn_abi_of_fn_ptr`) - rust-lang/rust#143990 (Add LocalKey<Cell>::update) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-16Rollup merge of #143990 - camsteffen:localkey-cell, r=tgross35Samuel Tardieu-0/+23
Add LocalKey<Cell>::update Tracking issue: rust-lang/rust#143989
2025-07-16Rollup merge of #143968 - Stypox:tracing-FnAbiOf, r=RalfJungSamuel Tardieu-19/+41
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 #143939 - he32:netbsd-maintainers, r=jieyouxuSamuel Tardieu-1/+2
Add 0323pin as maintainer of NetBSD targets, fix link to pkgsrc-wip and explain.
2025-07-16Rollup merge of #143921 - oli-obk:const-index, r=fee1-deadSamuel Tardieu-96/+146
Constify `Index` traits tracking issue: rust-lang/rust#143775 the `SliceIndex` trait cannot be implemented by users as it is sealed. While it would be useful for the `get` method on slices, it seems weird to have a feature gate for that that isn't also gating index syntax at the same time, so I put them under the same feature gate. r? ```````@fee1-dead```````
2025-07-16Rollup merge of #143920 - oli-obk:cg-llvm-safety, r=jieyouxuSamuel Tardieu-253/+221
Make more of codegen_llvm safe Best reviewed commit-by-commit.
2025-07-16Rollup merge of #143738 - rocurley:float_tests_refactor_2, r=tgross35Samuel Tardieu-615/+268
Move several float tests to floats/mod.rs This PR moves several tests to `floats/mod.rs`, as discussed in https://github.com/rust-lang/rust/issues/141726. The tests moved are: - `test_num_f*` - `test_infinity` - `test_neg_infinity` - `test_zero` - `test_neg_zero` - `test_one` - `test_is_nan` - `test_is_infinite` - `test_is_finite` - `test_is_normal` - `test_classify` Each test is its own commit, so it may be easiest to review each commit individually. r? tgross35
2025-07-16Rollup merge of #143692 - RalfJung:miri-oob, r=oli-obkSamuel Tardieu-22/+78
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-16Rollup merge of #143355 - hkBst:cleanup-shift-double-bitmask, r=Mark-SimulacrumSamuel Tardieu-42/+6
wrapping shift: remove first bitmask and table ```rust #[inline(always)] pub const fn wrapping_shl(self, rhs: u32) -> Self { // SAFETY: the masking by the bitsize of the type ensures that we do not shift // out of bounds unsafe { self.unchecked_shl(rhs & (Self::BITS - 1)) } } ``` already does the bitmask, so it seems unnecessary here. More context: internals.rust-lang.org/t/wrapping-shift-operator-code-doing-bitmasking-twice/23167
2025-07-16Rollup merge of #142936 - aDotInTheVoid:rdj-shatts-forrealthistime, ↵Samuel Tardieu-122/+316
r=GuillaumeGomez rustdoc-json: Structured attributes Implements and closes rust-lang/rust#141358. This has 2 primary benefits. 1. For rustdoc-json consumers, they no longer need to parse strings of attributes, but it's there in a structured and normalized way. CC ```@obi1kenobi``` 2. For rustc conributors, the output of HIR pretty printing is no longer a versioned thing in the output. People can work on rust-lang/rust#131229 without needing to bump `FORMAT_VERSION`. CC ```@jdonszelmann``` ```@JonathanBrouwer.``` (Over time, as the attribute refractor continues, I expect we'll add new things to `rustdoc_json_types::Attribute`. But this can be done separately to the rustc changes). Todo before being mergable: - [x] Update test assertions. - [x] Fix modeling of `#[repr]`. - [ ] ~~Add tests of `#[doc(hidden)]` in `Item::attrs` (probably in a seperate PR).~~ I'm gonna punt this to a future PR - [x] Documentation.
2025-07-16fix: `ptr_as_ptr` suggests wrongly with turbo fishyanglsh-4/+36
2025-07-16fix space in generated loongarchFolkert de Vries-2/+2
2025-07-16fix: `never_loop` forget to remove break in suggestionyanglsh-32/+210
2025-07-16Port `#[coverage]` to the new attribute systemSasha Pourcelot-405/+377
2025-07-16Fix LTO errorsAntoni Boucher-1/+2
2025-07-16Get myself off assignment rotation (#15288)Samuel Tardieu-0/+1
I'll be mostly AFK starting on Friday for about one week. changelog: none
2025-07-16simplfy memory kind handling during interningRalf Jung-42/+11
2025-07-16const heap: fix ICE on forgotten make_globalRalf Jung-67/+58
2025-07-16Add AsMut to minicore prelude::v1A4-Tacks-0/+1
2025-07-16Get myself off assignment rotationSamuel Tardieu-0/+1
2025-07-16Fix warnings in testsAntoni Boucher-16/+12
2025-07-16trait_sel: `MetaSized` always holds temporarilyDavid Wood-244/+77
As a temporary measure while a proper fix for `tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs` is implemented, make `MetaSized` obligations always hold. In effect, temporarily reverting the `sized_hierarchy` feature. This is a small change that can be backported.
2025-07-16Move `uninlined_format_args` to `pedantic`Alex Macleod-1/+1
2025-07-16Merge pull request #4471 from RalfJung/triagebot-welcomeOli Scherer-1/+12
triagebot welcome message for new users
2025-07-16Add test for aliases partial matchGuillaume Gomez-8/+20
2025-07-16Update rustdoc search tester to new alias outputGuillaume Gomez-25/+46
2025-07-16Make aliases search support partial matchingGuillaume Gomez-74/+83
2025-07-16Merge pull request #1875 from sayantn/sde-updateAmanieu d'Antras-68/+70
Bump CI versions
2025-07-16Merge pull request #1876 from ↵Folkert de Vries-31/+72
madhav-madhusoodanan/intrinsic-test-sign-enum-addition `intrinsic-test` : Modified TypeKind enum to group the Signed and Unsigned version of types
2025-07-16triagebot welcome message for new usersRalf Jung-1/+12
2025-07-16Use hir::Trait in parameterA4-Tacks-37/+24
2025-07-16Update `wasmprinter` to latestsayantn-11/+19
2025-07-16Bump versions in CIsayantn-15/+17
- `clang-19` -> `clang-20` in ARM - `gcc-14.2` -> `gcc-14.3` in AArch64-BE - `gcc-14` ->`gcc-15` in LA64 - `riscv-gnu-v2025.01.20` -> `riscv-gnu-v2025.07.03` in Risc-V 32 - `wasmtime-v18.0.2` -> `wasmtime-v34.0.1`
2025-07-16Update Docker OS to Ubuntu-25.10sayantn-19/+19
2025-07-16Update SDE to v9.58.0sayantn-23/+15
2025-07-16Modified Typekind to group the Signed and Unsigned version of types.Madhav Madhusoodanan-31/+72
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-16Auto merge of #143458 - petrochenkov:bindnomod, r=SparrowLiibors-229/+181
resolve: Merge `NameBindingKind::Module` into `NameBindingKind::Res` This is a simplification, but also an optimization, because now we load modules from external crates in a more lazy fashion.
2025-07-16minor tweaks and commentsRalf Jung-25/+35
2025-07-16`unsafe_derive_deserialize`: do not consider `pin!()` as `unsafe` (#15137)Samuel Tardieu-1/+44
In Rust 1.88, the `pin!()` macro uses `unsafe` and triggers `unsafe_derive_deserialize`. Fixes rust-lang/rust-clippy#15120 changelog: [`unsafe_derive_deserialize`]: do not trigger because of the standard library's `pin!()` macro
2025-07-16`unsafe_derive_deserialize`: do not consider `pin!()` as `unsafe`Samuel Tardieu-1/+44
In Rust 1.88, the `pin!()` macro uses `unsafe` and triggers `unsafe_derive_deserialize`.
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-16Don't trigger `unused_trait_names` in macros (#14947)Philipp Krones-17/+6
Closes rust-lang/rust-clippy#14924 changelog: [`unused_trait_names`] no longer triggers in macros
2025-07-16future-incompat lints: don't link to the nightly edition-guide versiondianne-1/+1
2025-07-16future-incompat lints: don't link to the nightly edition-guide versiondianne-465/+465
2025-07-16Merge pull request #4456 from nia-e/trace-incorporate-eventsRalf Jung-25/+314
trace: incorporate events