rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Structural Search and Replace (SSR): replacement referred unknown placeholder

Open Logarithmus opened this issue 2 years ago • 0 comments

rust-analyzer version: 2022-07-25 rustc version: 1.62.1

Code:

use std::ops::Add;
use typenum::{Sum, consts::*};

// <$l as Add<$r>>::Output ==>> typenum::Sum<$l, $r>

pub type Num = <P1 as Add<P2>>::Output;

fn main() {
    println!("Hello, world!");
}

Steps to reproduce:

  1. cargo new sample_text && cd sample_text && cargo add typenum
  2. Open text editor with LSP
  3. Paste this code snippet to src/main.rs
  4. Run code action for commented line with an SSR request

Expected behavior:

Replace

pub type Num = <P1 as Add<P2>>::Output;

with

pub type Num = Sum<P1, P2>;

Observed behavior:

Internal error: replacement referred unknown placeholder $l

Logarithmus avatar Jul 30 '22 18:07 Logarithmus