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
mu001999
bcb0e2207a
Remove unused features in tools
2026-03-04 08:06:36 +08:00
Daniel Scherzer
7ff962b02a
Comments and docs: add missing periods to "ie."
...
"i.e." is short for the Latin "id est" and thus both letters should be followed
by periods.
2026-03-02 18:11:13 -08:00
Jonathan Brouwer
8698ce8d7e
Rollup merge of #153211 - lnicola:sync-from-ra, r=lnicola
...
`rust-analyzer` subtree update
Subtree update of `rust-analyzer` to fbc7b76b27 .
Created using https://github.com/rust-lang/josh-sync .
r? @ghost
2026-02-28 12:52:51 +01:00
Lukas Wirth
fbc7b76b27
Merge pull request #21669 from Shourya742/2026-02-18-add-span-parent
...
Implement Span::SpanParent for proc-macro-srv
2026-02-28 07:25:41 +00:00
SpiZeak
fa0e4ed012
fix: migrate to SyntaxEditor in generate_derive assist
2026-02-27 11:09:44 +01:00
Shoyu Vanilla (Flint)
8494a8b3b7
Merge pull request #21710 from SpiZeak/migrate-fix-visibility
...
Migrate fix_visibility assist to use SyntaxEditor
2026-02-27 07:55:59 +00:00
SpiZeak
dd8e886398
feat: migrate fix_visibility assist to SyntaxEditor
2026-02-27 08:19:56 +01:00
Laurențiu Nicola
ba09b3315e
Use -Zlockfile-path on every 1.95 nightly
2026-02-27 08:53:39 +02:00
Shoyu Vanilla (Flint)
df080dbbd5
Merge pull request #21706 from A4-Tacks/redundant-enum-variant-pat
...
fix: no complete enum variant qualifier in pat
2026-02-27 02:17:11 +00:00
Shoyu Vanilla (Flint)
d33510122b
Merge pull request #21698 from A4-Tacks/indent-iflet-with-match
...
fix: Fix scrutinee expr indent for replace_if_let_with_match
2026-02-27 02:12:58 +00:00
Shoyu Vanilla (Flint)
d3ea35e498
Merge pull request #21699 from Albab-Hasan/fix/ptr-cast-add-auto-trait-not-detected
...
fix: Detect E0804 when casting raw ptr-to-dyn adds auto traits
2026-02-27 02:11:49 +00:00
Lukas Wirth
56b59a8328
Merge pull request #21708 from lnicola/no-invalid-notification-panic
...
fix: Don't panic on invalid LSP notifications
2026-02-26 08:27:07 +00:00
Laurențiu Nicola
26186144e7
Don't panic on invalid notifications
2026-02-25 21:06:33 +02:00
mu001999
f91be08311
Remove redundant self usages
2026-02-25 22:51:53 +08:00
A4-Tacks
423c466df5
fix: no complete enum variant qualifier in pat
...
Example
---
```rust
enum Enum { TupleV(u32), RecordV { field: u32 }, UnitV }
use Enum::*;
fn func() {
if let $0 = unknown {}
}
```
**Before this PR**
```text
...
ev RecordV
ev TupleV
ev UnitV
bn RecordV {…} RecordV { field$1 }$0
bn TupleV(…) TupleV($1)$0
bn UnitV UnitV$0
kw mut
kw ref
```
**After this PR**
```text
...
bn RecordV {…} RecordV { field$1 }$0
bn TupleV(…) TupleV($1)$0
bn UnitV UnitV$0
kw mut
kw ref
```
2026-02-25 20:52:50 +08:00
Wilfred Hughes
57527228ad
internal: Skip rustfmt test if nightly toolchain is missing
...
Currently the rustfmt slow test fails if you don't have a nightly
toolchain installed. We install a nightly toolchain on CI, but it's a
little confusing that tests can fail on a fresh checkout on a new
laptop.
Instead, skip this test if there's no nightly toolchain.
2026-02-24 14:26:32 -05:00
Albab-Hasan
da7b8bbec2
fix: detect E0804 when casting raw ptr-to-dyn adds auto traits
...
the `check_ptr_ptr_cast` function had an early return when the source and
destination dyn trait objects shared the same principal trait def id:
if src_principal == dst_principal {
return Ok(());
}
this bypassed all three remaining checks that the code comment explicitly
listed as required: generic argument equality, projection equality, and
the auto-trait superset check. as a result, casts like
`*mut dyn Trait as *mut (dyn Trait + Send)` were silently accepted
instead of emitting E0804.
the fix removes the early return. `CastError::PtrPtrAddingAutoTraits` and
its diagnostic were already implemented — they just couldn't be reached.
the supertrait case (`trait Trait: Send`) continues to work correctly
because the auto-trait check already accounts for implied auto traits via
supertrait elaboration.
2026-02-24 18:59:02 +06:00
A4-Tacks
bc5e169317
fix: Fix scrutinee expr indent for replace_if_let_with_match
...
- Remove some redundant `.clone_for_update()` and `.indent(IndentLevel::single())`
Example
---
```rust
fn main() {
if true {
$0if true
&& false
{
foo()
}
}
}
```
**Before this PR**
```rust
fn main() {
if true {
match true
&& false {
true => foo(),
_ => (),
}
}
}
```
**After this PR**
```rust
fn main() {
if true {
match true
&& false {
true => foo(),
_ => (),
}
}
}
```
2026-02-24 19:12:51 +08:00
The rustc-josh-sync Cronjob Bot
2ee47149d1
Merge ref 'c78a29473a68' from rust-lang/rust
...
Pull recent changes from https://github.com/rust-lang/rust via Josh.
Upstream ref: rust-lang/rust@c78a29473a
Filtered ref: rust-lang/rust-analyzer@d21f4bf288
Upstream diff: 139651428d...c78a29473a
This merge was created using https://github.com/rust-lang/josh-sync .
2026-02-23 04:45:13 +00:00
Chayim Refael Friedman
807f591315
Fix another case where we forgot to put the type param for PartialOrd and PartialEq in builtin derives
2026-02-22 16:58:09 +02:00
Jonathan Brouwer
b6dfc35417
Rollup merge of #147859 - cyrgani:nonfatal-tokenstream-parse, r=petrochenkov,JonathanBrouwer
...
reduce the amount of panics in `{TokenStream, Literal}::from_str` calls
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/147859 )*
Before this PR, calling `TokenStream::from_str` or `Literal::from_str` with an invalid argument would always cause a compile error, even if the `TokenStream` is not used afterwards at all.
This PR changes this so it returns a `LexError` instead in some cases.
This is very theoretically a breaking change, but the doc comment on the impl already says
```
/// NOTE: some errors may cause panics instead of returning `LexError`. We reserve the right to
/// change these errors into `LexError`s later.
```
Fixes some cases of rust-lang/rust#58736 .
2026-02-22 11:31:14 +01:00
protonblu
86e3e3fdbf
fix: correctly parenthesize inverted condition in convert_if_to_bool_then
...
The convert_if_to_bool_then assist was producing incorrect code when
the Some branch was in the else arm and the condition was a method call
expression (e.g. is_empty()).
Before:
if test.is_empty() { None } else { Some(()) }
was incorrectly rewritten to:
test.is_empty().then(|| ())
After (correct):
(!test.is_empty()).then(|| ())
Root cause: the parenthesization check ran on the original condition
before inversion. When invert_boolean_expression produced a PrefixExpr
(e.g. !test.is_empty()), it was not being parenthesized because the
check had already passed on the original MethodCallExpr.
Fix: move the parenthesization check to after the inversion step so it
correctly detects PrefixExpr and wraps it in parentheses.
A regression test has been added to cover this case.
2026-02-21 11:45:24 +05:30
protonblu
ab26b67215
fix: remove redundant comment
2026-02-21 07:24:22 +05:30
protonblu
c4c0ba4fa1
style: apply rustfmt
2026-02-20 19:21:24 +05:30
protonblu
f858569371
fix: generate method assist uses enclosing impl block instead of first found
2026-02-20 19:01:22 +05:30
Chayim Refael Friedman
46a214b5d3
Merge pull request #21389 from A4-Tacks/assist-try-enum-ref
...
Fix some TryEnum reference assists
2026-02-20 11:05:31 +00:00
A4-Tacks
bfdb0e7b41
Do strip references for desugar_try_expr
2026-02-20 18:19:51 +08:00
Shoyu Vanilla (Flint)
8f1f66b49a
Merge pull request #21635 from tascord/import-cfg-fixes
...
fix: Better import placement + merging
2026-02-20 02:08:33 +00:00
Flora Hill
75a8d56f4e
Perf + Test Case RE: ShoyuVanilla
2026-02-19 23:04:01 +00:00
Chayim Refael Friedman
d8e0e96766
Merge pull request #21675 from akashchakrabortymsc-cmd/fix/exclude-tests-macro-refs
...
fix: exclude macro refs in tests when excludeTests is enabled
2026-02-19 12:58:19 +00:00
protonblu
18720696a7
style: fix rustfmt formatting
2026-02-19 17:25:54 +05:30
protonblu
e23b073e71
test: fix exclude_tests_macro_refs test to use custom macro
2026-02-19 17:22:01 +05:30
Chayim Refael Friedman
425bff0151
Merge pull request #21536 from A4-Tacks/toggle-nested-macro-delim
...
fix: offer `toggle_macro_delimiter` in nested macro
2026-02-19 07:32:48 +00:00
A4-Tacks
52de6fa5e3
Merge pull request #21665 from raushan728/fix-param-name-bug
...
fix: prevent qualifying parameter names in add_missing_impl_members
2026-02-19 05:23:19 +00:00
Raushan Kumar
02b4c594ca
style: fix clippy collapsible_if warning
2026-02-19 05:06:43 +00:00
Shoyu Vanilla (Flint)
039106d136
Merge pull request #21540 from J3m3/align-optional-fields
...
minor: clean up `project_json::CrateData` and its corresponding docs
2026-02-19 04:39:04 +00:00
Raushan Kumar
9e3a31b25d
fix: filter non-value definitions in path transform
2026-02-19 04:16:52 +00:00
bit-aloo
e13e5c29e8
add SpanParent implementation in bidirectional variant
2026-02-19 09:35:50 +05:30
bit-aloo
ea60d3c0d9
add SpanParentResult and SpanParent
2026-02-19 09:35:50 +05:30
bit-aloo
3d7509e53c
update ProcMacroClientHandle implementation
2026-02-19 09:35:50 +05:30
bit-aloo
0a4f527e47
add span_parent in MockCallback
2026-02-19 09:35:50 +05:30
bit-aloo
dbe80e87e1
update span_parent implementation to call span_parent in callback
2026-02-19 09:35:50 +05:30
bit-aloo
d9fb39d660
add span_parent method in ProcMacroClientInterface
2026-02-19 09:35:50 +05:30
A4-Tacks
1a1b624c51
Fix some TryEnum reference assists
...
- Fix `convert_to_guarded_return`
- Fix `replace_let_with_if_let`
- Fix `replace_if_let_with_match`
2026-02-19 10:43:03 +08:00
A4-Tacks
c0b4047499
Add partial selection for generate_getter_or_setter
...
Example
---
```rust
struct Context {
data$0: Data,
count$0: usize,
other: usize,
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
struct Context {
data: Data,
count: usize,
other: usize,
}
impl Context {
fn data(&self) -> &Data {
&self.data
}
fn $0count(&self) -> &usize {
&self.count
}
}
```
2026-02-19 10:03:34 +08:00
A4-Tacks
69904a3aa8
Remove fixme
2026-02-19 09:53:35 +08:00
protonblu
edacd0dada
style: fix rustfmt formatting
2026-02-19 02:14:34 +05:30
protonblu
ad0457ecc2
fix: exclude macro refs in tests when excludeTests is enabled
2026-02-19 01:51:08 +05:30
Shoyu Vanilla (Flint)
70f44024cc
Merge pull request #21666 from Wilfred/flycheck_custom_check
...
internal: Add flycheck test for custom check command and debounce
2026-02-18 19:57:22 +00:00