Skip to content

union fields that need dropping should be impossible #99621

Closed as not planned
Closed as not planned
@TheTechRobo

Description

@TheTechRobo

Code

Just add mlua = {version="^0.8.1", features=["lua54"]} to the Cargo.toml.

Post-error tarball:

https://thetechrobo.ca/cargo.test.tgz

Meta

I can't reproduce this on another, freshly-installed rustup/cargo on a Linux machine. But that could be down to configuration.

rustc --version --verbose:

rustc 1.64.0-nightly (f8588549c 2022-07-18)
binary: rustc
commit-hash: f8588549c3c3d45c32b404210cada01e2a45def3
commit-date: 2022-07-18
host: x86_64-unknown-linux-gnu
release: 1.64.0-nightly
LLVM version: 14.0.6

This only became a problem after updating using rustup update - in fact, I had just updated when the issue started! Fortunately, I do have a Timings thing for a crate I ran into the issue with, so you can see some basic info about the previous version of Rust.

https://thetechrobo.ca/timings.html

Error output

I have removed /home/thetechrobo/.cargo/registry/cache/github.com-1ecc6299db9ec823/ and /home/thetechrobo/.cargo/registry/src/github.com-1ecc6299db9ec823/; same issue.

Backtrace

~/rad git:master ❯❯❯ RUST_BACKTRACE=1 cargo build --verbose        101 modified
       Fresh autocfg v1.1.0
       Fresh cc v1.0.73
       Fresh pkg-config v0.3.25
       Fresh rustc-hash v1.1.0
       Fresh once_cell v1.13.0
       Fresh memchr v2.5.0
       Fresh bstr v0.2.17
       Fresh num-traits v0.2.15
   Compiling mlua v0.8.1
     Running `rustc --crate-name mlua --edition=2021 /home/thetechrobo/.cargo/registry/src/github.com-1ecc6299db9ec823/mlua-0.8.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="lua54"' -C metadata=d3370bec60c881da -C extra-filename=-d3370bec60c881da --out-dir /home/thetechrobo/rad/target/debug/deps -L dependency=/home/thetechrobo/rad/target/debug/deps --extern bstr=/home/thetechrobo/rad/target/debug/deps/libbstr-207df12ed3e46d9a.rmeta --extern num_traits=/home/thetechrobo/rad/target/debug/deps/libnum_traits-07b3e0818f14fa6e.rmeta --extern once_cell=/home/thetechrobo/rad/target/debug/deps/libonce_cell-3548c506bfdf571b.rmeta --extern rustc_hash=/home/thetechrobo/rad/target/debug/deps/librustc_hash-91c665a5e97266ba.rmeta --cap-lints allow -L native=/usr/lib/x86_64-linux-gnu -l lua5.4`
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: union fields that need dropping should be impossible
   --> /home/thetechrobo/.cargo/registry/src/github.com-1ecc6299db9ec823/mlua-0.8.1/src/util.rs:158:9
    |
158 |         (*params).result.init = ((*params).function)(state);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: delayed at compiler/rustc_mir_transform/src/check_unsafety.rs:227:39

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1425:13
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   3: core::ptr::drop_in_place::<rustc_session::parse::ParseSess>
   4: <alloc::rc::Rc<rustc_session::session::Session> as core::ops::drop::Drop>::drop
   5: core::ptr::drop_in_place::<rustc_interface::interface::Compiler>
   6: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
   7: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
   8: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.64.0-nightly (f8588549c 2022-07-18) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `mlua`

Caused by:
  process didn't exit successfully: `rustc --crate-name mlua --edition=2021 /home/thetechrobo/.cargo/registry/src/github.com-1ecc6299db9ec823/mlua-0.8.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="lua54"' -C metadata=d3370bec60c881da -C extra-filename=-d3370bec60c881da --out-dir /home/thetechrobo/rad/target/debug/deps -L dependency=/home/thetechrobo/rad/target/debug/deps --extern bstr=/home/thetechrobo/rad/target/debug/deps/libbstr-207df12ed3e46d9a.rmeta --extern num_traits=/home/thetechrobo/rad/target/debug/deps/libnum_traits-07b3e0818f14fa6e.rmeta --extern once_cell=/home/thetechrobo/rad/target/debug/deps/libonce_cell-3548c506bfdf571b.rmeta --extern rustc_hash=/home/thetechrobo/rad/target/debug/deps/librustc_hash-91c665a5e97266ba.rmeta --cap-lints allow -L native=/usr/lib/x86_64-linux-gnu -l lua5.4` (exit status: 101)

Sorry if this issue turns out being invalid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions