Commit Graph

38598 Commits

Author SHA1 Message Date
Albab-Hasan
d5fc68f77d fix: implement naming convention validation for union types.
generated with ai assistance (claude sonnet 4.6).
2026-03-10 21:08:45 +06:00
A4-Tacks
a1b86d600f Merge pull request #21774 from akashchakrabortymsc-cmd/migrate-unqualify-method-call
Migrate unqualify_method_call assist to SyntaxEditor
2026-03-07 09:58:33 +00:00
protonblu
467d73bd00 Migrate unqualify_method_call assist to SyntaxEditor 2026-03-07 12:44:36 +05:30
A4-Tacks
6522eb865a Merge pull request #21734 from Shourya742/2026-03-02-migrate-already-migrated-assist-to-syntaxFactory
Replace make to syntax factory from already migrated syntax factory assist
2026-03-07 01:45:39 +00:00
Laurențiu Nicola
fad5c3d2d6 Merge pull request #21772 from stinb/syntax-fuzz-build-error
Fix syntax/fuzz build error
2026-03-06 18:46:42 +00:00
Jason Haslam
7bc5632014 Fix syntax/fuzz build error 2026-03-06 11:35:35 -07:00
Lukas Wirth
2f73b8de99 Merge pull request #21770 from Wilfred/vfs_remove_events
fix: Update VFS when a watched file is deleted
2026-03-06 16:39:34 +00:00
Wilfred Hughes
0241582099 fix: Update VFS when a watched file is deleted
When rust-analyzer handles file watching, it previously wouldn't
update the VFS on file deletion. We would discard events where
fs::metadata() isn't available, and we never have metadata for deleted
files.

See also the discussion in rust-lang/rust-analyzer#19907.
2026-03-06 15:57:26 +00:00
Lukas Wirth
a8e2add5c7 Merge pull request #21764 from Veykril/push-wxmovumvpzqm
smol_str: Improve API surface
2026-03-06 11:29:17 +00:00
Chayim Refael Friedman
23cc64a615 Merge pull request #21705 from A4-Tacks/cfg-select-fallback
fix: cfg_select supports non token-tree tokens
2026-03-06 11:08:05 +00:00
bit-aloo
0e510d9eb1 add GetOrCreateWhereClause subtrait in edit to provide get_or_create_where_clause 2026-03-06 15:32:33 +05:30
bit-aloo
3faa0e1a5a remove make from replace_named_generics_with_impl 2026-03-06 15:32:33 +05:30
bit-aloo
65c3f983a5 migrate move bounds to SyntaxEditor API 2026-03-06 15:32:33 +05:30
bit-aloo
776dfd7abe remove make from move_bound 2026-03-06 15:32:33 +05:30
bit-aloo
52511b7cb6 remove make from generate_fn_type_alias_from_new 2026-03-06 15:32:33 +05:30
bit-aloo
01b8ebc91b remove make from generate_default_from_new 2026-03-06 15:32:33 +05:30
bit-aloo
a5b96fc81d remove make from convert_bool_to_enum 2026-03-06 15:32:33 +05:30
bit-aloo
6feab700fc remove make from add_turbo_fish 2026-03-06 15:32:33 +05:30
bit-aloo
2aeb269257 remove make from extract_type_alias 2026-03-06 15:32:33 +05:30
A4-Tacks
c47f4e036a fix: cfg_select supports non token-tree tokens
- Fix single non-curly groups is ignored `true => ((),)`, old: `(),`, new: `((),)`

Example
---
```rust
const _: i32 = cfg_select! { true => 2 + 3, _ => 3 + 4 };
```

**Before this PR**

```rust
const _: i32 = cfg_select! { true => 2 /* expected a token tree after `=>` */+ 3, _ => 3 + 4 };
```

**After this PR**

```rust
const _: i32 = 2 + 3;
```
2026-03-06 18:00:55 +08:00
Lukas Wirth
8ff72bbfec Add some missing smol_str API pieces 2026-03-06 09:55:44 +01:00
Lukas Wirth
ceeac4a298 perf: smol_str — avoid redundant work in eq
feat: add missing APIs to smol_str
docs: Improve safety documentation
fix: borsh deserialization off-by-one for inline threshold
2026-03-06 09:29:47 +01:00
Laurențiu Nicola
0dc6097727 Merge pull request #21763 from lnicola/lockfile-beta
Tweak pre-release check for beta
2026-03-06 05:28:27 +00:00
Laurențiu Nicola
7e440b1d07 Tweak pre-release check for beta 2026-03-06 07:18:44 +02:00
Shoyu Vanilla (Flint)
a1c07fd2ee Merge pull request #21760 from Shourya742/2026-03-06-fix-clippy
Fix clippy on master
2026-03-06 02:55:23 +00:00
bit-aloo
c45f41643a fix clippy on master 2026-03-06 07:10:59 +05:30
Lukas Wirth
2a8f00fb93 Merge pull request #21660 from Wilfred/configure_codecov
internal: Configure codecov
2026-03-05 09:10:51 +00:00
Lukas Wirth
8f36fada93 Merge pull request #21732 from Wilfred/add_claude_rules
internal: Define rules for LLMs
2026-03-05 09:10:32 +00:00
Lukas Wirth
c12d719800 Merge pull request #21755 from oeb25/lsp-server-has-pending
feature: Add `has_pending` methods to `Incoming`/`Outgoing`/`ReqQueue` in `lsp_server`
2026-03-05 09:02:37 +00:00
Lukas Wirth
e8ee51ab9e Merge pull request #21752 from ChayimFriedman2/question-mark-conversion
feat: When going to def on `?` on `Result` that goes through `From`, go to the `From` impl
2026-03-05 08:57:32 +00:00
oeb25
86c523fa50 Add has_pending methods to Incoming and Outgoing in lsp_server
Adds methods for checking if there's pending requests/responses in the
incoming/outgoing channels of `ReqQueue` in `lsp_server`.
2026-03-05 09:49:50 +01:00
Laurențiu Nicola
36169d1cc7 Merge pull request #21753 from rust-lang/rustc-pull
Rustc pull update
2026-03-05 06:52:08 +00:00
The rustc-josh-sync Cronjob Bot
048bfabd85 Merge ref 'f8704be04fe1' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@f8704be04f
Filtered ref: rust-lang/rust-analyzer@5ecd3ed8b0
Upstream diff: e7d90c695a...f8704be04f

This merge was created using https://github.com/rust-lang/josh-sync.
2026-03-05 04:37:29 +00:00
The rustc-josh-sync Cronjob Bot
ea3f645d95 Prepare for merging from rust-lang/rust
This updates the rust-version file to f8704be04fe1150527fc2cf21dd44327f0fe87fb.
2026-03-05 04:36:54 +00:00
Shoyu Vanilla (Flint)
87f5363056 Merge pull request #21750 from ChayimFriedman2/method-res-typingmode
fix: Do not use PostAnalysis TypingMode for IDE method resolution
2026-03-05 02:30:02 +00:00
bors
5ecd3ed8b0 Auto merge of #153416 - JonathanBrouwer:rollup-eezxWTV, r=JonathanBrouwer
Rollup of 12 pull requests



Successful merges:

 - rust-lang/rust#153402 (miri subtree update)
 - rust-lang/rust#152164 (Lint unused features)
 - rust-lang/rust#152801 (Refactor WriteBackendMethods a bit)
 - rust-lang/rust#153196 (Update path separators to be available in const context)
 - rust-lang/rust#153204 (Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors)
 - rust-lang/rust#153317 (Abort after `representability` errors)
 - rust-lang/rust#153276 (Remove `cycle_fatal` query modifier)
 - rust-lang/rust#153300 (Tweak some of our internal `#[rustc_*]` TEST attributes)
 - rust-lang/rust#153396 (use `minicore` in some `run-make` tests)
 - rust-lang/rust#153401 (Migrationg of `LintDiagnostic` - part 7)
 - rust-lang/rust#153406 (Remove a ping for myself)
 - rust-lang/rust#153414 (Rename translation -> formatting)
2026-03-05 00:14:57 +00:00
Chayim Refael Friedman
202fd31d0b When going to def on ? on Result that goes through From, go to the From impl
It's more useful to users than going to `Try::branch()` impl from `Result`, which is in std.
2026-03-05 01:25:35 +02:00
bors
0ba383e58e Auto merge of #151842 - eggyal:skip-deducing-parameter-attrs-during-ctfe, r=RalfJung
Do not deduce parameter attributes during CTFE

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/151842)*

Ever since rust-lang/rust#103172, `fn_abi_of_instance` might look at a function's body to deduce certain codegen optimization attributes for its indirectly-passed parameters beyond what can be determined purely from its signature (namely today `ArgAttribute::ReadOnly` and `ArgAttribute::CapturesNone`). Since rust-lang/rust#130201, looking at a function's body in this way entails generating, for any coroutine-closures, additional by-move MIR bodies (which aren't represented in the HIR)—but this requires knowing the types of their context and consequently cycles can ensue if such bodies are generated before typeck is complete (such as during CTFE).

Since they have no bearing on the evaluation result, this patch breaks a subquery out from `fn_abi_of_instance`, `fn_abi_of_instance_no_deduced_attrs`, which returns the ABI before such parameter attributes are deduced; and that new subquery is used in CTFE instead (however, since parameter attributes are only deduced in optimized builds, as a performance optimization we avoid calling the original query unless we are performing such a build).

Fixes rust-lang/rust#151748
Fixes rust-lang/rust#152497
2026-03-04 20:18:52 +00:00
Chayim Refael Friedman
398419b1e7 Do not use PostAnalysis TypingMode for IDE method resolution
As explained in the comments, PostAnalysis is good for most IDE things but not method resolution.

This fixes a bug which should not be impacted by this at all - return position impl trait in trait. It is currently lowered to an opaque, while it should be lowered to an anonymous associated type. But today when it is lowered as an opaque, this opaque of course has no definition and will normalize to an error, preventing method resolution on it from succeeding in some cases.
2026-03-04 22:06:36 +02:00
Jonathan Brouwer
c17b242c42 Rollup merge of #153414 - JonathanBrouwer:translate_cleanup, r=Kivooeo
Rename translation -> formatting

Because there is no translation happening anymore

r? @Kivooeo
2026-03-04 19:30:42 +01:00
Jonathan Brouwer
aa84ba09e2 Rollup merge of #153406 - jieyouxu:adjust-notifs, r=jieyouxu
Remove a ping for myself

To improve the SNR for my notifs.
r? ghost
2026-03-04 19:30:41 +01:00
Jonathan Brouwer
89d86aff5c Rollup merge of #153401 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Migrationg of `LintDiagnostic` - part 7

Part of https://github.com/rust-lang/rust/issues/153099.

This PR removes the `LintDiagnostic` trait and proc-macro. \o/

r? @JonathanBrouwer
2026-03-04 19:30:40 +01:00
Jonathan Brouwer
b44e8cbfde Rollup merge of #153396 - folkertdev:run-make-minicore, r=jieyouxu
use `minicore` in some `run-make` tests

r? jieyouxu

This manually builds `minicore` in two more `rmake` tests that rolled their own before, and adds a helper for the path of the minicore source. I tried adding a true minicore helper in `run_make_support` but unfortunately the minicore build needs to inherit some (but probably not all) arguments of the final rustc invocation (notably `target` and `target_cpu`), so a one-size-fits-all helper doesn't really work as far as I can see.

For now with 3 uses this is probably fine, but there are probably other `run-make` tests that could use `minicore` but didn't document/simulate that.

follow-up to discussion in https://github.com/rust-lang/rust/pull/153153.
2026-03-04 19:30:40 +01:00
Jonathan Brouwer
0bee9c2d97 Rollup merge of #153300 - fmease:test-attrs-tweaks, r=JonathanBrouwer
Tweak some of our internal `#[rustc_*]` TEST attributes

I think I might be the one who's used the internal TEST attrs `#[rustc_{dump_predicates,object_lifetime_default,outlives,variance}]` the most in recent times, I might even be the only one. As such I've noticed some recent-ish issues that haven't been fixed so far and which keep bothering me. Moreover I have a longstanding urge to rename several of these attributes which I couldn't contain anymore.

[`#[rustc_*]` TEST attributes](https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#rustc_-test-attributes) are internal attributes that basically allow you to dump the output of specific queries for use in UI tests or for debugging purposes.

1. When some of these attributes were ported over to the new parsing API, their targets were unnecessarily restricted. I've kept encountering these incorrect "attribute cannot be used" errors all the while HIR analysis happily & correctly dumped the requested data below it. I've now relaxed their targets.
2. Since we now have target checking for the internal attributes I figured that it's unhelpful if we still intentionally crashed on invalid targets, so I've got rid of that.
3. I've always been annoyed that most of these (very old) attributes don't contain the word `dump` in their name (rendering their purpose non-obvious) and that some of their names diverge quite a bit from the corresponding query name. I've now rectified that. The new names take longer to type but it's still absolutely acceptable imo.

---

I haven't renamed all of the TEST attributes to follow the `rustc_dump_` scheme since that's quite tedious. If it's okay with you I'd like to postpone that (e.g., `rustc_{def_path,hidden_type…,layout,regions,symbol_name}`).

I've noticed that the parsers for TEST attrs are spread across `rustc_dump.rs`, `rustc_internal.rs` & `test_attrs.rs` which is a bit confusing. Since the new names are prefixed with `rustc_dump_` I've moved their parsers into `rustc_dump.rs` but of course they are still TEST attrs. IIRC, `test_attrs.rs` also contains non-`rustc_`-TEST attrs, so we can't just merge these two files. I guess that'll sort itself out in the future when I tackle the other internal TEST attrs.

r\? Jana || Jonathan
2026-03-04 19:30:39 +01:00
Jonathan Brouwer
b4170baced Rollup merge of #153276 - Zoxc:rem-fatal-cycle, r=nnethercote
Remove `cycle_fatal` query modifier

This removes the `cycle_fatal` query modifier as it has no effect on its current users.

The default `CycleErrorHandling::Error` mode does the same as `cycle_fatal` when the default impl of `FromCycleError` is used. The return types of queries using `cycle_fatal` however have no specialized `FromCycleError` impl.
2026-03-04 19:30:38 +01:00
Jonathan Brouwer
2c1b20edab Rollup merge of #153317 - nnethercote:abort-after-infinite-errors, r=oli-obk
Abort after `representability` errors

Doing so results in better error messages and makes the code a bit simpler. Details in individual commits.

r? @oli-obk
2026-03-04 19:30:38 +01:00
Jonathan Brouwer
d48dff9b2d Rollup merge of #153204 - xtqqczze:must-use-map, r=Amanieu,joboet
Add `#[must_use]` attribute to `HashMap` and `HashSet` constructors

- `new_in`
- `with_capacity_and_hasher`
- `with_capacity_and_hasher_in`
- `with_hasher`
- `with_hasher_in`

See also: https://github.com/rust-lang/rust/issues/89692
2026-03-04 19:30:37 +01:00
Jonathan Brouwer
932f27f953 Rollup merge of #153196 - MikkelPaulson:const-path-separators, r=joboet
Update path separators to be available in const context

Tracking issue: rust-lang/rust#153106

This makes platform-dependent secondary path separators available in const context (ie. at compile time). The platform definitions have also been consolidated behind a common macro to prevent transcription errors, whereas previously they were defined 3-4 times per platform.

### Questions

I've manually verified that this compiles against each platform. It seems like no unit tests should be required for this change; is that correct?
2026-03-04 19:30:37 +01:00
Jonathan Brouwer
2ba6fd9f01 Rollup merge of #152801 - bjorn3:lto_refactors14, r=jackh726
Refactor WriteBackendMethods a bit
2026-03-04 19:30:36 +01:00
Jonathan Brouwer
403297d33a Rollup merge of #152164 - mu001999-contrib:lint/unused_features, r=JonathanBrouwer
Lint unused features

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152164)*

Fixes rust-lang/rust#44232
Fixes rust-lang/rust#151752

---

This PR records used features through query side effect, then reports unsued features finally.
2026-03-04 19:30:36 +01:00