Skip to content

Panic in generate_delegate_trait when trying to get source scope #15388

@DropDemBits

Description

@DropDemBits

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


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions