-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Trying to get assists on the tuple field type of
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(transparent)]
pub struct Error(pub winresult::NtStatus);
panics with "thread 'Worker' panicked at 'called Option::unwrap()
on a None
value', crates\ide-assists\src\handlers\generate_delegate_trait.rs:345:58"
Which points to here:
let source = ctx.sema.scope(source.syntax()).unwrap(); |
Fix would be to
- make
generate_impl
returnOption<ast::Impl>
instead ofast::Impl
- change all of the unwraps in
generate_impl
with?
- change this to a
let Some(delegate) = ... else { continue };
let delegate = generate_impl(ctx, self, &field.ty, &field.name, delegee);
rust-analyzer version: rust-analyzer 0.3.1607-standalone (429a381 2023-07-30)
rustc version: rustc 1.73.0-nightly (500647f 2023-07-27)
relevant settings: (eg. client settings, or environment variables like CARGO
, RUSTC
, RUSTUP_HOME
or CARGO_HOME
)
Dependencies:
bytemuck 1.13.1
winresult-types 0.1.3
winresult 0.1.3