Commit Graph

300570 Commits

Author SHA1 Message Date
Jakub Beránek
ac1a8b398b Prepare for merging from rust-lang/rust
This updates the rust-version file to c96a69059e.
2025-07-04 11:07:45 +02:00
Jakub Beránek
9345940c12 Add josh-sync config file 2025-07-04 11:07:39 +02:00
klensy
9d8e68d1d6 bump termize 2025-07-04 11:55:03 +03:00
Jens Reidel
12bc4096dc Get rid of build-powerpc64le-toolchain.sh
The dist-powerpc64le-linux-musl runner never actually used the toolchain
that the script produced, it instead used the one from crosstool-ng.

The dist-powerpc64le-linux-gnu runner did use it, from what I can tell
mainly to get a glibc 2.17 version with ppc64le support backported.
Since crosstool-ng has the necessary patches, we can just use
crosstool-ng to get an appropriate toolchain. While at it, use kernel
3.10 headers since that's the version documented in platform support for
this target.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-04 10:46:12 +02:00
klensy
e631555a48 bump termize dep 2025-07-04 11:43:43 +03:00
dianne
98659a339d treat box patterns as deref patterns in THIR and usefulness analysis
This removes special-casing of boxes from `rustc_pattern_analysis`, as a
first step in replacing `box_patterns` with `deref_patterns`.
Incidentally, it fixes a bug caused by box patterns being represented as
structs rather than pointers, where `exhaustive_patterns` could generate
spurious `unreachable_patterns` lints on arms required for
exhaustiveness; following the lint's advice would result in an error.
2025-07-04 01:28:35 -07:00
Lukas Wirth
474e42ddc4 Merge pull request #20148 from ShoyuVanilla/sysroot-no-deps
fix: Honor `rust-analyzer.cargo.noDeps` option when fetching sysroot metadata
2025-07-04 08:03:25 +00:00
Lukas Wirth
1de9e2c461 Merge pull request #20165 from Hmikihiro/migrate-unmerge_match_arm
Migrate `unmerge_match_arm` Assist to use `SyntaxEditor`
2025-07-04 08:02:58 +00:00
Lukas Wirth
f34a7ecf04 Merge pull request #20167 from ChayimFriedman2/enum-derive-default
fix: Fix some things with builtin derives
2025-07-04 07:59:14 +00:00
clubby789
b33dc21d78 Assign dependency bump PRs to me 2025-07-04 07:35:39 +00:00
bors
1b61d43bdb Auto merge of #143237 - JonathanBrouwer:no_implicit_prelude_parser, r=jdonszelmann,oli-obk
Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure

Ports no_implicit_prelude to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197

r? `@oli-obk`
cc `@jdonszelmann`
2025-07-04 07:21:46 +00:00
Oli Scherer
00184014c9 Merge pull request #4442 from rust-lang/rustup-2025-07-04
Automatic Rustup
2025-07-04 06:45:10 +00:00
Scott McMurray
caeacba78a Allow all MIR Aggregates to take the operand path (if layout permits) 2025-07-03 22:53:19 -07:00
Scott McMurray
5292554337 Block SIMD in transmute_immediate; delete OperandValueKind
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
2025-07-03 22:23:15 -07:00
The Miri Cronjob Bot
f655289d49 Merge from rustc 2025-07-04 05:05:03 +00:00
Jens Reidel
a7eefc3fc4 Enable xgot feature for mips64 musl targets
This was missed in b65c2afdfd, which only
enabled it for the glibc targets.

I didn't feel comfortable touching the OpenWRT target, whoever maintains
that will probably want to take a look whether it is necessary there as
well.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-04 07:04:54 +02:00
The Miri Cronjob Bot
04522bb89c Preparing for merge from rustc 2025-07-04 04:57:31 +00:00
bors
c96a69059e Auto merge of #143407 - jhpratt:rollup-ekkoubw, r=jhpratt
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#142749 (Add methods for converting bool to `Result<(), E>`)
 - rust-lang/rust#143288 (Fix `x clean` with a fifo)
 - rust-lang/rust#143307 (Fast path nitpicks)
 - rust-lang/rust#143346 (update coherence example)
 - rust-lang/rust#143356 (use unsigned_abs instead of `abs` on signed int to silence clippy)
 - rust-lang/rust#143370 (remove redundant #[must_use])
 - rust-lang/rust#143378 (simplify receivers for some array method calls)
 - rust-lang/rust#143380 (Replace kw_span by full span for generic const parameters.)
 - rust-lang/rust#143381 (rustdoc: don't treat methods under const impls or traits as const)
 - rust-lang/rust#143394 (compiler: Document and reduce `fn provide`s in hir crates)
 - rust-lang/rust#143395 (Always use the pure Rust fallback instead of `llvm.{maximum,minimum}`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-04 04:21:14 +00:00
Josh Triplett
0403990000 mbe: Gracefully handle macro rules that end after =>
Add a test for various cases of invalid macro definitions.

Closes: https://github.com/rust-lang/rust/issues/143351
2025-07-03 20:56:05 -07:00
Jacob Pratt
e4e26d2acb Rollup merge of #143395 - Urgau:llvm-fallback-minimum-maximum, r=tgross35
Always use the pure Rust fallback instead of `llvm.{maximum,minimum}`

While https://github.com/llvm/llvm-project/pull/142170 was merged, it was reverted and next attempt (https://github.com/llvm/llvm-project/pull/140193) at fixing the LLVM implementation seems to have stall, so let's reverted back to pure Rust with the LLVM codegen.

cc [#t-compiler/llvm > &#96;llvm.minimum&#96;/&#96;llvm.maximum&#96; issues @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fllvm/topic/.60llvm.2Eminimum.60.2F.60llvm.2Emaximum.60.20issues/near/527044712)

Fixes https://github.com/rust-lang/rust/issues/141087
r? `@tgross35`
2025-07-04 05:47:29 +02:00
Jacob Pratt
9852aceb4f Rollup merge of #143394 - workingjubilee:reorganize-hir-analysis-provide-fn, r=compiler-errors
compiler: Document and reduce `fn provide`s in hir crates

I found it hard to follow all these tiny micro-indirections. Much like you shouldn't pass around `&u32` if you can help it, you probably shouldn't use an indirection if the indirection overhead itself is literally bigger than the amount of data you are organizing. Generally a new `fn provide` amounts to around 3 LOC:
- the signature with opening brace
- the `rustc_middle::query::Providers` import
- an end brace

I am not even counting the cost in time and thought to go find the other `provide`, read it, understand, "Ah, yes, these functions", and then go to those. Thus I say we should collapse indirections of `provide` for modules that only export 1~2 queries. For higher-count indirections, I left them as-is, as I don't understand the crate well enough to judge their worth.

Then I dropped a pointer to the actual module of interest for all these instances of the same function. I think documenting them is important because the comment that it relates to the query system makes it obvious that they have **nothing** to do with the rest of the module's logic and I can carry on ignoring them. Actively doing so is another cognitive cost, but much more minimal.

There is also a small correctness issue in that all of these functions are technically mutating state. It's not a huge deal, but it's still easier to check all these mutations do not overlap if we have less instances of `fn provide` to check.
2025-07-04 05:47:28 +02:00
Jacob Pratt
01fe1c0b0e Rollup merge of #143381 - fee1-dead-contrib:push-pzxuvlnymxpu, r=GuillaumeGomez
rustdoc: don't treat methods under const impls or traits as const

Fixes rust-lang/rust#143071
2025-07-04 05:47:28 +02:00
Jacob Pratt
05f5690d81 Rollup merge of #143380 - cjgillot:kw_span, r=compiler-errors
Replace kw_span by full span for generic const parameters.

Small simplification extracted from https://github.com/rust-lang/rust/pull/127241
2025-07-04 05:47:27 +02:00
Jacob Pratt
e55514bbbe Rollup merge of #143378 - hkBst:clippy-fix-6, r=tgross35
simplify receivers for some array method calls
2025-07-04 05:47:26 +02:00
Jacob Pratt
5adf3ef339 Rollup merge of #143370 - hkBst:clippy-fix-4, r=tgross35
remove redundant #[must_use]

Fixes these clippy warnings:
```
warning: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> library/core/src/cmp.rs:1456:5
     |
1456 |     fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: either add some descriptive message or remove the attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use
     = note: `-D clippy::double-must-use` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]`

warning: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> library/core/src/cmp.rs:1465:5
     |
1465 |     fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: either add some descriptive message or remove the attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use

warning: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> library/core/src/cmp.rs:1474:5
     |
1474 |     fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: either add some descriptive message or remove the attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use

warning: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]`
    --> library/core/src/cmp.rs:1483:5
     |
1483 |     fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: either add some descriptive message or remove the attribute
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use
```
2025-07-04 05:47:26 +02:00
Jacob Pratt
7c68a8db3e Rollup merge of #143356 - hkBst:clippy-fix-2, r=scottmcm
use unsigned_abs instead of `abs` on signed int to silence clippy

Use `unsigned_abs` instead of `abs` on signed int to silence clippy. Alternatively we could allow the lint, but if codegen is not affected, then this seems preferable.
2025-07-04 05:47:25 +02:00
Jacob Pratt
25eb325989 Rollup merge of #143346 - emmanuel-ferdman:master, r=tshepang
update coherence example

## PR Summary
Small PR - Commit 0533ff7d41 moved the `coherence_different_hidden_ty.rs` file. This PR adjusts sources to changes.
2025-07-04 05:47:24 +02:00
Jacob Pratt
9de211b95a Rollup merge of #143307 - compiler-errors:fast-path-nitpicks, r=lcnr
Fast path nitpicks

Miscellaneous commits that I didn't really want to fold into anything else.

Fixes one theoretical bug with the fast path not considering polarity for `T: !Sized` bounds.
2025-07-04 05:47:24 +02:00
Jacob Pratt
826d4bc858 Rollup merge of #143288 - ehuss:fix-clean-fifo, r=Kobzol
Fix `x clean` with a fifo

`x clean` was failing when it encountered a special file like a fifo because it thought it was a directory.
2025-07-04 05:47:23 +02:00
Jacob Pratt
e080bc8751 Rollup merge of #142749 - LimpSquid:bool_to_result, r=scottmcm
Add methods for converting bool to `Result<(), E>`

## Tracking Issue

https://github.com/rust-lang/rust/issues/142748

## ACP

https://github.com/rust-lang/libs-team/issues/606
2025-07-04 05:47:22 +02:00
Makai
e26ae60be3 refactor: implement a new bridge trait Allocation 2025-07-04 01:57:47 +00:00
Makai
854292d589 refactor: rewrite adt_repr(), adt_discr_for_variant() and coroutine_discr_for_variant() 2025-07-04 01:57:47 +00:00
Makai
b7be9cd151 refactor: don't use rustc_type_ir directly 2025-07-04 01:57:47 +00:00
Makai
e3f2096849 refactor: avoid calling internal functions in predicates_of() and explicit_predicates_of() 2025-07-04 01:57:46 +00:00
Makai
a61e5080ec refactor: move convert to unstable
We want to keep StableMIR definitions and logic separate from any sort of conversion and usage of internal rustc code. So we bundle all unstable items that have no stability guarantees into `stable_mir::unstable`.
2025-07-04 01:57:46 +00:00
Makai
efa26e1d64 fix: resolve the unsoundness
add a new trait `InternalCx`, which defines the methods that are fine to call from `RustcInternal`. `RustcInternal::internal()` then takes a `impl InternalCx<'tcx>` instead of `TyCtxt<'tcx>`.

make `tcx` in `SmirCtxt` public, since we need to pass it to `RustcInternal::internal()` in `SmirInterface`.
2025-07-04 01:57:38 +00:00
Makai
b5a2e7d080 refactor: move IndexMap to rustc_smir
we should no longer keep `IndexMap` in `rustc_internal`, as we've decided to migrate `rustc_internal` to `stable_mir` under a feature.
2025-07-04 01:33:18 +00:00
Makai
62d60319d6 refactor: unify Tables implementation with bridge types and re-export IndexedVal
define bridge types for `***Def`s.
consolidate scattered `Tables` implementations into single inherent impl.
2025-07-04 01:33:18 +00:00
Makai
45cf29d651 refactor: remove the tcx field in Tables
the only functionality of `Tables` is caching results. this commit moves calls to rustc queries from `Tables` to `SmirCtxt`.
2025-07-04 01:33:18 +00:00
Makai
6916089d7c fix: rewrite some parts of rustc_smir::builder.rs 2025-07-04 01:33:18 +00:00
Makai
663e2b7e29 refactor: move convert module to stable_mir
note that this commit delete `convert/error.rs`, we would use `SmirError::from_internal` instead.

**Unresolved questions:**
- There are still a few direct calls to rustc's internals scattered across `impl Stable`s, but most of them appear to be relatively stable, e.g., `mir::interpret::ConstAllocation::inner(self)` and `mir::syntax::SwitchTargets::otherwise(self)`.
2025-07-04 01:33:17 +00:00
Makai
0f6f68313d refactor: rewrite the whole rustc_smir::context
This commit removes the `Tables` field from `SmirCtxt`, since borrows of `tables` should only be managed by `SmirInterface`.

This change prevents `SmirCtxt` from holding separate borrows and requires passing `tables` explicitly when needed.

We use the `traits.rs` file to define traits that are used for encapsulating the associated functions in the rustc's internals. This is much easier to use and maintain than directly cramming everything into `SmirCtxt`.
2025-07-04 01:33:17 +00:00
Makai
3b328e111a refactor: split rustc_smir::alloc into two parts
The previous `rustc_smir::alloc` had many direct calls to rustc queries.

This commit splits it into two parts: `rustc_smir::alloc` and `stable_mir::alloc`.

Following the same pattern as `SmirCtxt` and `SmirInterface`, the `rustc_smir::alloc` handles all direct interactions with rustc queries and performs the actual memory allocations, while the `stable_mir::alloc` is responsible for constructing stable components.
2025-07-04 01:33:17 +00:00
Makai
96ad388232 refactor: impl SmirError for stable_mir::Error 2025-07-04 01:33:17 +00:00
Makai
3a43ed2f37 refactor: move IndexedVal from stable_mir to rustc_smir 2025-07-04 01:33:17 +00:00
Makai
7f5e382df4 refactor: make SmirInterface a trait and impl it for SmirContainer
- rewrite all `SmirInterface` apis.
- add `BridgeTys` to impl those associated types in `Bridge`.
- move `**_def()` stuffs living in `impl Tables` from `rustc_internal` to `stable_mir`.
2025-07-04 01:33:09 +00:00
Scott McMurray
15286f220e Remove some unnecessary unsafe in VecCache 2025-07-03 17:42:43 -07:00
bors
837c5dd7de Auto merge of #142890 - kornelski:unused-var-debug, r=saethlin
MIR inliner maintains unused var_debug_info

Only `full` debuginfo level promises variable-level debug information, but the MIR inline pass needlessly preserved the local variable debug info for the `limited` level too.
2025-07-03 23:17:03 +00:00
Chayim Refael Friedman
a1b66211f2 Merge pull request #20144 from regexident/load-workspace-into-db
Add `fn load_workspace_into_db` variant for `ra_ap_load_cargo`'s `fn load_workspace`
2025-07-03 23:08:37 +00:00
Makai
d0130ae186 refactor: add Tables<'tcx, B: Bridge> and SmirContainer 2025-07-03 22:50:52 +00:00