Commit graph

163619 commits

Author SHA1 Message Date
bors
ed2d759783 Auto merge of #143137 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-06-29 16:04:05 +00:00
Guillaume Gomez
66ad1f2abf
Rollup merge of #142078 - sayantn:more-intrinsics, r=workingjubilee
Add SIMD funnel shift and round-to-even intrinsics

This PR adds 3 new SIMD intrinsics

 - `simd_funnel_shl` - funnel shift left
 - `simd_funnel_shr` - funnel shift right
 - `simd_round_ties_even` (vector version of `round_ties_even_fN`)

TODO (future PR): implement `simd_fsh{l,r}` in miri, cg_gcc and cg_clif (it is surprisingly hard to implement without branches, the common tricks that rotate uses doesn't work because we have 2 elements now. e.g, the `-n&31` trick used by cg_gcc to implement rotate doesn't work with this because then `fshl(a, b, 0)` will be `a | b`)

[#t-compiler > More SIMD intrinsics](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/More.20SIMD.20intrinsics/with/522130286)

`@rustbot` label T-compiler T-libs A-intrinsics F-core_intrinsics
r? `@workingjubilee`
2025-06-29 12:29:53 +02:00
Ralf Jung
e56294060a disable ptrace codepath since it doesn't build on many targets 2025-06-29 07:12:13 +02:00
Ralf Jung
a317123ad0 fix miri build in bootstrap 2025-06-29 07:05:17 +02:00
Matthias Krüger
8dbc25ce9f
Rollup merge of #143155 - yotamofek:pr/rustdoc/housekeeping, r=GuillaumeGomez
`librustdoc` house-keeping 🧹

This PR mostly removes a bunch of crate-level attributes that were added at some point, but then later on became unnecessary:
- some `#[feature]` gates
- some `#[allow]`s
- a `#[recursion_limit]`

Then I went ahead and sprinkled some tidy sorting on the remaining attrs, and `Cargo.toml`.

Trying to give my anal retentiveness some peace of mind 😅
2025-06-29 06:59:32 +02:00
Matthias Krüger
c0e0528857
Rollup merge of #142021 - HamidrezaSK:fix-lint-precedence-doc, r=ehuss
Doc: clarify priority of lint level sources

This updates the rustc book to clearly document how conflicting lint configurations are resolved across different sources, including command-line flags, crate-level attributes, in-line attributes, and `--cap-lints`.

It also explains the special behavior of `forbid` and `force_warn`.

Fixes rust-lang/rust#124088
2025-06-29 06:59:27 +02:00
bors
8141c2265f Auto merge of #143160 - ehuss:update-cargo, r=ehuss
Update cargo

7 commits in 409fed7dc1553d49cb9a8c0637d12d65571346ce..930b4f62cfcd1f0eabdb30a56d91bf6844b739bf
2025-06-23 15:55:04 +0000 to 2025-06-28 14:58:43 +0000
- Use a different lint for the `fix_only_once_for_duplicates` test (rust-lang/cargo#15713)
- chore: bump to 0.91.0; update changelog (rust-lang/cargo#15710)
- Add `http.proxy-cainfo` config for proxy certs (rust-lang/cargo#15374)
- chore(deps): update msrv (3 versions) to v1.86 (rust-lang/cargo#15709)
- chore(deps): update msrv (1 version) to v1.88 (rust-lang/cargo#15706)
- Rework `cargo-test-support` & `testsuite` to use `CARGO_BIN_EXE_*` for Cargo (rust-lang/cargo#15692)
- fix: Expand error messages around path dependency on `cargo package` and `cargo publish` (rust-lang/cargo#15705)
2025-06-29 01:16:18 +00:00
Eric Huss
e0c8c3fbb0 Update cargo 2025-06-28 14:28:46 -07:00
Matthias Krüger
a62de822fa
Rollup merge of #143114 - leopardracer:master, r=RalfJung
Minor Documentation Improvements

---

## Description
- Fixed typos and improved clarity in comments and documentation.

---
2025-06-28 22:05:33 +02:00
Matthias Krüger
ac227500a2
Rollup merge of #143031 - mati865:push-mutywntmvomx, r=Mark-Simulacrum
Add windows-gnullvm hosts to the manifest

I made a mistake testing https://github.com/rust-lang/rust/pull/140772 only with `rustup-toolchain-install-master` which doesn't care about the manifests.

This means windows-gnullvm self-hosting will have to wait one more release, unless this change is backported to beta and a new beta release is made, which doesn't seem worth the trouble.
2025-06-28 22:05:30 +02:00
Matthias Krüger
8f30a98591
Rollup merge of #142987 - lolbinarycat:rustdoc-non_exhaustive-enum-v-142599, r=GuillaumeGomez
rustdoc: show attributes on enum variants

mostly for #[non_exhaustive]

unsure if there's any attributes we should take care to *not* include, it could use `render_code_attribute` and `is_non_exhaustive` instead, if that is a concern.

fixes rust-lang/rust#142599
2025-06-28 22:05:30 +02:00
Matthias Krüger
5e725a6367
Rollup merge of #142963 - Kobzol:try-build-skip, r=jieyouxu
Skip unnecessary components in x64 try builds

We unnecessarily rebuild `wasm-component-ld`, `llvm-bitcode-linker` and Cranelift during the intermediate PGO builds several times times, which is unnecessarily and increases the duration of try builds. This PR also disables some unnecessary dist components.

r? `````@jieyouxu`````
2025-06-28 22:05:29 +02:00
Yotam Ofek
581cb1100e librustdoc: use tidy for sorting attrs and deps 2025-06-28 19:25:35 +00:00
Yotam Ofek
96fcd06d41 librustdoc: remove unused feature gates 2025-06-28 19:20:49 +00:00
Yotam Ofek
bcb287dca5 librustdoc: remove unneeded #[recursion_limit] 2025-06-28 19:13:38 +00:00
Yotam Ofek
09e4ee5fbc librustdoc: remove unneeded #[allow]s 2025-06-28 19:13:25 +00:00
bors
b63223c152 Auto merge of #141759 - 1c3t3a:discriminants-query, r=saethlin
Insert checks for enum discriminants when debug assertions are enabled

Similar to the existing null-pointer and alignment checks, this checks for valid enum discriminants on creation of enums through unsafe transmutes. Essentially this sanitizes patterns like the following:
```rust
let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) };
```

An extension of this check will be done in a follow-up that explicitly sanitizes for extern enum values that come into Rust from e.g. C/C++.

This check is similar to Miri's capabilities of checking for valid construction of enum values.

This PR is inspired by saethlin@'s PR
https://github.com/rust-lang/rust/pull/104862. Thank you so much for keeping this code up and the detailed comments!

I also pair-programmed large parts of this together with vabr-g@.

r? `@saethlin`
2025-06-28 10:25:00 +00:00
Ralf Jung
5e14d0f193 move all the message types into one place 2025-06-28 11:55:46 +02:00
Ralf Jung
cde1012082 de-intend some code, and extend comments 2025-06-28 11:36:40 +02:00
Ralf Jung
62bb6216ea various minor native-lib-tracing tweaks, and disable naive-lib-tracing mode by default 2025-06-28 11:36:40 +02:00
Ralf Jung
35e6def487 clippy 2025-06-28 09:12:51 +02:00
The Miri Cronjob Bot
cff5a7cb29 fmt 2025-06-28 05:03:27 +00:00
The Miri Cronjob Bot
3d8d4d4545 Merge from rustc 2025-06-28 05:02:19 +00:00
The Miri Cronjob Bot
34949e30d3 Preparing for merge from rustc 2025-06-28 04:55:04 +00:00
bors
d41e12f1f4 Auto merge of #143116 - matthiaskrgr:rollup-zy9ez06, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#139858 (New const traits syntax)
 - rust-lang/rust#140809 (Reduce special casing for the panic runtime)
 - rust-lang/rust#142730 (suggest declaring modules when file found but module not defined)
 - rust-lang/rust#142806 (Normalize before computing ConstArgHasType goal in new solver)
 - rust-lang/rust#143046 (const validation: properly ignore zero-sized UnsafeCell)
 - rust-lang/rust#143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology)
 - rust-lang/rust#143096 (tag_for_variant: properly pass TypingEnv)
 - rust-lang/rust#143104 (hir_analysis: prohibit `dyn PointeeSized`)
 - rust-lang/rust#143106 (gce: don't ICE on non-local const)

Failed merges:

 - rust-lang/rust#143036 (Remove support for `dyn*` from the compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-27 23:15:35 +00:00
Matthias Krüger
2d59c4e0fe
Rollup merge of #143046 - RalfJung:zst-unsafe-cell, r=lcnr,oli-obk
const validation: properly ignore zero-sized UnsafeCell

Fixes https://github.com/rust-lang/rust/issues/142948
r? `@oli-obk`
2025-06-27 22:13:05 +02:00
Matthias Krüger
9d15167921
Rollup merge of #140809 - bjorn3:panic_runtime_cleanup, r=petrochenkov
Reduce special casing for the panic runtime

See the individual commits for more info.
2025-06-27 22:13:01 +02:00
Matthias Krüger
36c2b011cb
Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-dead
New const traits syntax

This PR only affects the AST and doesn't actually change anything semantically.

All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser

Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error

r? ``@fee1-dead``

cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-27 22:13:00 +02:00
bors
bdaba05a95 Auto merge of #143064 - flip1995:clippy-subtree-update, r=GuillaumeGomez
Clippy subtree update

r? `@Manishearth`

Cargo.lock update due to version bump
2025-06-27 20:07:50 +00:00
leopardracer
39092cc10b
Update dangling_pointer_to_raw_pointer.rs 2025-06-27 22:39:40 +03:00
leopardracer
3a34dac6c3
Update README.md 2025-06-27 22:39:12 +03:00
leopardracer
9090199f49
Update ui.rs 2025-06-27 22:38:52 +03:00
Guillaume Gomez
6d8f74d75c
Rollup merge of #142721 - Stypox:tracing-layout-of, r=RalfJung
Add tracing to `InterpCx::layout_of()`

This PR adds tracing calls to `instantiate_from_frame_and_normalize_erasing_regions` and to `InterpCx::layout_of()`. The latter is done by shadowing `LayoutOf`'s trait method with an inherent method on `InterpCx`.

<details><summary>Previous attempt by overriding the `layout_of` query (includes downloadable `.diff` patch)</summary>

This PR is meant for Miri, but requires a few changes in `rustc` code, hence why it's here. It adds tracing capabilities to the `layout_of` function in `tcx` by overriding the `layout_of` query (under `local_providers`) with a wrapper that opens a tracing span and then calls the actual `layout_of`. To make this possible, I had to make `rustc_ty_utils::layout::layout_of` public. I added an assert to ensure the `providers.layout_of` value I am replacing is actually `rustc_ty_utils::layout::layout_of`, just in case.

I also considered taking the previous value in `providers.layout_of` and calling that one instead, to avoid making `layout_of` public. But then the closure would not be castable to a function pointer anymore (`providers.layout_of` is a function pointer), because it would depend on the local variable storing the previous value of `providers.layout_of`. Using a global variable would work but would rely on `unsafe` or on `Mutex`es, so I wanted to avoid it.

Here is some tracing output when Miri is run on `src/tools/miri/tests/pass/hello.rs`, visualizable in https://ui.perfetto.dev: [trace-1750338860374637.json](https://github.com/user-attachments/files/20820392/trace-1750338860374637.json)

Another place where I could have added tracing calls is to the `rustc_middle::ty::layout::LayoutCx` struct / `spanned_layout_of()` function, however there is no simple way to disable the tracing calls with compile-time boolean constants there (since `LayoutCx::new()` is used everywhere and referenced directly), and in any case it seems like `spanned_layout_of()` just calls `tcx.layout_of()` anyway. For completeness' sake, here is tracing output for when a tracing call is added to `spanned_layout_of()`: [trace-1750340887920584.json](https://github.com/user-attachments/files/20820609/trace-1750340887920584.json)

Patch to override `layout_of` query: [tracing-layout_of-query-override.diff.txt](https://github.com/user-attachments/files/20944497/tracing-layout_of-query-override.diff.txt)

</details>

**Note: obtaining tracing output depends on https://github.com/rust-lang/miri/pull/4406, but this PR is standalone and can be merged without waiting for https://github.com/rust-lang/miri/pull/4406.**

r? `@RalfJung`
2025-06-27 15:04:53 +02:00
Guillaume Gomez
5d2417e831
Rollup merge of #142270 - lolbinarycat:rustdoc-search-Results-type, r=GuillaumeGomez
Rustdoc js: even more typechecking improvements

I noticed some oddities when I went to start working on type aliases, so I've gone and cleaned up a bunch of stuff.  Notably `fullId` was nearly always an integer in practice, but tsc was being told it should be a string.

r? ``@notriddle``
2025-06-27 15:04:51 +02:00
Samuel Tardieu
4b3f31df4f
Use .is_multiple_of() in bootstrap
This makes the intent clear, and silences Clippy.
2025-06-27 12:21:45 +02:00
Philipp Krones
f13d785a26
broken_links: Fix rustdoc API usage 2025-06-27 12:21:41 +02:00
Philipp Krones
80e1528909
Merge commit 'c5dbd1de07' into clippy-subtree-update 2025-06-27 12:20:57 +02:00
Stypox
708dc15cf1
Add InterpCx::layout_of with tracing, shadowing LayoutOf 2025-06-27 11:49:22 +02:00
Bastian Kersting
1087042e22 Insert checks for enum discriminants when debug assertions are enabled
Similar to the existing nullpointer and alignment checks, this checks
for valid enum discriminants on creation of enums through unsafe
transmutes. Essentially this sanitizes patterns like the following:
```rust
let val: MyEnum = unsafe { std::mem::transmute<u32, MyEnum>(42) };
```
An extension of this check will be done in a follow-up that explicitly
sanitizes for extern enum values that come into Rust from e.g. C/C++.

This check is similar to Miri's capabilities of checking for valid
construction of enum values.

This PR is inspired by saethlin@'s PR
https://github.com/rust-lang/rust/pull/104862. Thank you so much for
keeping this code up and the detailed comments!

I also pair-programmed large parts of this together with vabr-g@.
2025-06-27 09:37:36 +00:00
bit-aloo
591df6c1b0
disable caching for cargo commands 2025-06-27 10:49:43 +05:30
bit-aloo
0eab328414
move execution context inside exec and prune execution context, use command directly from bootstrap command inside start, and not via as_command_mut 2025-06-27 10:39:35 +05:30
bit-aloo
18090924f9
make DeferredCommand a must use and move mark_as_executed inside finish process 2025-06-27 10:38:44 +05:30
bit-aloo
28f97108f1
add caching info on bootstrap command 2025-06-27 10:38:44 +05:30
bit-aloo
2e2baed5df
refactor deferred command and make it compatible with new commandstate, remove extra caching logic from run and re-structure the changes 2025-06-27 10:38:42 +05:30
bit-aloo
2cf6552f5d
add new command state in execution context 2025-06-27 10:38:07 +05:30
bit-aloo
5291c9fcec
add do_not_cache method and update the warning on as_command_mut 2025-06-27 10:38:07 +05:30
bit-aloo
08d7b29719
use metadata for command cache key spawning directly from command 2025-06-27 10:38:07 +05:30
bit-aloo
42875e1a3b
add command cache key, move to osstring, add should cache to bootstrap command 2025-06-27 10:38:06 +05:30
bit-aloo
59cb00ffbe
add caching fields inside Bootstrap command 2025-06-27 10:38:06 +05:30
bors
e61dd437f3 Auto merge of #143074 - compiler-errors:rollup-cv64hdh, r=compiler-errors
Rollup of 18 pull requests

Successful merges:

 - rust-lang/rust#137843 (make RefCell unstably const)
 - rust-lang/rust#140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns)
 - rust-lang/rust#142549 (small iter.intersperse.fold() optimization)
 - rust-lang/rust#142637 (Remove some glob imports from the type system)
 - rust-lang/rust#142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation)
 - rust-lang/rust#142700 (Remove incorrect comments in `Weak`)
 - rust-lang/rust#142927 (Add note to `find_const_ty_from_env`)
 - rust-lang/rust#142967 (Fix RwLock::try_write documentation for WouldBlock condition)
 - rust-lang/rust#142986 (Port `#[export_name]` to the new attribute parsing infrastructure)
 - rust-lang/rust#143001 (Rename run always )
 - rust-lang/rust#143010 (Update `browser-ui-test` version to `0.20.7`)
 - rust-lang/rust#143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`)
 - rust-lang/rust#143033 (Expand const-stabilized API links in relnotes)
 - rust-lang/rust#143041 (Remove cache for citool)
 - rust-lang/rust#143056 (Move an ACE test out of the GCI directory)
 - rust-lang/rust#143059 (Fix 1.88 relnotes)
 - rust-lang/rust#143067 (Tracking issue number for `iter_macro`)
 - rust-lang/rust#143073 (Fix some fixmes that were waiting for let chains)

Failed merges:

 - rust-lang/rust#143020 (codegen_fn_attrs: make comment more precise)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-27 00:44:20 +00:00