diff options
| author | Sebastian Ziebell <sebastian.ziebell@ferrous-systems.com> | 2023-04-26 16:13:58 +0200 |
|---|---|---|
| committer | Sebastian Ziebell <sebastian.ziebell@ferrous-systems.com> | 2023-05-26 13:13:11 +0200 |
| commit | 59f8827a6fbd635d5314bec0f88284e8f3c603fd (patch) | |
| tree | 389afa9a304abe44f713a28efa8ed9cab3df8fc2 /tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff | |
| parent | 21e5dc2af986d2eccb9d7caa74455a48b26c7ae6 (diff) | |
| download | rust-59f8827a6fbd635d5314bec0f88284e8f3c603fd.tar.gz rust-59f8827a6fbd635d5314bec0f88284e8f3c603fd.zip | |
Implement assist to replace named generic with impl
This adds a new assist named "replace named generic with impl" to move
the generic param type from the generic param list into the function
signature.
```rust
fn new<T: ToString>(input: T) -> Self {}
```
becomes
```rust
fn new(input: impl ToString) -> Self {}
```
The first step is to determine if the assist can be applied, there has
to be a match between generic trait param & function paramter types.
* replace function parameter type(s) with impl
* add new `impl_trait_type` function to generate the new trait bounds with `impl` keyword for use in the
function signature
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions
