ast icon indicating copy to clipboard operation
ast copied to clipboard

`pest_deconstruct` no longer works with modern Rust due to "uninitialized".

Open vi opened this issue 4 years ago • 0 comments

This crate uses std::mem:uninitialized which was limited and now panics more often. This seem to prevent usage of pest-deconstruct:

thread 'main' panicked at 'attempted to leave type `std::iter::Peekable<pest::iterators::Pairs<parse::parser::Rule>>` uninitialized, which is invalid', /mnt/fluff/vi/src/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/core/src/mem/mod.rs:663:9
stack backtrace:
   0: rust_begin_unwind
             at /mnt/fluff/vi/src/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /mnt/fluff/vi/src/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /mnt/fluff/vi/src/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/core/src/panicking.rs:50:5
   3: core::mem::uninitialized
             at /mnt/fluff/vi/src/rustc_codegen_cranelift/build_sysroot/sysroot_src/library/core/src/mem/mod.rs:663:9
   4: pest_deconstruct::PestDeconstructor<R>::discard
             at /home/vi/.cargo/registry/src/github.com-1ecc6299db9ec823/pest-deconstruct-0.2.0/src/lib.rs:167:34
...

vi avatar Aug 25 '21 15:08 vi