You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code will cause rust-analyzer to panic.
How to reproduce
Create a new crate with cargo init --lib.
Paste the following code into lib.rs.
Click on the beginning of the file and move the cursor there.
traitA<T>{fna(&self);}structB;implB{pubfnb<T>(s:&dynA<T>) -> Self{B}}structC;implC{fnc<T>(a:&dynA<T>) -> Self{letmut c = C;let b = B::b(a);
c.d(|| a.a());
c
}fnd(&mutself,f:implFnOnce()){}}
…r, r=HKalbasi
fix: consider outer binders when folding captured items' type
Fixesrust-lang#14966
Basically, the crash is caused by us producing a broken type and passing it to chalk: `&dyn for<type> [for<> Implemented(^1.0: A<^0.0>)]` (notice the innermost bound var `^0.0` has no corresponding binder). It's created in `CapturedItemWithoutTy::with_ty()`, which didn't consider outer binders when folding types to replace placeholders with bound variables.
The fix is one-liner, but I've also refactored the surrounding code a little.
The following code will cause rust-analyzer to panic.
How to reproduce
cargo init --lib
.lib.rs
.rust-analyzer version: rust-analyzer version: 0.3.1533-standalone (505fd09 2023-05-28)
rustc version: rustc 1.70.0 (90c541806 2023-05-31)
relevant settings: Use default settings
Output:
Output :
The text was updated successfully, but these errors were encountered: