Skip to content
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

ICE With Minimal safer_ffi Example: Expected module, found DefId(18:190) #78257

Closed
zicklag opened this issue Oct 23, 2020 · 2 comments
Closed
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

@zicklag
Copy link

zicklag commented Oct 23, 2020

Code

cargo.toml:

[package]
name = "ice1"
version = "0.1.0"
edition = "2018"

[dependencies]
safer-ffi = { version = "0.0.5", features = ["proc_macros"] }

lib.rs:

use safer_ffi::prelude::*;

#[ffi_export]
fn init_plugin() {
    println!("Hello world");
}

Meta

rustc --version --verbose:

binary: rustc
commit-hash: 1eaadebb3dee31669c7649b32747381d11614fae
commit-date: 2020-10-21
host: x86_64-unknown-linux-gnu
release: 1.49.0-nightly
LLVM version: 11.0

Error is not present on Rust stable. I also noticed it on an earlier nightly which I do not have a version number for because I just ran rustup update to make sure the issue wasn't fixed on the latest nightly. Whoops. 😜

Error output

   Compiling ice1 v0.1.0 (/home/zicklag/rust/ice1)
thread 'rustc' panicked at 'Expected module, found DefId(18:190)', compiler/rustc_metadata/src/rmeta/decoder.rs:1194: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.49.0-nightly (1eaadebb3 2020-10-21) running on x86_64-unknown-linux-gnu

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

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

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

To learn more, run the command again with --verbose.
Backtrace

stack backtrace:
   0: rust_begin_unwind
             at /rustc/1eaadebb3dee31669c7649b32747381d11614fae/library/std/src/panicking.rs:483:5
   1: std::panicking::begin_panic_fmt
             at /rustc/1eaadebb3dee31669c7649b32747381d11614fae/library/std/src/panicking.rs:437:5
   2: rustc_metadata::rmeta::decoder::cstore_impl::<impl rustc_metadata::creader::CStore>::module_expansion_untracked
   3: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver>::get_module
   4: rustc_resolve::build_reduced_graph::<impl rustc_resolve::Resolver>::get_module
   5: rustc_resolve::macros::<impl rustc_expand::base::ResolverExpand for rustc_resolve::Resolver>::resolve_macro_invocation
   6: rustc_expand::expand::MacroExpander::fully_expand_fragment
   7: rustc_expand::expand::MacroExpander::expand_crate
   8: rustc_session::utils::<impl rustc_session::session::Session>::time
   9: rustc_interface::passes::configure_and_expand_inner
  10: rustc_interface::passes::configure_and_expand::{{closure}}
  11: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  12: rustc_interface::queries::Queries::expansion
  13: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  14: rustc_span::with_source_map
  15: rustc_interface::interface::create_compiler_and_run
  16: scoped_tls::ScopedKey<T>::set

@zicklag zicklag 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 Oct 23, 2020
@matthiaskrgr
Copy link
Member

duplicate of #75982 I guess?

@zicklag
Copy link
Author

zicklag commented Oct 23, 2020

Looks like it. I'll close this one then. 👍

@zicklag zicklag closed this as completed Oct 23, 2020
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

2 participants