Skip to content

compiler bug: Unexpected panic #75924

Closed
@Volker-Weissmann

Description

@Volker-Weissmann

Code

#![allow(non_camel_case_types)]
#![allow(dead_code)]
mod mymod {
	extern "C" {
		pub fn GiNaC_basic_print_dispatch(
			ri: GiNaC_registered_class_info,
		);
	}
	pub type GiNaC_registered_class_info = GiNaC_class_info<GiNaC_registered_class_options>;
	pub struct GiNaC_class_info<OPT> {
		pub next: *mut GiNaC_class_info<OPT>,
	}
	pub struct GiNaC_registered_class_options {}
}

mod othermod {
	extern "C" {
		pub fn GiNaC_basic_print_dispatch(
			ri: GiNaC_registered_class_info,
		);
	}
	pub type GiNaC_registered_class_info = GiNaC_class_info<GiNaC_registered_class_options>;
	pub struct GiNaC_class_info<OPT> {
		pub options: OPT,
		pub next: *mut GiNaC_class_info<OPT>,
	}
	pub struct GiNaC_registered_class_options {}
}

Meta

rustc --version --verbose:

rustc 1.47.0-nightly (5180f3da5 2020-08-23)
binary: rustc
commit-hash: 5180f3da5fd72627a8d38558ad1297df38793acd
commit-date: 2020-08-23
host: x86_64-unknown-linux-gnu
release: 1.47.0-nightly
LLVM version: 11.0

Error output

   Compiling compilerbug v0.1.0 (/home/volker/Documents/compilerbug)
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Unknown(OPT)', src/librustc_lint/builtin.rs:2182:53
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.47.0-nightly (5180f3da5 2020-08-23) 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

error: could not compile `compilerbug`.

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

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Unknown(OPT)', src/librustc_lint/builtin.rs:2182:53
stack backtrace:
   0: rust_begin_unwind
             at /rustc/5180f3da5fd72627a8d38558ad1297df38793acd/library/std/src/panicking.rs:475
   1: core::panicking::panic_fmt
             at /rustc/5180f3da5fd72627a8d38558ad1297df38793acd/library/core/src/panicking.rs:85
   2: core::option::expect_none_failed
             at /rustc/5180f3da5fd72627a8d38558ad1297df38793acd/library/core/src/option.rs:1221
   3: rustc_lint::builtin::ClashingExternDeclarations::structurally_same_type::structurally_same_type_impl::{{closure}}
   4: core::iter::traits::iterator::Iterator::eq_by
   5: rustc_data_structures::stack::ensure_sufficient_stack
   6: rustc_data_structures::stack::ensure_sufficient_stack
   7: <rustc_lint::builtin::ClashingExternDeclarations as rustc_lint::passes::LateLintPass>::check_foreign_item
   8: rustc_hir::intravisit::walk_item
   9: rustc_hir::intravisit::Visitor::visit_nested_item
  10: rustc_hir::intravisit::walk_item
  11: rustc_hir::intravisit::Visitor::visit_nested_item
  12: rustc_hir::intravisit::walk_crate
  13: rustc_session::utils::<impl rustc_session::session::Session>::time
  14: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  15: rustc_session::utils::<impl rustc_session::session::Session>::time
  16: rustc_interface::passes::analysis
  17: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  18: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  19: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  20: rustc_data_structures::stack::ensure_sufficient_stack
  21: rustc_query_system::query::plumbing::get_query_impl
  22: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  23: rustc_span::with_source_map
  24: rustc_interface::interface::create_compiler_and_run
  25: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions