Skip to content

fix: offer on const like path-expr for 'extract_variable'#21809

Open
A4-Tacks wants to merge 1 commit intorust-lang:masterfrom
A4-Tacks:extract-const-like-path-expr
Open

fix: offer on const like path-expr for 'extract_variable'#21809
A4-Tacks wants to merge 1 commit intorust-lang:masterfrom
A4-Tacks:extract-const-like-path-expr

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Mar 13, 2026

Fixes #15820

Example

struct Foo;
fn foo() -> Foo {
    $0Foo$0
}

Before this PR

Assist not applicable

After this PR

struct Foo;
fn foo() -> Foo {
    let foo = Foo;
    foo
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 13, 2026
Example
---
```rust
struct Foo;
fn foo() -> Foo {
    $0Foo$0
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
struct Foo;
fn foo() -> Foo {
    let foo = Foo;
    foo
}
```
@A4-Tacks A4-Tacks force-pushed the extract-const-like-path-expr branch from 920b2c5 to b7c4100 Compare March 13, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty tuple struct initialization cannot be extracted as function

2 participants