rust-analyzer
rust-analyzer copied to clipboard
Structural Search and Replace (SSR): replacement referred unknown placeholder
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:
-
cargo new sample_text && cd sample_text && cargo add typenum
- Open text editor with LSP
- Paste this code snippet to
src/main.rs
- 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