Open cedtwo opened 1 month ago
The following code will cause rust analyzer to become unresponsive, exhausting all (?) available CPU and memory resources:
use std::marker::PhantomData; struct TypeWrapper<'a> { inner: InnerType, _ref: PhantomData<&'a mut BorrowWrapper<'a>>, } struct BorrowWrapper<'a> { inner: &'a mut InnerType, } struct InnerType; pub trait GetBorrow { type TypeA; type TypeB; fn get_type_a(&mut self) -> Self::TypeA; fn get_type_b(&mut self) -> Self::TypeB; } impl<'a> GetBorrow for TypeWrapper<'a> where Self::TypeA: 'a, Self::TypeB: 'a, { type TypeA = BorrowWrapper<'a>; type TypeB = BorrowWrapper<'a>; fn get_type_a(&mut self) -> Self::TypeA { BorrowWrapper { inner: &mut self.inner, } } fn get_type_b(&mut self) -> Self::TypeB { BorrowWrapper { inner: &mut self.inner, } } }
Updating, and switching between nightly and stable do not solve the issue.
nightly
stable
rustc --version --verbose gives the following:
rustc --version --verbose
rustc 1.79.0 (129f3b996 2024-06-10) binary: rustc commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081 commit-date: 2024-06-10 host: x86_64-unknown-linux-gnu release: 1.79.0 LLVM version: 18.1.7
rust-analyzer --version gives the following:
rust-analyzer --version
rust-analyzer 1 (c4618fe14 2024-05-05)
Hmm, this does not happen for me on the latest release
The following code will cause rust analyzer to become unresponsive, exhausting all (?) available CPU and memory resources:
Updating, and switching between
nightly
andstable
do not solve the issue.rustc --version --verbose
gives the following:rust-analyzer --version
gives the following: