Skip to content

convert_tuple_struct_to_named_struct panics on recursive enum destructured with nested tuple pattern #22094

@Albab-Hasan

Description

@Albab-Hasan
enum T {
    Value(&'static T),
    Nil,
}
fn test(t: T) {
    if let T::Value(T::Value(t)) = t {}
}

reproduce:
cursor on Value in Value(&'static T)
Convert to named struct

panic:

request handler panicked: not implemented: cannot resolve changes that depend on replacing many elements
panicked at crates/syntax/src/syntax_editor/edit_algo.rs:298:17:
not implemented: cannot resolve changes that depend on replacing many elements

cause:
In edit_algo.rs:298 inside the dependent-change resolver:

Change::ReplaceAll(_, _) | Change::ReplaceWithMany(_, _) => {
    unimplemented!("cannot resolve changes that depend on replacing many elements")
}
  • rustc: 1.94.0
  • rust-analyzer: 0.3.2862
  • OS: Ubuntu
  • Editor: VS Code

Metadata

Metadata

Assignees

Labels

C-bugCategory: bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions