Skip to content

Conversation

A4-Tacks
Copy link
Contributor

@A4-Tacks A4-Tacks commented Oct 11, 2025

Close #20830

Example

struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Fo$0;
}

Before this PR:

struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Foo { bar: ${1:()}, n: ${2:()} }$0;
}

After this PR:

struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Foo { bar$1, n: ${2:()} }$0;
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 11, 2025
Example
---
```rust
struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Fo$0;
}
```

**Before this PR**:

```rust
struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Foo { bar: ${1:()}, n: ${2:()} }$0;
}
```

**After this PR**:

```rust
struct Foo { bar: bool, n: i32 }

fn baz() {
    let bar = true;
    let foo: Foo = Foo { bar$1, n: ${2:()} }$0;
}
```
@A4-Tacks A4-Tacks force-pushed the record-expr-shorthand branch from 9469076 to 6c29055 Compare October 11, 2025 06:01
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.

Support struct expression shorthand field

2 participants