Skip to content

Conversation

@A4-Tacks
Copy link
Member

  • Add make::untyped_param
  • Add some basic make tests

Example

make::unnamed_param(make::ty("Vec<T>")),

Before this PR

PARAM@0..4
  IDENT_PAT@0..4
    NAME@0..4
      IDENT@0..4 "Vec"

After this PR

PARAM@0..6
  PATH_TYPE@0..6
    PATH@0..6
      PATH_SEGMENT@0..6
        NAME_REF@0..3
          IDENT@0..3 "Vec"
        GENERIC_ARG_LIST@3..6
          L_ANGLE@3..4 "<"
          TYPE_ARG@4..5
            PATH_TYPE@4..5
              PATH@4..5
                PATH_SEGMENT@4..5
                  NAME_REF@4..5
                    IDENT@4..5 "T"
          R_ANGLE@5..6 ">"

Assist: Generate a type alias for function with unnamed params

fn foo$0(x: Vec<i32>) {}

Before this PR

type FooFn = fn(Vec);

fn foo(x: Vec<i32>) {}

After this PR

type FooFn = fn(Vec<i32>);

fn foo(x: Vec<i32>) {}

- Add `make::untyped_param`
- Add some basic make tests

Example
---
```rust
make::unnamed_param(make::ty("Vec<T>")),

```

**Before this PR**

```text
PARAM@0..4
  IDENT_PAT@0..4
    NAME@0..4
      IDENT@0..4 "Vec"
```

**After this PR**

```text
PARAM@0..6
  PATH_TYPE@0..6
    PATH@0..6
      PATH_SEGMENT@0..6
        NAME_REF@0..3
          IDENT@0..3 "Vec"
        GENERIC_ARG_LIST@3..6
          L_ANGLE@3..4 "<"
          TYPE_ARG@4..5
            PATH_TYPE@4..5
              PATH@4..5
                PATH_SEGMENT@4..5
                  NAME_REF@4..5
                    IDENT@4..5 "T"
          R_ANGLE@5..6 ">"
```

---

Assist: `Generate a type alias for function with unnamed params`

```rust
fn foo$0(x: Vec<i32>) {}
```

**Before this PR**

```rust
type FooFn = fn(Vec);

fn foo(x: Vec<i32>) {}
```

**After this PR**

```rust
type FooFn = fn(Vec<i32>);

fn foo(x: Vec<i32>) {}
```
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 16, 2025
@A4-Tacks
Copy link
Member Author

A4-Tacks commented Dec 8, 2025

r? @ShoyuVanilla

@ShoyuVanilla
Copy link
Member

Assist: Generate a type alias for function with unnamed params

fn foo$0(x: Vec<i32>) {}

Could you add a test for this as well?

@A4-Tacks
Copy link
Member Author

A4-Tacks commented Dec 9, 2025

This was tested in make

unnamed_param(ty("Vec<T>")),

@ShoyuVanilla
Copy link
Member

Yeah, but I think having it within the assist's test suite as well would be nice

Copy link
Member

@ShoyuVanilla ShoyuVanilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Dec 9, 2025
Merged via the queue into rust-lang:master with commit e8ac252 Dec 9, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 9, 2025
@A4-Tacks A4-Tacks deleted the fix-make-unnamed-param branch December 10, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants