Commit Graph

303456 Commits

Author SHA1 Message Date
Samuel Tardieu
b564ecf04b Rollup merge of #143920 - oli-obk:cg-llvm-safety, r=jieyouxu
Make more of codegen_llvm safe

Best reviewed commit-by-commit.
2025-07-16 17:06:40 +02:00
Samuel Tardieu
096a66d8d8 Rollup merge of #143738 - rocurley:float_tests_refactor_2, r=tgross35
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-16 17:06:40 +02:00
Samuel Tardieu
7b5e08f8ef Rollup merge of #143692 - RalfJung:miri-oob, r=oli-obk
miri: fix out-of-bounds error for ptrs with negative offsets

r? ```````@oli-obk```````
2025-07-16 17:06:39 +02:00
Samuel Tardieu
17332ed916 Rollup merge of #143448 - Enselic:remote-test-client-signals, r=Mark-Simulacrum
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-16 17:06:38 +02:00
Samuel Tardieu
37aba8388e Rollup merge of #143355 - hkBst:cleanup-shift-double-bitmask, r=Mark-Simulacrum
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-16 17:06:38 +02:00
Samuel Tardieu
9f2015d3d3 Rollup merge of #142936 - aDotInTheVoid:rdj-shatts-forrealthistime, 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-16 17:06:37 +02:00
yanglsh
df529eb8cc fix: ptr_as_ptr suggests wrongly with turbo fish 2025-07-16 22:56:49 +08:00
Folkert de Vries
0d9d209417 fix space in generated loongarch 2025-07-16 16:27:51 +02:00
yanglsh
8d941d22ba fix: never_loop forget to remove break in suggestion 2025-07-16 22:14:34 +08:00
Sasha Pourcelot
4e054fc4c4 Port #[coverage] to the new attribute system 2025-07-16 15:51:18 +02:00
Antoni Boucher
ecd958f480 Fix LTO errors 2025-07-16 09:33:36 -04:00
Samuel Tardieu
041a0f633d Get myself off assignment rotation (#15288)
I'll be mostly AFK starting on Friday for about one week.

changelog: none
2025-07-16 13:33:00 +00:00
Ralf Jung
0bf0860a0e simplfy memory kind handling during interning 2025-07-16 15:29:52 +02:00
Ralf Jung
8f854d9cb2 const heap: fix ICE on forgotten make_global 2025-07-16 15:29:52 +02:00
A4-Tacks
f2b8fda3a6 Add AsMut to minicore prelude::v1 2025-07-16 21:27:39 +08:00
Samuel Tardieu
39a1d52137 Get myself off assignment rotation 2025-07-16 15:27:16 +02:00
Antoni Boucher
83fbcabd92 Fix warnings in tests 2025-07-16 08:44:15 -04:00
David Wood
8d64937dc2 trait_sel: MetaSized always holds temporarily
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-16 12:35:44 +00:00
Alex Macleod
32263f5fe1 Move uninlined_format_args to pedantic 2025-07-16 12:30:52 +00:00
Oli Scherer
4e8ce1ee6a Merge pull request #4471 from RalfJung/triagebot-welcome
triagebot welcome message for new users
2025-07-16 12:27:23 +00:00
Guillaume Gomez
c079c96877 Add test for aliases partial match 2025-07-16 14:27:22 +02:00
Guillaume Gomez
b0bf51f9a9 Update rustdoc search tester to new alias output 2025-07-16 14:27:22 +02:00
Guillaume Gomez
47b138b2b8 Make aliases search support partial matching 2025-07-16 14:27:22 +02:00
Amanieu d'Antras
f694b583e6 Merge pull request #1875 from sayantn/sde-update
Bump CI versions
2025-07-16 12:23:08 +00:00
Folkert de Vries
9f4c6b2106 Merge pull request #1876 from madhav-madhusoodanan/intrinsic-test-sign-enum-addition
`intrinsic-test` : Modified TypeKind enum to group the Signed and Unsigned version of types
2025-07-16 12:15:48 +00:00
Ralf Jung
6e3b9ddc3a triagebot welcome message for new users 2025-07-16 13:58:04 +02:00
A4-Tacks
9909a37fdc Use hir::Trait in parameter 2025-07-16 19:51:16 +08:00
sayantn
08ef071717 Update wasmprinter to latest 2025-07-16 17:18:23 +05:30
sayantn
ed2918988b Bump versions in CI
- `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-16 17:18:23 +05:30
sayantn
a2486a5138 Update Docker OS to Ubuntu-25.10 2025-07-16 17:18:22 +05:30
sayantn
d8a783dab5 Update SDE to v9.58.0 2025-07-16 17:18:16 +05:30
Madhav Madhusoodanan
959d191a25 Modified Typekind to group the Signed and Unsigned version of types. 2025-07-16 17:12:12 +05:30
Ralf Jung
fe090dbb83 Merge pull request #4459 from ibraheemdev/ibraheem/global-ctor
Add support for global constructors (i.e. life before main)
2025-07-16 11:00:19 +00:00
bors
1c6de21509 Auto merge of #143458 - petrochenkov:bindnomod, r=SparrowLii
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-16 10:58:42 +00:00
Ralf Jung
a7818abc14 minor tweaks and comments 2025-07-16 12:34:28 +02:00
Samuel Tardieu
ad97abcad8 unsafe_derive_deserialize: do not consider pin!() as unsafe (#15137)
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 10:04:39 +00:00
Samuel Tardieu
b49e36041b unsafe_derive_deserialize: do not consider pin!() as unsafe
In Rust 1.88, the `pin!()` macro uses `unsafe` and triggers
`unsafe_derive_deserialize`.
2025-07-16 11:59:51 +02: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
Philipp Krones
21943a9056 Don't trigger unused_trait_names in macros (#14947)
Closes rust-lang/rust-clippy#14924

changelog: [`unused_trait_names`] no longer triggers in macros
2025-07-16 09:10:54 +00:00
dianne
413f8db4a9 future-incompat lints: don't link to the nightly edition-guide version 2025-07-16 01:44:02 -07:00
dianne
41e6f767b6 future-incompat lints: don't link to the nightly edition-guide version 2025-07-16 01:44:02 -07:00
Ralf Jung
ed212ffece Merge pull request #4456 from nia-e/trace-incorporate-events
trace: incorporate events
2025-07-16 08:03:33 +00:00
Ibraheem Ahmed
7daf0e68e0 update comment to reference legacy .ctors section
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-07-16 03:53:20 -04:00
Nia Espera
06f0dca106 hook up native-lib bits 2025-07-16 09:32:30 +02:00
Stypox
07a34c374b Make frame spans appear on a separate trace line
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-16 09:25:35 +02:00
Edoardo Marangoni
0e423f441a Boostrap: add warning on optimize = false 2025-07-16 09:24:30 +02:00
bors
f21fbac535 Auto merge of #143998 - ehuss:update-cargo, r=ehuss
Update cargo

1 commits in eabb4cd923deb73e714f7ad3f5234d68ca284dbe..6833aa715d724437dc1247d0166afe314ab6854e
2025-07-09 22:07:55 +0000 to 2025-07-13 02:25:52 +0000
- Add `[hints]` table in `Cargo.toml`, and a `hints.mostly-unused` hint (rust-lang/cargo#15673)
2025-07-16 07:04:52 +00:00
Ralf Jung
42ec028027 type_id_eq: check that the hash fully matches the type 2025-07-16 08:02:47 +02:00
Vadim Petrochenkov
7f398fd5f6 resolve: Optimize fn traits_in_module 2025-07-16 08:30:48 +03:00