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

Unexpected internal compiler panic #7340

Closed
TheIronBorn opened this issue Jun 10, 2021 · 4 comments · Fixed by #7473
Closed

Unexpected internal compiler panic #7340

TheIronBorn opened this issue Jun 10, 2021 · 4 comments · Fixed by #7473
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@TheIronBorn
Copy link

error: internal compiler error: compiler\rustc_middle\src\ty\context.rs:545:13: node_type: no type for node

$ rustc --version --verbose
rustc 1.54.0-nightly (eab201df7 2021-06-09)
binary: rustc
commit-hash: eab201df7028ebb6812c0b1a01702ac6ecfcceed
commit-date: 2021-06-09
host: x86_64-pc-windows-msvc
release: 1.54.0-nightly
LLVM version: 12.0.1
click to expand full output of `RUST_BACKTRACE=full cargo clippy -vv`
error: internal compiler error: compiler\rustc_middle\src\ty\context.rs:545:13: node_type: no type for node `expr CHUNK_SIZE (hir_id=HirId { owner: DefId(0:96 ~ ascii[8996]::string_simd_raw_16x8#1), local_id: 89 })`

thread 'rustc' panicked at 'Box<dyn Any>', compiler\rustc_errors\src\lib.rs:1007:9
stack backtrace:
   0:     0x7ff9fb9b645f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfd05d2416b5830a5
   1:     0x7ff9fb9df6aa - core::fmt::write::h3d73561f801c6731
   2:     0x7ff9fb9a9b68 - <std::io::IoSlice as core::fmt::Debug>::fmt::h40069e954203aa09
   3:     0x7ff9fb9ba626 - std::panicking::take_hook::h3f6e1d7dfb3b3e8b
   4:     0x7ff9fb9ba109 - std::panicking::take_hook::h3f6e1d7dfb3b3e8b
   5:     0x7ff7d023c52e - <unknown>
   6:     0x7ff9fb9bae79 - std::panicking::rust_panic_with_hook::h9e98bcc3e89f7917
   7:     0x7ffa0009e960 - <rustc_errors::snippet::Style as core::fmt::Debug>::fmt::h45d3dbc29243e740
   8:     0x7ffa0009e909 - <rustc_errors::snippet::Style as core::fmt::Debug>::fmt::h45d3dbc29243e740
   9:     0x7ffa00340fc1 - rustc_query_system::query::job::report_cycle::ha4dfd98a2fbf7f2a
  10:     0x7ffa0008df70 - <rustc_feature::builtin_attrs::AttributeType as core::fmt::Debug>::fmt::h9808017d310f6183
  11:     0x7ffa00094ce5 - rustc_errors::HandlerInner::emit_diagnostic::h5494b036b3106bc0
  12:     0x7ffa00092842 - rustc_errors::Handler::bug::hdc7b848fdc70c024
  13:     0x7ff9fff90867 - rustc_middle::ty::sty::<impl rustc_middle::ty::list::List<rustc_middle::ty::sty::Binder<rustc_middle::ty::sty::ExistentialPredicate>>>::principal_def_id::h04f7a894b080727a
  14:     0x7ff9fff8ae70 - rustc_middle::ty::subst::<impl rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg>>::truncate_to::h5755a73941fd41e8
  15:     0x7ff9fff8ae18 - rustc_middle::ty::subst::<impl rustc_middle::ty::list::List<rustc_middle::ty::subst::GenericArg>>::truncate_to::h5755a73941fd41e8
  16:     0x7ff9fff90799 - rustc_middle::ty::sty::<impl rustc_middle::ty::list::List<rustc_middle::ty::sty::Binder<rustc_middle::ty::sty::ExistentialPredicate>>>::principal_def_id::h04f7a894b080727a
  17:     0x7ffa0033d687 - rustc_middle::util::bug::bug_fmt::h1d8e9d79791bd398
  18:     0x7ff9ffde5eda - rustc_middle::ty::context::TypeckResults::node_type::hb87ced7e1b878fa1
  19:     0x7ff9ffde6609 - rustc_middle::ty::context::TypeckResults::expr_ty::h91dd64751f5e3975
  20:     0x7ff7d05835fb - <unknown>
  21:     0x7ff7d0559bc0 - <unknown>
  22:     0x7ff7d0300d38 - <unknown>
  23:     0x7ff9ffad93a3 - <rustc_lint::late::LateLintPassObjects as rustc_lint::passes::LateLintPass>::check_expr::hb9ee81ab9b23f732
  24:     0x7ff9fc066e2f - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  25:     0x7ff9fc066e3a - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  26:     0x7ff9fc065f86 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  27:     0x7ff9fc06f30b - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  28:     0x7ff9fc0614fa - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  29:     0x7ff9fc0699f4 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  30:     0x7ff9fc060e2d - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  31:     0x7ff9fc066d23 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  32:     0x7ff9fc06997c - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  33:     0x7ff9fc060e2d - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  34:     0x7ff9fc066d23 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  35:     0x7ff9fc065543 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  36:     0x7ff9fc06698d - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  37:     0x7ff9fc066cb8 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  38:     0x7ff9fc06997c - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  39:     0x7ff9fc060e2d - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  40:     0x7ff9fc066d23 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  41:     0x7ff9fc065f86 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  42:     0x7ff9fc06f30b - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  43:     0x7ff9fc066ac1 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  44:     0x7ff9fc06652f - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  45:     0x7ff9fc06997c - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  46:     0x7ff9fc060e2d - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  47:     0x7ff9fc066d23 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  48:     0x7ff9fc065f86 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  49:     0x7ff9fc06f30b - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  50:     0x7ff9fc06f49d - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  51:     0x7ff9fc069216 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  52:     0x7ff9fc06fb02 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  53:     0x7ff9fc06122b - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  54:     0x7ff9fc06ac89 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  55:     0x7ff9fc069ddb - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  56:     0x7ff9fbfc1934 - rustc_interface::proc_macro_decls::provide::h55100eea0f287a59
  57:     0x7ff9fbfeb81b - rustc_interface::passes::BoxedResolver::complete::hb122e88ee9773abc
  58:     0x7ff9fbfd21ed - rustc_interface::passes::analysis::h46636798343a3dce
  59:     0x7ff9fed0660f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_print_query_stack::h9cfe711a613cb365
  60:     0x7ff9fecf153e - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_print_query_stack::h9cfe711a613cb365
  61:     0x7ff9fec4f6b0 - rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::resolve_instance_of_const_arg>::hash_result::h3344e64ec1fb2355
  62:     0x7ff9feaadaf5 - <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_foreign_item::hcfa8febbcadf97c9
  63:     0x7ff9fe9a12b9 - <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::visit_foreign_item::hcfa8febbcadf97c9
  64:     0x7ff9fec95bfd - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_print_query_stack::h9cfe711a613cb365
  65:     0x7ff9fbefa302 - <rustc_driver::args::Error as core::fmt::Debug>::fmt::h0c0cd877d523524b
  66:     0x7ff9fbeb9fc1 - <rustc_middle::ty::SymbolName as core::fmt::Debug>::fmt::h29920374b3a471fa
  67:     0x7ff9fbeb201d - rustc_driver::pretty::print_after_hir_lowering::h1ea39aad06d908d1
  68:     0x7ff9fbeb60a3 - <rustc_middle::ty::SymbolName as core::fmt::Debug>::fmt::h29920374b3a471fa
  69:     0x7ff9fbefabcf - <rustc_driver::args::Error as core::fmt::Debug>::fmt::h0c0cd877d523524b
  70:     0x7ff9fbe9293d - <rustc_lint::BuiltinCombinedLateLintPass as rustc_lint::passes::LateLintPass>::check_path::h60beb37a80972de3
  71:     0x7ff9fb9c8c3c - std::sys::windows::thread::Thread::new::h9c68c6b4f44f86b6
  72:     0x7ffa4d1a7034 - BaseThreadInitThunk
  73:     0x7ffa4d2e2651 - RtlUserThreadStart

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.1.54 (eab201df 2021-06-09)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
@giraffate
Copy link
Contributor

Thanks for the report!

Can you provide the minimal reproduction?

@giraffate giraffate added the I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 11, 2021
@TheIronBorn
Copy link
Author

this is pretty minimal

pub fn function() {
    const CONSTANT: usize = 8;
    [1; 1 % CONSTANT];
}
Click for full output
error: internal compiler error: compiler\rustc_middle\src\ty\context.rs:545:13: node_type: no type f
or node `expr CONSTANT (hir_id=HirId { owner: DefId(0:3 ~ testtest[19dc]::function), local_id: 6 })`

thread 'rustc' panicked at 'Box<dyn Any>', compiler\rustc_errors\src\lib.rs:1007:9
stack backtrace:
   0:     0x7ffa0532645f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Displ
ay>::fmt::hfd05d2416b5830a5
   1:     0x7ffa0534f6aa - core::fmt::write::h3d73561f801c6731
   2:     0x7ffa05319b68 - <std::io::IoSlice as core::fmt::Debug>::fmt::h40069e954203aa09
   3:     0x7ffa0532a626 - std::panicking::take_hook::h3f6e1d7dfb3b3e8b
   4:     0x7ffa0532a109 - std::panicking::take_hook::h3f6e1d7dfb3b3e8b
   5:     0x7ff62601c52e - <unknown>
   6:     0x7ffa0532ae79 - std::panicking::rust_panic_with_hook::h9e98bcc3e89f7917
   7:     0x7ff9efeee960 - <rustc_errors::snippet::Style as core::fmt::Debug>::fmt::h45d3dbc29243e74
0
   8:     0x7ff9efeee909 - <rustc_errors::snippet::Style as core::fmt::Debug>::fmt::h45d3dbc29243e74
0
   9:     0x7ff9f0190fc1 - rustc_query_system::query::job::report_cycle::ha4dfd98a2fbf7f2a
  10:     0x7ff9efeddf70 - <rustc_feature::builtin_attrs::AttributeType as core::fmt::Debug>::fmt::h
9808017d310f6183
  11:     0x7ff9efee4ce5 - rustc_errors::HandlerInner::emit_diagnostic::h5494b036b3106bc0
  12:     0x7ff9efee2842 - rustc_errors::Handler::bug::hdc7b848fdc70c024
  13:     0x7ff9efde0867 - rustc_middle::ty::sty::<impl rustc_middle::ty::list::List<rustc_middle::t
y::sty::Binder<rustc_middle::ty::sty::ExistentialPredicate>>>::principal_def_id::h04f7a894b080727a
  14:     0x7ff9efddae70 - rustc_middle::ty::subst::<impl rustc_middle::ty::list::List<rustc_middle:
:ty::subst::GenericArg>>::truncate_to::h5755a73941fd41e8
  15:     0x7ff9efddae18 - rustc_middle::ty::subst::<impl rustc_middle::ty::list::List<rustc_middle:
:ty::subst::GenericArg>>::truncate_to::h5755a73941fd41e8
  16:     0x7ff9efde0799 - rustc_middle::ty::sty::<impl rustc_middle::ty::list::List<rustc_middle::t
y::sty::Binder<rustc_middle::ty::sty::ExistentialPredicate>>>::principal_def_id::h04f7a894b080727a
  17:     0x7ff9f018d687 - rustc_middle::util::bug::bug_fmt::h1d8e9d79791bd398
  18:     0x7ff9efc35eda - rustc_middle::ty::context::TypeckResults::node_type::hb87ced7e1b878fa1
  19:     0x7ff9efc36609 - rustc_middle::ty::context::TypeckResults::expr_ty::h91dd64751f5e3975
  20:     0x7ff6263635fb - <unknown>
  21:     0x7ff626339bc0 - <unknown>
  22:     0x7ff6260e0d38 - <unknown>
  23:     0x7ff9ef9293a3 - <rustc_lint::late::LateLintPassObjects as rustc_lint::passes::LateLintPas
s>::check_expr::hb9ee81ab9b23f732
  24:     0x7ff9ebeb5f7b - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  25:     0x7ff9ebebf30b - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  26:     0x7ff9ebeb997c - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  27:     0x7ff9ebeb0e2d - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  28:     0x7ff9ebeb6d23 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  29:     0x7ff9ebeb5f86 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  30:     0x7ff9ebebf30b - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  31:     0x7ff9ebebf49d - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  32:     0x7ff9ebeb9216 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  33:     0x7ff9ebebfb02 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  34:     0x7ff9ebeb122b - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  35:     0x7ff9ebebac89 - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  36:     0x7ff9ebeb9ddb - rustc_interface::util::commit_date_str::hcb8c0e9e4e4eba10
  37:     0x7ff9ebe11934 - rustc_interface::proc_macro_decls::provide::h55100eea0f287a59
  38:     0x7ff9ebe3b81b - rustc_interface::passes::BoxedResolver::complete::hb122e88ee9773abc
  39:     0x7ff9ebe221ed - rustc_interface::passes::analysis::h46636798343a3dce
  40:     0x7ff9eeb5660f - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_
print_query_stack::h9cfe711a613cb365
  41:     0x7ff9eeb4153e - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_
print_query_stack::h9cfe711a613cb365
  42:     0x7ff9eea9f6b0 - rustc_query_impl::<impl rustc_query_system::query::config::QueryAccessors
<rustc_query_impl::plumbing::QueryCtxt> for rustc_query_impl::queries::resolve_instance_of_const_arg
>::hash_result::h3344e64ec1fb2355
  43:     0x7ff9ee8fdaf5 - <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::vis
it_foreign_item::hcfa8febbcadf97c9
  44:     0x7ff9ee7f12b9 - <rustc_ast_lowering::item::ItemLowerer as rustc_ast::visit::Visitor>::vis
it_foreign_item::hcfa8febbcadf97c9
  45:     0x7ff9eeae5bfd - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_
print_query_stack::h9cfe711a613cb365
  46:     0x7ff9ebd4a302 - <rustc_driver::args::Error as core::fmt::Debug>::fmt::h0c0cd877d523524b
  47:     0x7ff9ebd09fc1 - <rustc_middle::ty::SymbolName as core::fmt::Debug>::fmt::h29920374b3a471f
a
  48:     0x7ff9ebd0201d - rustc_driver::pretty::print_after_hir_lowering::h1ea39aad06d908d1
  49:     0x7ff9ebd060a3 - <rustc_middle::ty::SymbolName as core::fmt::Debug>::fmt::h29920374b3a471f
a
  50:     0x7ff9ebd4abcf - <rustc_driver::args::Error as core::fmt::Debug>::fmt::h0c0cd877d523524b
  51:     0x7ff9ebce293d - <rustc_lint::BuiltinCombinedLateLintPass as rustc_lint::passes::LateLintP
ass>::check_path::h60beb37a80972de3
  52:     0x7ffa05338c3c - std::sys::windows::thread::Thread::new::h9c68c6b4f44f86b6
  53:     0x7ffa4d1a7034 - BaseThreadInitThunk
  54:     0x7ffa4d2e2651 - RtlUserThreadStart

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new

note: Clippy version: clippy 0.1.54 (eab201df 2021-06-09)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error; 1 warning emitted

@llogiq
Copy link
Contributor

llogiq commented Jun 19, 2021

So this is during calling expr_ty, three frames from the lint impl. That might reduce the search space somewhat, but the search would be greatly helped by using a clippy with debuginfo.

@TheIronBorn
Copy link
Author

I can confirm this works on my end now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants