Skip to content

Compiler Panicked when compiling tutorial application of safer_ffi #79894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
okpatil4u opened this issue Dec 10, 2020 · 1 comment
Closed

Compiler Panicked when compiling tutorial application of safer_ffi #79894

okpatil4u opened this issue Dec 10, 2020 · 1 comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@okpatil4u
Copy link

While compiling safer_ffi tutorial example, I encountered following panic

Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.54
   Compiling proc-macro-hack v0.5.19
   Compiling libc v0.2.81
   Compiling mini_paste-proc_macro v0.1.11
   Compiling mini_paste v0.1.11
   Compiling quote v1.0.7
   Compiling safer_ffi-proc_macro v0.0.5
   Compiling require_unsafe_in_body v0.2.1
   Compiling safer-ffi v0.0.5
   Compiling crate_name v0.1.0 (/Users/omkarpatil/experiments/samples/ffi/safe_ffi)
thread 'rustc' panicked at 'Expected module, found DefId(16:190)', compiler/rustc_metadata/src/rmeta/decoder.rs:1198:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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.48.0 (7eac88abb 2020-11-16) running on x86_64-apple-darwin

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

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

error: could not compile `crate_name`
@okpatil4u okpatil4u added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 10, 2020
@danielhenrymantilla
Copy link
Contributor

danielhenrymantilla commented Dec 10, 2020

Duplicate of #75982 (and #75957, #75987). The issue has been fixed in latest nightly, and I think that in latest beta too, sadly it hasn't yet landed on stable, we will have to wait for the nest stable release in January.

So the current workaround is to pin the compiler version to before the regression (1.46.0) or to after the fix (beta i.e., ≥ 1.49.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants