Commit Graph

319903 Commits

Author SHA1 Message Date
bors 59807616e1 Auto merge of #155283 - jieyouxu:revert-gnullvm-link-shared-stable, r=Mark-Simulacrum
[stable] Revert "Build shared LLVM lib for windows-gnullvm"

This reverts commit 1d1280a.

Looks like this causes problems (rust-lang/rust#155268) with certain LLVM bin tools not finding `libLLVM` on `*-windows-gnullvm`. This PR is a _minimal_ revert to return us to known state to alleviate time pressure to investigate.
1.95.0
2026-04-14 19:55:32 +00:00
Jieyou Xu 9b3eeb3f0f Revert "Build shared LLVM lib for windows-gnullvm"
This reverts commit 1d1280aae1.

Looks like this causes problems with certain LLVM bin tools not finding
`libLLVM` on `*-windows-gnullvm`. This commit is a _minimal_ revert to
return us to known state to alleviate time pressure to investigate.
2026-04-14 19:48:39 +08:00
bors 6efb623524 Auto merge of #155210 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] Rust 1.95.0 release

https://forge.rust-lang.org/release/process.html#stable-pr

This also backports:

* Patch musl's CVE-2026-6042 and CVE-2026-40200 rust-lang/rust#155171

and cherry picks latest release notes.

r? me
2026-04-13 00:01:55 +00:00
Mark Rousskov d8994639a6 Switch channel to stable 2026-04-12 15:51:55 -04:00
Josh Stone 41fadcd0ba Patch musl's CVE-2026-6042 and CVE-2026-40200
- [CVE-2026-6042] is a denial of service in `iconv`.
- [CVE-2026-40200] is an out-of-bounds write in `qsort`.

Neither is relevant to Rust itself, but they could be used in mixed-
language projects that link with our `self-contained/libc.a`.

[CVE-2026-6042]: https://www.openwall.com/lists/oss-security/2026/04/09/19
[CVE-2026-40200]: https://www.openwall.com/lists/musl/2026/04/10/3
2026-04-12 15:51:49 -04:00
Mark Rousskov 0c3f2ab0d4 Cherry-pick latest release notes 2026-04-12 15:50:14 -04:00
bors 2c8c85df04 Auto merge of #154999 - cuviper:beta-next, r=cuviper
[beta] reverts and backports

This reverts two `dbg!` changes to avoid regressions[^1][^2] in the upcoming 1.95 release:

- std: avoid tearing `dbg!` prints rust-lang/rust#149869
- don't drop arguments' temporaries in `dbg!` rust-lang/rust#154074
  - ... which was previously backported in rust-lang/rust#154725

This also reverts a stabilization over a late issue[^3] of semantics:

- Stabilize `assert_matches` rust-lang/rust#137487

And a few other backport/reverts from `main`:

- Revert performing basic const checks in typeck on stable rust-lang/rust#154930 / rust-lang/rust#155033
- Revert "`-Znext-solver` Remove the forced ambiguity hack from search graph" rust-lang/rust#154712
- Clarify that core::range ranges do not have special syntax rust-lang/rust#155002

Clippy is backporting 2 ICE fixes and 1 perf regression (via rust-lang/rust#155051):

- https://github.com/rust-lang/rust-clippy/pull/16685 already backported in https://github.com/rust-lang/rust/pull/154211 to stable. This makes sure that it doesn't regress again in beta/next stable
- https://github.com/rust-lang/rust-clippy/pull/16659 The ICE that is being fixed here was introduced in the 1.95 release cycle
- https://github.com/rust-lang/rust-clippy/pull/16652 Perf regression introduced in the 1.95 release cycle.
  
[^1]: rust-lang/rust#153850
[^2]: rust-lang/rust#154988
[^3]: rust-lang/rust#154406
2026-04-09 20:25:44 +00:00
Alejandra González b6da6b8278 Optimize allow_unwrap_types evaluation to eliminate performance regression (#16652)
Fixes https://github.com/rust-lang/rust-clippy/pull/16605

This PR addresses the 6.2% compilation performance regression introduced
by the original `allow_unwrap_types` implementation (which natively
allocated AST strings on every `unwrap` call via `bumpalo`).

The implementation has been refactored to pre-resolve types securely
without a performance penalty:

**Pre-Resolution Cache via `LateLintPass`**: Instead of executing
`ty.to_string()` and `lookup_path_str` inside the immediate
`unwrap_expect_used` hot check for every method call encountered,
`allow-unwrap-types` configuration strings are now parsed exactly *once*
per crate compilation during the `LateLintPass::check_crate` hook in
`clippy_lints/src/methods/mod.rs`.
**`DefId` Native Storage**: The parsed `DefId` representations are
stored in-memory using highly efficient caching maps directly on the
main `Methods` struct:
- `unwrap_allowed_ids: FxHashSet<DefId>`: Allows instant O(1) lookups
for standard types.
- `unwrap_allowed_aliases: Vec<DefId>`: Tracks type aliases requiring
signature substitution checking later.
**Execution Relief**: Inside `unwrap_expect_used::check()`, string
manipulation is completely removed and `ty::Adt` checking uses
lightning-fast `.contains(&adt.did())` operations to categorically avoid
regression allocation loops. This implementation strongly parallels the
pre-resolution type-routing logic in
`clippy_config::types::create_disallowed_map` without altering the core
`clippy.toml` config requirements.

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

-
[Beta-nomination](https://github.com/rust-lang/rust-clippy/pull/16652#issuecomment-3976671413)
by [samueltardieu](https://github.com/samueltardieu)

*Managed by `@rustbot`—see
[help](https://forge.rust-lang.org/triagebot/note.html) for details*

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
changelog: none
2026-04-09 10:17:13 -07:00
Jason Newcomb c79919aded Fix ICE in swap_binop() (#16659)
Make `swap_binop()` a method of `HirEqInterExpr`, and use the proper
typeck to check the type of an expression.

changelog: none (fix of a regression, should be backported)

Fixes rust-lang/rust-clippy#16505

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

-
[Beta-nomination](https://github.com/rust-lang/rust-clippy/pull/16659#issuecomment-3993931812)
by [samueltardieu](https://github.com/samueltardieu)

*Managed by `@rustbot`—see
[help](https://forge.rust-lang.org/triagebot/note.html) for details*

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
2026-04-09 10:17:13 -07:00
Jason Newcomb 0c9d5f0d25 Fix ICE in match_same_arms (#16685)
The wrong `TypeckResults` was used in the fallback equality function
passed by the `match_same_arms` and `filter_map` lints. Previously,
those fallback functions had no way of using the proper `TypeckResults`.
Those (one per expression being compared) are now passed to the
registered fallback function.

changelog: [`match_same_arms`]: fix internal compiler error

Fixes rust-lang/rust-clippy#16678
Fixes rust-lang/rust-clippy#16686

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

- [Beta
nomination](https://github.com/rust-lang/rust-clippy/pull/16685#issuecomment-4017155418)
by [samueltardieu](https://github.com/samueltardieu)

*Managed by `@rustbot`—see
[help](https://forge.rust-lang.org/triagebot/note.html) for details*

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
2026-04-09 10:17:13 -07:00
Jake Goulding 6ae56934ab Clarify that core::range::{Range,RangeFrom,RangeToInclusive} do not have special syntax
I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.

(cherry picked from commit eef4363403)
2026-04-09 08:40:07 -07:00
Jake Goulding 2b3d5e6a41 Clarify that core::range::RangeInclusive does not have special syntax
I'm ignoring the fact that there's a feature to change the behavior of
the syntax. I just want to help prevent confusing the people reading
the docs.

(cherry picked from commit 092f0ca1bd)
2026-04-09 08:36:50 -07:00
Rémy Rakic 524789f8ab Revert "Rollup merge of #149904 - ShoyuVanilla:ns-remove-sg-hack, r=lcnr"
This reverts commit c108ad5617, reversing
changes made to 485f76b835.

(cherry picked from commit 22faa52629)
2026-04-09 08:36:12 -07:00
Oli Scherer 2c2e33ac59 Revert performing basic const checks in typeck on stable 2026-04-09 08:34:04 -07:00
Josh Stone d0b5e61fe7 Revert "Stabilize assert_matches"
This reverts commit 2f3b952349.
2026-04-08 14:10:50 -07:00
Josh Stone aad47fb47d Revert "Rollup merge of #149869 - joboet:torn-dbg, r=Mark-Simulacrum"
This reverts commit cc666ba8f4, reversing
changes made to 2da5959600.
2026-04-08 10:41:06 -07:00
Josh Stone cb5a91376e Revert "don't drop arguments' temporaries in dbg!"
This reverts commit 4f50466be4.
2026-04-08 09:45:57 -07:00
Josh Stone bca08d8c93 Revert "update diagnostic for variables moved by dbg!"
This reverts commit 1374038f80.
2026-04-08 09:45:54 -07:00
bors cc969f3c45 Auto merge of #154725 - cuviper:beta-next, r=cuviper
[beta] backports

- stdarch subtree update rust-lang/rust#153336 (partial)
  - aarch64: fix UB in non-power-of-two reads and writes rust-lang/stdarch#2042
- add neon load/store assembly test rust-lang/rust#154094
- don't drop arguments' temporaries in `dbg!` rust-lang/rust#154074
- Init self_decl with a correct vis rust-lang/rust#154313
- Update LLVM to 22.1.2 rust-lang/rust#154344
- [perf] Revert FastISel patch rust-lang/rust#154511
- core: Destabilize beta-stable `RangeInclusiveIter::remainder` rust-lang/rust#154459
- Revert "Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup" rust-lang/rust#154700
- core: Update the feature gate on `TryFrom<integer> for bool` rust-lang/rust#154691

r? cuviper
2026-04-03 07:29:44 +00:00
Trevor Gross 940fc4d3b3 core: Update the feature gate on TryFrom<integer> for bool
This implementation was added recently in f12288ec26
("TryFrom<integer> for bool") but used an old feature gate and
stabilization version. Update to reflect when these were actually added.

(cherry picked from commit 02b516afd9)
2026-04-02 11:39:38 -07:00
Wesley Wiser 5dacf5d54d Revert "Fix: On wasm targets, call panic_in_cleanup if panic occurs in cleanup"
This reverts commit acbfd79acf.

(cherry picked from commit c9d3a00cd1)
2026-04-02 11:39:06 -07:00
Trevor Gross f68f5980c3 core: Move {RangeIter, RangeFromIter}::remainder to new_range_remainder
Split the remainder functions from the rest of `std::range`.

(cherry picked from commit 0bb3fe315e)
2026-04-02 11:38:37 -07:00
Trevor Gross b7bdc7aee2 core: Destabilize beta-stable RangeInclusiveIter::remainder
As discussed, make this portion of the range API unstable again. This
will now be tracked under `new_range_remainder`.

Discussion: https://rust-lang.zulipchat.com/#narrow/channel/327149-t-libs-api.2Fapi-changes/topic/.60RangeFrom.3A.3Aremainder.60.20possible.20panic/with/582108913
(cherry picked from commit cbc94349d0)
2026-04-02 11:28:50 -07:00
Nikita Popov 533179a437 [perf] Revert FastISel patch
This change caused a significant compile-time regression for
debug builds.

(cherry picked from commit 1a320616e9)
2026-04-02 11:07:50 -07:00
dianqk 6db4dfefe1 Update LLVM to 22.1.2
(cherry picked from commit 283d705b31)
2026-04-02 11:07:43 -07:00
mu001999 195f9764c0 Init self_decl with a correct vis
(cherry picked from commit 01795c3eab)
2026-04-02 11:07:33 -07:00
dianne 1374038f80 update diagnostic for variables moved by dbg!
(cherry picked from commit 7d1b41cbb3)
2026-04-02 11:05:25 -07:00
dianne 4f50466be4 don't drop arguments' temporaries in dbg!
(cherry picked from commit 51816efcc0)
2026-04-02 11:05:25 -07:00
Folkert de Vries 73caca416f add neon load/store assembly test
(cherry picked from commit 35f9cb6eee)
2026-04-02 10:43:00 -07:00
Folkert de Vries e427d29e3c aarch64: fix UB in non-power-of-two reads and writes
(cherry picked from commit 2fa37e7b34)
2026-04-02 10:41:57 -07:00
bors 8ebd005178 Auto merge of #154307 - ShoyuVanilla:beta-fix, r=jieyouxu
[beta] Revert #151380 in beta

cc https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports/topic/.23153869.3A.20beta-nominated/with/581306395

r? ghost
2026-04-01 20:23:34 +00:00
bors 66bcd258f0 Auto merge of #154346 - ehuss:beta-backports, r=ehuss
[beta] backports

- Update cargo
- https://github.com/rust-lang/rust/pull/153763: Don't add empty target features for target-cpu=native on macOS 
- https://github.com/rust-lang/rust/pull/153491: Move `freeze_*` methods to `OpenOptionsExt2`
2026-03-25 05:58:23 +00:00
Jonathan Brouwer a692f685c7 Rollup merge of #153491 - ChrisDenton:openoptionsext2, r=Mark-Simulacrum
Move `freeze_*` methods to `OpenOptionsExt2`

Move the unstable `freeze_last_access_time` and `freeze_last_write_time` from `OpenOptionsExt` to a new `OpenOptionsExt2` trait. This should fix rust-lang/rust#153486.
2026-03-24 18:23:04 -07:00
Jonathan Brouwer 470cb0754e Rollup merge of #153763 - nikic:target-cpu-native-fix, r=lqd
Don't add empty target features for target-cpu=native on macOS

LLVM does not support host feature detection (only host cpu detection) on apple platforms. As such, the returned feature string will be empty. Adding this empty string to the target-features attribute results in a verifier error on LLVM 22.

Fix this by not adding the empty string to the target features. The reason why this was not caught by the target-cpu-native test is that it requires a function that adds *some* target features, otherwise the attribute is omitted entirely. We achieve this with a somewhat peculiar construction that enables `neon` if it's already enabled. (This is to avoid enabling it on softfloat targets.)

Fixes https://github.com/rust-lang/rust/issues/153397.
2026-03-24 18:16:01 -07:00
Eric Huss 5b5a9cf5f0 Update cargo submodule
2 commits in e8eb8435d5cad936237a1ee798c2f983624d0825..f2d3ce0bd7f24a49f8f72d9000448f8838c4e850
2026-03-06 12:51:00 -0600 to 2026-03-21 06:43:08 -0500
- [beta 1.95] Fix symlink_and_directory when running in a long target dir name (rust-lang/cargo#16776)
- [beta 1.95] Update tar to 0.4.45 (rust-lang/cargo#16770)
2026-03-24 18:15:16 -07:00
Shoyu Vanilla 63cd511300 Revert "Auto merge of #151380 - ShoyuVanilla:shallow-resolve-to-root-var, r=lcnr"
This reverts commit 75b9d89c68, reversing
changes made to 7bee525095.
2026-03-24 20:57:08 +09:00
bors 951adfe62e Auto merge of #153958 - fmease:beta-dyn-ace-gingerly-care, r=BoxyUwU
[beta] Don't look for non-type-level assoc consts when checking trait object types

Beta backport of PR rust-lang/rust#153738. Said PR can't just be rebased onto beta as it needs slight adjustments due to PR RUST-153050 not being part of beta.

Directly fixes rust-lang/rust#153731.

~~Blocked on backport acceptance by T-compiler~~ (done) (nomination happened / nomination procedure happens over at rust-lang/rust#153738, not here).
2026-03-19 21:25:41 +00:00
León Orell Valerian Liehr bdc1b3ffa8 [beta] Don't look for non-type-level assoc consts when checking trait object types 2026-03-17 01:54:26 +01:00
bors 94a8e826a5 Auto merge of #153530 - lnicola:lockfile-path-backport, r=Veykril
[beta] backport rust-analyzer `lockfile-path` fix

Closes rust-lang/rust-analyzer#21761
Closes rust-lang/rust-analyzer#21783
2026-03-08 21:32:40 +00:00
bors 64e2968f2c Auto merge of #153463 - cuviper:beta-next, r=cuviper
[beta] update stage0 and cargo

Update stage0 to 1.94.0

<https://forge.rust-lang.org/release/process.html#beta-stage0-update-friday>

---

Update cargo submodule rust-lang/rust#153515

2 commits in f298b8c82da0cba538516b45b04a480fc501d4c0..e8eb8435d5cad936237a1ee798c2f983624d0825
2026-02-24 21:59:20 +0000 to 2026-03-06 12:51:00 -0600
- [beta-1.95] Add missing truncate when writing .crate files (rust-lang/cargo#16713)
- [beta 1.95] backport test fixes (rust-lang/cargo#16715)
2026-03-07 09:42:59 +00:00
Laurențiu Nicola d2cb7e4ef1 Tweak pre-release check for beta 2026-03-07 11:21:06 +02:00
Laurențiu Nicola b93cdbfcfa Use -Zlockfile-path on every 1.95 nightly 2026-03-07 11:20:59 +02:00
Weihang Lo 1b95471493 [beta-1.95] Update cargo submodule 2026-03-06 21:45:02 -08:00
Josh Stone f96caa95f1 update stage0 to 1.94.0 2026-03-05 15:14:40 -08:00
bors ad726b5063 Auto merge of #153314 - cuviper:beta-next, r=cuviper
[beta] prepare Rust 1.95.0-beta

Ref: https://forge.rust-lang.org/release/process.html#beta-pr

- Replace version placeholders with 1.95.0
- Bump to beta release
- library/test: always enable unstable features for miri rust-lang/rust#153369 

r? cuviper
2026-03-05 05:16:37 +00:00
Josh Stone 752b6637ce library/test: always enable unstable features for miri
The unstable features of the `test` crate used to be default-enabled,
and manually disabled when building the beta and stable channels. Commit
dae8ea92a7 flipped that to default-disabled, only enabled for nightly
and dev channels.

However, this broke miri testing on the beta/stable channels, because it
also uses unstable features -- which should be fine to enable just for
its own sysroot build. Now the `test` build script makes that happen by
noticing the `MIRI_CALLED_FROM_SETUP` environment variable.

(cherry picked from commit 30d7ed4c47)
2026-03-04 13:48:26 -08:00
Josh Stone 23b953f802 Bump to beta release 2026-03-02 15:01:23 -08:00
Josh Stone bad24ccbec Replace version placeholders with 1.95.0 2026-03-02 15:00:53 -08:00
bors 67aec36df7 Auto merge of #153183 - JonathanBrouwer:rollup-APFHc2s, r=JonathanBrouwer
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#151143 (explicit tail calls: support indirect arguments)
 - rust-lang/rust#153012 (Stop using `LinkedGraph` in `lexical_region_resolve`)
 - rust-lang/rust#153175 (Clarify a confusing green-path function)
 - rust-lang/rust#153179 (Force a CI LLVM stamp bump)
 - rust-lang/rust#150828 (Improved security section in rustdoc for `current_exe`)
 - rust-lang/rust#152673 (rustc_public: rewrite `bridge_impl` to reduce boilerplate)
 - rust-lang/rust#152674 (rustc_public: remove the `CrateDefItems` trait)
 - rust-lang/rust#153073 (Fix mem::conjure_zst panic message to use any::type_name instead)
 - rust-lang/rust#153117 (Remove mutation from macro path URL construction)
 - rust-lang/rust#153128 (Recover feature lang_items for emscripten)
 - rust-lang/rust#153138 (Print path root when printing path)
 - rust-lang/rust#153159 (Work around a false `err.emit();` type error in rust-analyzer)
2026-02-27 22:04:20 +00:00
Jonathan Brouwer 70da804451 Rollup merge of #153159 - Zalathar:emit-workaround, r=nnethercote
Work around a false `err.emit();` type error in rust-analyzer

For whatever reason, rust-analyzer doesn't see that these calls to `err.emit();` are diverging, so the trailing semicolon makes r-a complain about a type mismatch between `()` and some other type.

Removing the trailing semicolon makes no functional difference (because the emit still unwinds the stack), but seems to be enough to allow rust-analyzer to see that emitting an error returns `!` in these cases, which silences the false error.
2026-02-27 14:05:38 +01:00