Skip to content

ICE: NormalizationError during linting #115143

Closed
@saethlin

Description

@saethlin

Code

https://github.com/memflow/memflow/ at ec4d19b5600597d0f9e463c3ad085af288f77f5c

Error output

called `Result::unwrap()` on an `Err` value: NormalizationFailure(std::option::Option<&<T as plugins::Loadable>::ArgsType>, Type(std::option::Option<&<T as plugins::Loadable>::ArgsType>))
Backtrace

thread 'rustc' panicked at compiler/rustc_lint/src/types.rs:920:82:
called `Result::unwrap()` on an `Err` value: NormalizationFailure(std::option::Option<&<T as plugins::Loadable>::ArgsType>, Type(std::option::Option<&<T as plugins::Loadable>::ArgsType>))
stack backtrace:
   0: rust_begin_unwind
             at /rustc/c469197b19d53a6c45378568f73c00986b20a5a5/library/std/src/panicking.rs:617:5
   1: core::panicking::panic_fmt
             at /rustc/c469197b19d53a6c45378568f73c00986b20a5a5/library/core/src/panicking.rs:67:14
   2: core::result::unwrap_failed
             at /rustc/c469197b19d53a6c45378568f73c00986b20a5a5/library/core/src/result.rs:1652:5
   3: rustc_lint::types::repr_nullable_ptr
   4: <rustc_lint::types::ImproperCTypesVisitor>::check_type_for_ffi
   5: <rustc_lint::types::ImproperCTypesVisitor>::check_type_for_ffi
   6: <rustc_lint::types::ImproperCTypesVisitor>::check_type_for_ffi_and_report_errors
   7: <rustc_lint::types::ImproperCTypesDefinitions>::check_ty_maybe_containing_foreign_fnptr
   8: <rustc_lint::BuiltinCombinedModuleLateLintPass as rustc_lint::passes::LateLintPass>::check_item
   9: rustc_hir::intravisit::walk_mod::<rustc_lint::late::LateContextAndPass<rustc_lint::BuiltinCombinedModuleLateLintPass>>
  10: rustc_lint::late::late_lint_mod::<rustc_lint::BuiltinCombinedModuleLateLintPass>
  11: rustc_lint::lint_mod
      [... omitted 2 frames ...]
  12: rustc_data_structures::sync::par_for_each_in::<&[rustc_hir::hir_id::OwnerId], <rustc_middle::hir::map::Map>::par_for_each_module<rustc_lint::late::check_crate::{closure#1}::{closure#0}::{closure#0}>::{closure#0}>
  13: <rustc_session::session::Session>::time::<(), rustc_lint::late::check_crate::{closure#1}::{closure#0}>
  14: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#5}::{closure#1}::{closure#2}> as core::ops::function::FnOnce<()>>::call_once
  15: <core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::passes::analysis::{closure#5}::{closure#1}> as core::ops::function::FnOnce<()>>::call_once
  16: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#5}>
  17: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  18: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#6}>
  19: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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: please attach the file at `/root/build/rustc-ice-2023-08-23T12:46:10.422852522Z-1639.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C opt-level=0 -Z validate-mir -Z randomize-layout -C debuginfo=0

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

query stack during panic:
#0 [lint_mod] linting module `plugins`
#1 [analysis] running analysis passes on this crate
end of query stack

searched nightlies: from nightly-2023-01-01 to nightly-2023-08-14
regressed nightly: nightly-2023-07-04
searched commit range: 839e9a6...0ab38e9
regressed commit: 0ab38e9

bisected with cargo-bisect-rustc v0.6.6

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start 2023-01-01 --end 2023-08-14 -- check 

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions