Commit graph

34552 commits

Author SHA1 Message Date
Marijn Schouten
618c3de146 Remove duplicate impl of string unescape 2025-05-06 10:00:22 +00:00
bors
712e178a6d Auto merge of #131160 - ismailarilik:handle-potential-query-instability-lint-for-rustc-middle, r=oli-obk
Handle `rustc_middle` cases of `rustc::potential_query_instability` lint

This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_middle/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/lib.rs#L29) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors.

A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447

r? `@compiler-errors`
2025-05-06 01:36:23 +00:00
bors
d6ad86fc43 Auto merge of #140664 - RalfJung:miri-sync, r=RalfJung
Miri subtree update

r? `@ghost`
2025-05-05 19:14:42 +00:00
bors
676ac98bc7 Auto merge of #140651 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-05-05 15:00:09 +00:00
bors
5e850d851f Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obk
Remove global `next_disambiguator` state and handle it with a `DisambiguatorState` type

This removes `Definitions.next_disambiguator` as it doesn't guarantee deterministic def paths when `create_def` is called in parallel. Instead a new `DisambiguatorState` type is passed as a mutable reference to `create_def` to help create unique def paths. `create_def` calls with distinct  `DisambiguatorState` instances must ensure that that the def paths are unique without its help.

Anon associated types did rely on this global state for uniqueness and are changed to use (method they're defined in + their position in the method return type) as the `DefPathData` to ensure uniqueness. This also means that the method they're defined in appears in error messages, which is nicer.

`DefPathData::NestedStatic` is added to use for nested data inside statics instead of reusing `DefPathData::AnonConst` to avoid conflicts with those.

cc `@oli-obk`
2025-05-05 11:50:43 +00:00
Lukas Wirth
3b57c00151
Merge pull request #19739 from Veykril/push-kpozprqnsmkk
Disable fixpoint for variance computation temporarily
2025-05-04 04:26:25 +00:00
Lukas Wirth
7d51ec376a Disable fixpoint for variance computation temporarily 2025-05-04 06:09:34 +02:00
Lukas Wirth
bfb717ac09
Merge pull request #19735 from A4-Tacks/improve-let-snippet
Improve the let code snippet
2025-05-04 04:06:56 +00:00
bors
1502c64b88 Auto merge of #140535 - dtolnay:hashbrown, r=tgross35
Update hashbrown dependency to unblock ExtractIf improvements

Release notes: https://github.com/rust-lang/hashbrown/releases/tag/v0.15.3

Relevant to me, this release includes https://github.com/rust-lang/hashbrown/pull/616 which unblocks https://github.com/rust-lang/rust/pull/139764.
2025-05-03 23:49:11 +00:00
bors
04c94e8d32 Auto merge of #140502 - nikic:llvm-20.1.4, r=dianqk
Update to LLVM 20.1.4

Fixes https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/Why.20is.20the.20compiler.20failing.20on.20below.20code.3F.
2025-05-03 17:03:37 +00:00
bors
707ec70aa2 Auto merge of #140464 - oli-obk:successors-mut-perf, r=petrochenkov
Use a closure instead of three chained iterators

Fixes the perf regression from #123948

That PR had chained a third option to the iterator which apparently didn't optimize well
2025-05-03 10:43:38 +00:00
A4-Tacks
850d122fd4
Improve let snippet 2025-05-03 17:04:11 +08:00
A4-Tacks
d922c20158
Improve the let code snippet 2025-05-03 13:15:32 +08:00
bors
9455557b97 Auto merge of #140442 - osiewicz:collector-walk-less-fine-grained-locking, r=wesleywiser
mono collector: Reduce # of locking while walking the graph

While profiling Zed's dev build I've noticed that while most of the time `upstream_monomorphizations` takes a lot of time in monomorpization_collector, in some cases (e.g. build of `editor` itself) the rest of monomorphization_collector_graph_walk dominates it. Most of the time is spent in collect_items_rec.

This PR aims to reduce the number of locks taking place; instead of locking output MonoItems once per children of current node, we do so once per *current node*. We also get to reuse locks for mentioned and used items. While this commit does not reduce Wall time of Zed's build, it does shave off CPU time (measured with `cargo build -j1`) from 48s to 47s. I've also tested it with parallel frontend against Zed and ripgrep and found no regressions.
2025-05-03 00:24:14 +00:00
Lukas Wirth
6f9c62dfec
Merge pull request #19733 from ShoyuVanilla/issue-19724
fix: Implement mut to const ptr cast for method resolution
2025-05-02 20:48:24 +00:00
Lukas Wirth
3bf5d7f7f9
Merge pull request #19732 from ShoyuVanilla/issue-19730
fix: Correct assoc ty bound var starting index
2025-05-02 20:46:54 +00:00
Shoyu Vanilla
4aa98bf1d7 fix: Implement mut to const ptr cast for method resolution 2025-05-03 03:01:40 +09:00
bors
473e234d69 Auto merge of #140406 - Urgau:autorefs-perf, r=nnethercote
perf: delay checking of `#[rustc_no_implicit_autorefs]` in autoref lint

Try to address the regression seen in https://github.com/rust-lang/rust/pull/123239#issuecomment-2835418470 by delaying the checking of `#[rustc_no_implicit_autorefs]` on method call.
2025-05-02 17:35:50 +00:00
Lukas Wirth
be7433328e
Merge pull request #19731 from Veykril/push-mmvowomkpwxy
refactor: Simplify macro call id construction
2025-05-02 15:38:17 +00:00
Shoyu Vanilla
9f60884db7 fix: Correct assoc ty bound var starting index 2025-05-03 00:31:33 +09:00
Lukas Wirth
5d43e752ad refactor: Simplify macro call id construction 2025-05-02 17:26:48 +02:00
Lukas Wirth
9625ef795d
Merge pull request #19581 from Veykril/push-uvyutolsqnun
Render more lifetimes
2025-05-02 12:47:03 +00:00
Lukas Wirth
235d88bf42 Render more lifetimes 2025-05-02 14:36:18 +02:00
bors
495a416076 Auto merge of #139883 - matthiaskrgr:crashesapr15, r=Mark-Simulacrum
crashes: more tests

try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: x86_64-gnu
try-job: dist-i586-gnu-i586-i686-musl
try-job: test-various
2025-05-02 10:46:51 +00:00
Ralf Jung
29031f848a
Merge pull request #4305 from RalfJung/squash
add ./miri squash
2025-05-02 07:02:36 +00:00
bors
c6f4b577eb Auto merge of #139965 - amandasystems:marginally-improved-scc-annotations, r=lcnr
Decouple SCC annotations from SCCs

This rewires SCC annotations to have them be a separate, visitor-type data structure. It was broken out of #130227, which needed them to be able to remove unused annotations after computation without recomputing the SCCs themselves.

As a drive-by it also removes some redundant code from the hot loop in SCC construction for a performance improvement.

r? lcnr
2025-05-01 16:04:19 +00:00
bors
9b44db25af Auto merge of #138522 - osiewicz:shared-generics-respect-visibility, r=bjorn3
shared-generics: Do not share instantiations that contain local-only types

In Zed shared-generics loading takes up a significant chunk of time in incremental build, as rustc deserializes rmeta of all dependencies of a crate. I've recently realized that shared-generics includes all instantiations of some_generic_function in the following snippet:
```rs
pub fn some_generic_function(_: impl Fn()) {}

pub fn non_generic_function() {
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
}
```
even though none of these instantiations can actually be created from outside of `non_generic_function`. This is a dummy example, but we do rely on invoking callbacks with FnOnce a lot in our codebase.

This PR makes shared-generics account for visibilities of generic arguments; an item is only considered for exporting if it is reachable from the outside or if all of it's arguments are visible outside of the local crate.

This PR reduces incremental build time for Zed (touch editor.rs scenario) from 12.4s to 10.4s. I'd love to see a perf run if possible; per my checks this PR does not incur new instantiations in downstream crates, so if there'd be perf regressions, I'd expect them to come from newly-introduced visibility checks.
2025-05-01 11:57:11 +00:00
Ralf Jung
f3c37d0c8d
Merge pull request #4273 from yoctocell/new-cell-state
TB: add `Cell` state to support more fine-grained tracking of interior mutable data
2025-05-01 10:06:52 +00:00
Laurențiu Nicola
298fa81aac
Merge pull request #19727 from matthiaskrgr/enolc
remove a couple of clones
2025-05-01 09:52:49 +00:00
Matthias Krüger
573c47c9ba remove a couple of clones 2025-05-01 11:41:42 +02:00
Laurențiu Nicola
6c9cf51c55
Merge pull request #19726 from lnicola/sync-from-rust
Sync from downstream again
2025-05-01 07:33:30 +00:00
Laurențiu Nicola
b3fd9bc081 Merge from rust-lang/rust 2025-05-01 10:22:16 +03:00
Laurențiu Nicola
eed4d68feb Preparing for merge from rust-lang/rust 2025-05-01 10:21:52 +03:00
Laurențiu Nicola
566870d788 Update lockfile 2025-05-01 10:21:46 +03:00
Lukas Wirth
978ee090b3
Merge pull request #19725 from Veykril/push-xwqzzsklslrq
Bump salsa
2025-05-01 05:38:40 +00:00
Lukas Wirth
8cb44cc129 Bump salsa 2025-05-01 07:27:32 +02:00
Oli Scherer
8a79737e91
Merge pull request #4304 from rust-lang/rustup-2025-05-01
Automatic Rustup
2025-05-01 05:27:22 +00:00
The Miri Cronjob Bot
0e239b3674 Merge from rustc 2025-05-01 05:01:02 +00:00
bors
a2052e94ac Auto merge of #140145 - Zoxc:job-server-proxy, r=SparrowLii
Add a jobserver proxy to ensure at least one token is always held

This adds a jobserver proxy to ensure at least one token is always held by `rustc`. Currently with `-Z threads` `rustc` can temporarily give up all its tokens, causing `cargo` to spawn additional `rustc` instances beyond the job limit.

The current behavior causes an issue with `cargo fix` which has a global lock preventing concurrent `rustc` instances, but it also holds a jobserver token, causing a deadlock when `rustc` gives up its token. That is fixed by this PR.

Fixes https://github.com/rust-lang/rust/issues/67385.
Fixes https://github.com/rust-lang/rust/issues/133873.
Fixes https://github.com/rust-lang/rust/issues/140093.
2025-05-01 04:11:52 +00:00
bors
39c198d823 Auto merge of #121909 - Zoxc:drop-ast-task, r=petrochenkov
Drop AST on a separate thread and prefetch `hir_crate`

This drop AST on a separate thread and prefetches `hir_crate`.

A `spawn` function is added to the `parallel` module which spawn some work on the Rayon thread pool.
2025-04-30 23:57:22 +00:00
bors
fdcdecb52b Auto merge of #140529 - matthiaskrgr:rollup-jpaa2ky, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #140385 (Subtree update of `rust-analyzer`)
 - #140458 (Fix for async drop ice with partly dropped tuple)
 - #140465 (chore: edit and move tests)
 - #140467 (Don't FCW assoc consts in patterns)
 - #140468 (Minor tweaks to make some normalization (adjacent) code less confusing)
 - #140470 (CI: rfl: move job forward to Linux v6.15-rc4)
 - #140476 (chore: delete unused ui/auxiliary crates)
 - #140481 (Require sanitizers be enabled for asan_odr_windows.rs)
 - #140486 (rustfmt: Also allow bool literals as first item of let chain)
 - #140494 (Parser: Document restrictions)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-30 20:42:22 +00:00
Matthias Krüger
8a48f228b6
Rollup merge of #140494 - ehuss:document-restrictions, r=traviscross,SparrowLii
Parser: Document restrictions

I had trouble easily understanding what these various flags do. This is my attempt to try to explain what these do.
2025-04-30 22:36:44 +02:00
Matthias Krüger
2ecf2ab393
Rollup merge of #140486 - calebcartwright:rustfmt-let-chain-bool-lit, r=calebcartwright
rustfmt: Also allow bool literals as first item of let chain

This is a functional cherry-pick of https://github.com/rust-lang/rustfmt/pull/6492

I'm bringing this change over directly as the subtree sync is taking more effort than anticipated (some unrelated r-l/rustfmt changes need to be reverted before we perform the full sync) and we need to ensure that rustfmt behavior accounts with the final style guide rules as part of let chain stabilization.

r? ````@ghost````
2025-04-30 22:36:43 +02:00
Matthias Krüger
e112df23b8
Rollup merge of #140481 - dpaoliello:reqasan, r=wesleywiser
Require sanitizers be enabled for asan_odr_windows.rs

Issue Details:
The `asan_odr_windows.rs` test is failing on AArch64 Windows, as sanitizers aren't supported on that platform.

Fix Details:
Apply the correct "need sanitizer" requirements to the test.
2025-04-30 22:36:43 +02:00
Matthias Krüger
c9508f131e
Rollup merge of #140476 - mejrs:test3, r=jieyouxu
chore: delete unused ui/auxiliary crates

It appears that all the tests that used it have been moved to tests/ui/editions/ (or elsewhere) already.

r? `````@jieyouxu`````
2025-04-30 22:36:42 +02:00
Matthias Krüger
ba874c32a2
Rollup merge of #140470 - ojeda:rfl, r=lqd
CI: rfl: move job forward to Linux v6.15-rc4

A hopefully routine upgrade to Linux v6.15-rc4!

r? `````@lqd````` `````@Kobzol`````
try-job: x86_64-rust-for-linux
`````@rustbot````` label A-rust-for-linux
`````@bors````` try
2025-04-30 22:36:41 +02:00
Matthias Krüger
c2bc39bff1
Rollup merge of #140468 - BoxyUwU:normalization_confusings2, r=lcnr
Minor tweaks to make some normalization (adjacent) code less confusing

r? lcnr

sorry for double ping lol
2025-04-30 22:36:41 +02:00
Matthias Krüger
2527f9c602
Rollup merge of #140467 - BoxyUwU:no_fcw_assoc_consts, r=lcnr
Don't FCW assoc consts in patterns

Fixes #140447

See comment in added test. We could also check that the anon const is a const arg by looking at the HIR. I'm not sure that's necessary though 🤔 The only consts that are evaluated "for the type system" are const args (which *should* get FCWs) and const patterns (which cant be anon consts afaik).
2025-04-30 22:36:40 +02:00
Matthias Krüger
a44980924e
Rollup merge of #140465 - mejrs:test2, r=jieyouxu
chore: edit and move tests

I deleted `ui/non-copyable-void.rs`: added in ab4105d9e8 to test that "nonconstructable" enums are "noncopyable", but these properties are not correlated anymore.

Second commit is kinda messy because I moved/edited/renamed some files at the same time, but I deleted nothing there.
2025-04-30 22:36:40 +02:00
Matthias Krüger
9c2c41595a
Rollup merge of #140458 - azhogin:azhogin/async-drop-fix-dropped-tuple-ice, r=oli-obk
Fix for async drop ice with partly dropped tuple

Fixes https://github.com/rust-lang/rust/issues/140427.
Problem was with block data access with block id from new added blocks in patch.
2025-04-30 22:36:39 +02:00