The behavior of the Self type in the Extract struct from enum variant option is not as expected
Source code
enum Foo {
Bar { node: Box<Self> },
Nil,
}
fn main() {}
in line2 column5 use Extract struct from enum variant
struct Bar{ node: Box<Self> }
enum Foo {
Bar(Bar),
Nil,
}
fn main() {}
Expected
struct Bar { node: Box<Foo> }
enum Foo {
Bar(Bar),
Nil,
}
fn main() {}
rust-analyzer version: rust-analyzer 1.74.0 (79e9716c 2023-11-13) or rust-analyzer 1.77.0-nightly (bf8716f1 2023-12-24)
rustc version: rustc 1.74.0 (79e9716c9 2023-11-13) or rustc 1.77.0-nightly (bf8716f1c 2023-12-24)
relevant settings: NONE
The behavior of the
Selftype in theExtract struct from enum variantoption is not as expectedSource code
in line2 column5 use
Extract struct from enum variantExpected
rust-analyzer version:
rust-analyzer 1.74.0 (79e9716c 2023-11-13)orrust-analyzer 1.77.0-nightly (bf8716f1 2023-12-24)rustc version:
rustc 1.74.0 (79e9716c9 2023-11-13)orrustc 1.77.0-nightly (bf8716f1c 2023-12-24)relevant settings: NONE