Commit graph

294261 commits

Author SHA1 Message Date
Boxy
fe04ae7faf stabilize gai 2025-06-11 15:30:15 +01:00
bors
0a39445252 Auto merge of #141942 - ShoyuVanilla:smir-repr, r=oli-obk
Implement representation options to smir

Resolves rust-lang/project-stable-mir#89
2025-06-11 07:45:07 +00:00
bors
2b0274c71d Auto merge of #142090 - compiler-errors:perf-stable-root-var, r=lcnr
Make root vars more stable

Never resolve a ty/ct vid to a higher vid as its root. This should make the optimization in rust-lang/rust#141500 more "stable" when there are a lot of vars flying around.

r? `@ghost`
2025-06-11 03:34:30 +00:00
bors
1c047506f9 Auto merge of #141883 - oli-obk:remove-check-mod-loops, r=nnethercote
Remove check_mod_loops query and run the checks per-body instead

This analysis is older than my first rustc contribution I believe. It was never querified. Ideally we'd merge it into the analysis happening within typeck anyway (typeck just uses span_delayed_bug instead of erroring), but I didn't want to do that within this PR that also moves things around and subtly changes diagnostic ordering.
2025-06-10 23:54:45 +00:00
bors
1677d46cb1 Auto merge of #142292 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-06-10 20:54:59 +00:00
bors
8ce2287586 Auto merge of #142299 - fmease:rollup-u86s80a, r=fmease
Rollup of 16 pull requests

Successful merges:

 - rust-lang/rust#134442 (Specify the behavior of `file!`)
 - rust-lang/rust#140372 (Exhaustively handle parsed attributes in CheckAttr)
 - rust-lang/rust#140766 (Stabilize keylocker)
 - rust-lang/rust#141642 (Note the version and PR of removed features when using it)
 - rust-lang/rust#141818 (Don't create .msi installer for gnullvm hosts)
 - rust-lang/rust#141909 (Add central execution context to bootstrap)
 - rust-lang/rust#141992 (use `#[naked]` for `__rust_probestack`)
 - rust-lang/rust#142101 (core::ptr: deduplicate more method docs)
 - rust-lang/rust#142102 (docs: Small clarification on the usage of read_to_string and read_to_end trait methods)
 - rust-lang/rust#142124 (Allow transmute casts in pre-runtime-MIR)
 - rust-lang/rust#142240 (deduplicate the rest of AST walker functions)
 - rust-lang/rust#142258 (platform-support.md: Mention specific Linux kernel version or later)
 - rust-lang/rust#142262 (Mark `core::slice::memchr` as `#[doc(hidden)]`)
 - rust-lang/rust#142271 (compiler: fn ptrs should hit different lints based on ABI)
 - rust-lang/rust#142275 (rustdoc: Refractor `clean_ty_generics`)
 - rust-lang/rust#142288 (const_eval: fix some outdated comments)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-10 17:51:43 +00:00
León Orell Valerian Liehr
9f5c10ed43
Rollup merge of #142288 - RalfJung:const-eval-comments, r=oli-obk
const_eval: fix some outdated comments

r? ``@oli-obk``
2025-06-10 16:54:54 +02:00
León Orell Valerian Liehr
34d39eb3cb
Rollup merge of #142275 - aDotInTheVoid:gen-ty-of, r=fmease
rustdoc: Refractor `clean_ty_generics`

Refactoring towards rust-lang/rust#142226

[Zulip Discussion](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Why.20sometimes.20.60predicates_of.60.20.28vs.20.60explicit_predicates_.2E.2E.2E/near/523182529)

The old `clean_ty_generics` was almost always called with the same args, so rename it to `clean_ty_generics_inner`, and add a new wrapper that generates those args from a `DefId`. Having this be the main entrypoint to `clean_ty_generics` should make it easier to start calling `inferred_outlives_of` https://github.com/rust-lang/rust/pull/142264#discussion_r2136498360 (and is more readable even if we don't)

Also, replaces all calls in rustdoc to `tcx.predicates_of` to `tcx.explicit_predicates_of`, which lets us remove `filter_non_trait_generics`

r? ```@fmease```
2025-06-10 16:54:53 +02:00
León Orell Valerian Liehr
a2badebce5
Rollup merge of #142271 - workingjubilee:fn-ptrs-have-two-different-lints, r=RalfJung
compiler: fn ptrs should hit different lints based on ABI

I was looking closer at the code for linting on ABIs and realized a mistake was probably made during rebase or review. I think that for function pointers in the HIR, the lint that fires should probably depend on the ABI we encountered, e.g. if it's on the newly-deprecated set of ABIs or not. This will be slightly confusing for a little bit, but I think we can do more to reduce that confusion by switching `unsupported_fn_ptr_calling_conventions` to a hard error.

r? ``@RalfJung``
2025-06-10 16:54:52 +02:00
León Orell Valerian Liehr
f76f1f289d
Rollup merge of #142262 - aDotInTheVoid:nomemchr, r=Noratrieb
Mark `core::slice::memchr` as `#[doc(hidden)]`

It's purely internal, and not intended to be a public API, even on nightly. This stops it showing up and being misleading in rustdoc search.

It also mirrors the (also internal) `core::slice::sort` module.
2025-06-10 16:54:52 +02:00
León Orell Valerian Liehr
28d385647f
Rollup merge of #142258 - teohhanhui:docs/platform-support-linux-kernel-version-or-later, r=workingjubilee
platform-support.md: Mention specific Linux kernel version or later

To be consistent with notes for other targets...

~~(Only made the change for `aarch64-unknown-linux-gnu` for now, as that's fairly certain after looking at the `git blame` just to be sure.)~~
2025-06-10 16:54:51 +02:00
León Orell Valerian Liehr
407b81caf4
Rollup merge of #142240 - fee1-dead-contrib:push-zkkzoxlymslv, r=oli-obk
deduplicate the rest of AST walker functions

After this, we can tidy things up and deduplicate the visitor traits themselves too.

Fixes rust-lang/rust#139825, apparently

r? ``@oli-obk``
2025-06-10 16:54:51 +02:00
León Orell Valerian Liehr
e8be230f1f
Rollup merge of #142124 - oli-obk:transmute-cast, r=scottmcm
Allow transmute casts in pre-runtime-MIR

r? ``@scottmcm``

cc ``@BoxyUwU``

turns out in https://github.com/rust-lang/rust/pull/138393 I erroneously used transmute casts in fd3da4bebd/compiler/rustc_mir_build/src/builder/matches/test.rs (L209)

I don't think they have any issues using them before runtime, we just checked for them because we didn't have code exercising those code paths
2025-06-10 16:54:50 +02:00
León Orell Valerian Liehr
590f630ec6
Rollup merge of #142102 - kiseitai3:141714_stdin_read_to_string_docs, r=tgross35
docs: Small clarification on the usage of read_to_string and read_to_end trait methods

Small clarification on the usage of read_to_string and read_to_end trait methods. The goal is to make it clear that these trait methods will become locked up if attempting to read to the end of stdin (which is a bit non-sensical unless the other end closes the pipe).

Fixes: rust-lang/rust#141714
2025-06-10 16:54:49 +02:00
León Orell Valerian Liehr
b13df84fa2
Rollup merge of #142101 - lolbinarycat:core-dedup-ptr-docs-139190-pt2, r=workingjubilee
core::ptr: deduplicate more method docs

used `rg -Fxf library/core/src/ptr/{const,mut}_ptr.rs` to find duplicated doc comments, and `diff -u` after copying them to files to ensure they are actually identical.

`sed 's| */// *||'` was then used to translate the doc comments to plain markdown.

part of https://github.com/rust-lang/rust/issues/139190
2025-06-10 16:54:49 +02:00
León Orell Valerian Liehr
a55b610d7d
Rollup merge of #141992 - folkertdev:probestack-naked-function, r=tgross35
use `#[naked]` for `__rust_probestack`

Let's see if this works now.

Previously this change was in https://github.com/rust-lang/compiler-builtins/pull/897, but we decided to wait until `compiler-builtins` was a subtree (and also `cfg(bootstrap)` is gone now).

r? ``@tgross35``  cc ``@bjorn3``

try-job: `dist-various*`
try-job: `test-various*`
2025-06-10 16:54:48 +02:00
León Orell Valerian Liehr
b9a578ea27
Rollup merge of #141909 - Shourya742:2025-06-01-add-execution-context, r=Kobzol
Add central execution context to bootstrap

This PR continues the effort toward command centralization as outlined in https://github.com/rust-lang/rust/issues/126819. It introduces a centralized execution context through which all commands will be executed. Previously, centralization was limited to build methods; this PR extends it to the `config` module and updates the remaining methods accordingly.

Best reviewed commit by commit.

r? ``@Kobzol``
2025-06-10 16:54:48 +02:00
León Orell Valerian Liehr
04025fae87
Rollup merge of #141818 - mati865:dont-create-msi-from-non-windows, r=Kobzol
Don't create .msi installer for gnullvm hosts

WIX toolset works only on Windows hosts, but gnullvm doesn't have host toolchain yet. To get out of this loop, we will create a single release without MSI installer.

Split out from: https://github.com/rust-lang/rust/pull/140772
2025-06-10 16:54:47 +02:00
León Orell Valerian Liehr
2aea4b2bf1
Rollup merge of #141642 - xizheyin:issue-141619, r=BoxyUwU
Note the version and PR of removed features when using it

Fixes rust-lang/rust#141619

I added the diagnostic information. Since all the current version information is present, it prints the version information anyway, as shown in tests/ui. And PR will not print if it is None, we can gradually add the PR links.

Split into two commits for easier review.

r? compiler

cc ``@jyn514`` Since you're on vocation in the review list, I can't r? you.
2025-06-10 16:54:46 +02:00
León Orell Valerian Liehr
d11756f811
Rollup merge of #140766 - sayantn:stabilize-keylocker, r=traviscross,tgross35
Stabilize keylocker

This PR stabilizes the feature flag `keylocker_x86` (tracking issue rust-lang/rust#134813).

# Public API
The 2 `x86` target features `kl` and `widekl`, and the associated intrinsics in stdarch.

These target features are very specialized, and are only used to signal the presence of the corresponding CPU instruction. They don't have any nontrivial interaction with the ABI (contrary to something like AVX), and serve the only purpose of enabling 11 stdarch intrinsics, all of which have been implemented and propagated to rustc via a stdarch submodule update.

Also, these were added way back in LLVM12, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too!

# Associated PRs
 - rust-lang/rust#134814
 - rust-lang/stdarch#1706
 - rust-lang/rust#136831 (stdarch submodule update)
 - rust-lang/stdarch#1795 (stabilizing the runtime detection and intrinsics)
 - rust-lang/rust#141964 (stdarch submodule update for the stabilization of the runtime detection and intrinsics)

As all of the required tasks have been done (adding the target features to rustc, implementing their runtime detection in std_detect and implementing the associated intrinsics in core_arch), these target features can be stabilized now.

cc ````@rust-lang/lang````
cc ````@rust-lang/libs-api```` for the intrinsics and runtime detection

I don't think anyone else worked on this feature, so no one else to ping, maybe cc ````@Amanieu.```` I will send the reference pr soon.
2025-06-10 16:54:46 +02:00
León Orell Valerian Liehr
0f16ccbb64
Rollup merge of #140372 - mejrs:attrs, r=jdonszelmann
Exhaustively handle parsed attributes in CheckAttr

This pr
 - Deletes the unused `DiagnosticAttribute ` struct and variant
 - Comments the `AttributeKind ` enum
 - The match in `CheckAttrVisitor` is now exhaustive for `AttributeKind::Parsed`.
 - Moved some checks around after that change

I did *not* thoroughly check that there's no duplicated logic between this pass and the attribute parsing but I think it's OK.

  r? ````@jdonszelmann````
2025-06-10 16:54:45 +02:00
León Orell Valerian Liehr
ea1d186875
Rollup merge of #134442 - epage:change, r=workingjubilee
Specify the behavior of `file!`

This takes the current behavior of `file!` and documents it so it is safe to make assumptions about.
For example, Cargo could provide a `CARGO_RUSTC_CURRENT_DIR` as a base path for `file!`.

Example use cases
- Being able to look up test assets relative to the current file ([example](b9026bf654/tests/testsuite/cargo_add/add_basic/mod.rs (L34)))
- Inline snapshotting libraries being able to update Rust source code ([example](b9026bf654/tests/testsuite/alt_registry.rs (L36-L45)))

See rust-lang/cargo#3946 for more context.

T-libs-api discussed two solutions in rust-lang/libs-team#478
- `file_absolute!`:
  - Has less meaning in other build tools like buck2
  - Bakes in the assumption that a full path is available (e.g. with trim-paths)
- Specifying `file!`s behavior (this PR):
  - Leaves it to the user to deal with trim-paths
  - Even though `file!` is currently unspecified, changing it would likely have too large of an impact on the ecosystem at this time.

A future possibility is that rustc could have a flag that controls modifies the base path used for `file!`.
That seems purely additive with specifying the behavior and we do not want to block on it.
It would also likely be too disruptive for Cargo users (as mentioned). However, we tried to keep this in mind when specifying the behavior.
2025-06-10 16:54:44 +02:00
bors
c6a955468b Auto merge of #141485 - dianqk:early_otherwise_branch_loop, r=oli-obk
mir-opt: Do not create storage marks in EarlyOtherwiseBranch

Fixes #141212.

The first commit add `StorageDead` by creating new indirect BB that makes CFG more complicated, but I think it's better to just not create storage marks.

r? mir-opt
2025-06-10 14:50:54 +00:00
Shoyu Vanilla
dabed3372c Implement representation options to smir 2025-06-10 22:58:27 +09:00
Ralf Jung
88e3e68286 update lockfile 2025-06-10 14:01:03 +02:00
bors
100199c9aa Auto merge of #141451 - lcnr:canonicalize-env-cache, r=compiler-errors
cache `param_env` canonicalization

BLocked on rust-lang/rust#141581
2025-06-10 10:42:35 +00:00
Ralf Jung
6d1db1144c const_eval: fix some outdated comments 2025-06-10 11:45:38 +02:00
Ralf Jung
680176ad58
Merge pull request #4389 from RalfJung/native-lib-search-order
native_lib: skip to next .so if function was in dependency of the first
2025-06-10 09:11:49 +00:00
Ralf Jung
f5457e402f
Merge pull request #4382 from RalfJung/dup
test_dup: ensure the FDs remain in sync even after dup'ing
2025-06-10 09:11:22 +00:00
Oli Scherer
7f4093e78b Loop check anon consts on their own 2025-06-10 08:41:23 +00:00
Oli Scherer
1b9d38dd08 Remove check_mod_loops query and run the checks per-body instead 2025-06-10 08:41:23 +00:00
Ralf Jung
2d72737a79
Merge pull request #4391 from RalfJung/float-nondet-tests
float tests: test non-determinism for more operations
2025-06-10 08:35:10 +00:00
Oli Scherer
b73bf3c0b5 Add regression test for break inside const items 2025-06-10 08:34:27 +00:00
Folkert de Vries
b030442eb6
indent the probestack inline assembly 2025-06-10 10:09:00 +02:00
Folkert de Vries
45d649e2ea
merge the sgx/fortanix __rust_probestack into the general x86_64 one 2025-06-10 10:09:00 +02:00
Folkert de Vries
b6eb4f9c3a
use #[naked] for __rust_probestack 2025-06-10 10:08:57 +02:00
Folkert de Vries
f3af86010b
add a fixme to use extern_custom when available 2025-06-10 10:08:08 +02:00
Ralf Jung
a7153db254 float tests: test non-determinism for more operations 2025-06-10 10:07:20 +02:00
Ralf Jung
7d5fac72da
Merge pull request #4394 from RalfJung/smallvec
add SmallVec test
2025-06-10 07:15:37 +00:00
Jubilee
8808a9c17f
hir_analysis: Elaborate on lint strategy for unsupported ABIs
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-06-09 23:48:33 -07:00
Ralf Jung
3e980d5f64 add SmallVec test 2025-06-10 08:46:30 +02:00
Ralf Jung
19f195d1fb
Merge pull request #4393 from rust-lang/rustup-2025-06-10
Automatic Rustup
2025-06-10 06:36:58 +00:00
Ralf Jung
fceb8d6510 sync max_fundamental_align with alloc crate 2025-06-10 08:10:16 +02:00
bors
40daf23eeb Auto merge of #142109 - weihanglo:update-cargo, r=weihanglo
Update cargo

18 commits in 64a12460708cf146e16cc61f28aba5dc2463bbb4..fc1518ef02b77327d70d4026b95ea719dd9b8c51
2025-05-30 18:25:08 +0000 to 2025-06-06 04:49:44 +0000
- fix: Make UI tests handle hyperlinks consistently (rust-lang/cargo#15640)
- Update "time out" to "timeout" (rust-lang/cargo#15637)
- fix(workspace): reload current manifest path member only (rust-lang/cargo#15633)
- Update dependencies (rust-lang/cargo#15635)
- fix(publish): Don't tell people to ctrl-c without knowing consequences  (rust-lang/cargo#15632)
- refactor: clean up `clippy::perf` lint warnings (rust-lang/cargo#15631)
- fix(package): Skip registry check if its not needed (rust-lang/cargo#15629)
- Add --offline for comp (rust-lang/cargo#15623)
- cargo-credential-libsecret: load libsecret only once (rust-lang/cargo#15295)
- test(publish): Improvements in prep for `-Zpackage-workspace` stabilization (rust-lang/cargo#15628)
- fix(package): Allow packaging of self-cycles with -Zpackage-workspace (rust-lang/cargo#15626)
- docs: clarify `--all-features` not available for all commmands (rust-lang/cargo#15572)
- Remove double reference in Shell::print_json (rust-lang/cargo#15460)
- fix(trim-paths): remap all paths to `build.build-dir` (rust-lang/cargo#15614)
- test(trim-paths): enable more tests for windows-msvc (rust-lang/cargo#15621)
- fix(fingerprint): explicit reason rather than "stale; unknown reason" (rust-lang/cargo#15617)
- Fix cargo add overwriting symlinked Cargo.toml files (rust-lang/cargo#15281)
- chore(deps): update alpine docker tag to v3.22 (rust-lang/cargo#15616)

r? ghost
2025-06-10 05:56:54 +00:00
kiseitai3
7d7fedbab4 docs: Small clarification on the usage of read_to_string and read_to_end trait methods 2025-06-10 05:08:39 +00:00
The Miri Cronjob Bot
89db7778d6 fmt 2025-06-10 05:03:44 +00:00
The Miri Cronjob Bot
c601681d95 Merge from rustc 2025-06-10 05:02:33 +00:00
The Miri Cronjob Bot
5eb5f2a226 Preparing for merge from rustc 2025-06-10 04:55:12 +00:00
bors
8a407a8284 Auto merge of #142250 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-06-10 01:52:18 +00:00
Alona Enraght-Moony
856c9971fd rustdoc: Refractor clean_ty_generics 2025-06-10 00:39:45 +00:00