rust-lang / rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
https://rust-lang.github.io/rust-clippy/
Other
11.29k stars 1.52k forks source link

panicked at 'Box<Any>' #6350

Closed elpiel closed 3 years ago

elpiel commented 3 years ago

I will try to provide minimal verifiable example some time later and this error occurred on this function:

https://github.com/AdExNetwork/adex-validator-stack-rust/blob/dev/sentry/src/chain.rs#L11

Code

TODO

Meta

Error output

Checking sentry v0.1.0 (/home/elpiel/PROJECTS/AdEx/rust-adex-validator-stack/sentry)
error: internal compiler error: compiler/rustc_middle/src/ty/sty.rs:78:18: bound region is not anonymous

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:945:9
stack backtrace:
...... (see bellow)

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.0.212 (7eac88a 2020-11-16)

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `dyn std::ops::FnMut(hyper::Request<hyper::Body>, &'a Application<A>) -> std::pin::Pin<std::boxed::Box<(dyn futures::Future<Output = std::result::Result<hyper::Request<hyper::Body>, ResponseError>> + std::marker::Send + 'a)>> + std::marker::Send: std::marker::Sized`
#1 [is_sized_raw] computing whether `(dyn std::ops::FnMut(hyper::Request<hyper::Body>, &'a Application<A>) -> std::pin::Pin<std::boxed::Box<(dyn futures::Future<Output = std::result::Result<hyper::Request<hyper::Body>, ResponseError>> + std::marker::Send + 'a)>> + std::marker::Send + 'static)` is `Sized`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
Backtrace

``` 0: 0x7fc7e00d1660 - std::backtrace_rs::backtrace::libunwind::trace::h72c2fb8038f1bbee at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96 1: 0x7fc7e00d1660 - std::backtrace_rs::backtrace::trace_unsynchronized::h1e3b084883f1e78c at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/../../backtrace/src/backtrace/mod.rs:66 2: 0x7fc7e00d1660 - std::sys_common::backtrace::_print_fmt::h3bf6a7ebf7f0394a at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:79 3: 0x7fc7e00d1660 - ::fmt::h2e8cb764b7fe02e7 at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:58 4: 0x7fc7e013f7fc - core::fmt::write::h7a1184eaee6a8644 at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/fmt/mod.rs:1080 5: 0x7fc7e00c3192 - std::io::Write::write_fmt::haeeb374d93a67eac at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/io/mod.rs:1516 6: 0x7fc7e00d640d - std::sys_common::backtrace::_print::h1d14a7f6ad632dc8 at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:61 7: 0x7fc7e00d640d - std::sys_common::backtrace::print::h301abac8bb2e3e81 at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys_common/backtrace.rs:48 8: 0x7fc7e00d640d - std::panicking::default_hook::{{closure}}::hde0cb80358a6920a at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:208 9: 0x7fc7e00d60b8 - std::panicking::default_hook::h9b1a691049a0ec8f at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:227 10: 0x5611cb41c561 - clippy_driver::report_clippy_ice::h95a0ddc386d93ea9 11: 0x7fc7d4dd5ab6 - as core::ops::function::Fn>::call::h8843a7c9efe0ea9c at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1056 12: 0x7fc7d4ddadfb - proc_macro::bridge::client::::enter::{{closure}}::{{closure}}::hd5c4e483a70a7537 at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/proc_macro/src/bridge/client.rs:320 13: 0x7fc7e00d6c56 - std::panicking::rust_panic_with_hook::h2bdec87b60580584 at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:581 14: 0x7fc7e5da8f4d - std::panicking::begin_panic::{{closure}}::h57f15f2bab2a9784 15: 0x7fc7e5da8ef6 - std::sys_common::backtrace::__rust_end_short_backtrace::h7cd8cd13049964e5 16: 0x7fc7e5daedef - std::panicking::begin_panic::h33f73246fcd851e7 17: 0x7fc7e5de6c20 - rustc_errors::HandlerInner::bug::hdae66941b7efd681 18: 0x7fc7e5de5700 - rustc_errors::Handler::bug::hde31cb063eaef396 19: 0x7fc7e5725664 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h37a81a58ddb0ffc6 20: 0x7fc7e571e6cb - rustc_middle::ty::context::tls::with_opt::{{closure}}::h397a736841bcb283 21: 0x7fc7e571e672 - rustc_middle::ty::context::tls::with_opt::he30628c65a319c3d 22: 0x7fc7e5725589 - rustc_middle::util::bug::opt_span_bug_fmt::hc407c00c5fb7753e 23: 0x7fc7e57254fe - rustc_middle::util::bug::bug_fmt::h2f1f24a0de94477e 24: 0x7fc7e5722fcd - rustc_middle::ty::sty::BoundRegion::assert_bound_var::h058c6cd82e8c5344 25: 0x7fc7e35f90c7 - alloc::collections::btree::map::Entry::or_insert_with::h450713d2ac898364 26: 0x7fc7e352c6a8 - rustc_middle::ty::fold::::replace_escaping_bound_vars::{{closure}}::h634224bc1c7a325b 27: 0x7fc7e5a95105 - ::fold_region::ha701bbcd1b7baae6 28: 0x7fc7e583f7f1 - rustc_middle::ty::structural_impls::::super_fold_with::h8b30e9ab31a5d1c9 29: 0x7fc7e5a950c0 - ::fold_ty::h5938712a3926d630 30: 0x7fc7e56be0b1 - rustc_middle::ty::fold::TypeFoldable::fold_with::h95e44b69ecad5482 31: 0x7fc7e583f7d6 - rustc_middle::ty::structural_impls::::super_fold_with::h8b30e9ab31a5d1c9 32: 0x7fc7e5a950c0 - ::fold_ty::h5938712a3926d630 33: 0x7fc7e56be027 - rustc_middle::ty::fold::TypeFoldable::fold_with::h95e44b69ecad5482 34: 0x7fc7e5719149 - rustc_middle::ty::fold::TypeFoldable::fold_with::hb9043144f1330fef 35: 0x7fc7e59f1cd3 - rustc_middle::ty::structural_impls::fold_list::h9156bf13d8a99df9 36: 0x7fc7e583f876 - rustc_middle::ty::structural_impls::::super_fold_with::h8b30e9ab31a5d1c9 37: 0x7fc7e5a950c0 - ::fold_ty::h5938712a3926d630 38: 0x7fc7e357320d - rustc_middle::ty::fold::TypeFoldable::fold_with::h2a9c7ec3a286ddce 39: 0x7fc7e35c470a - rustc_middle::ty::fold::TypeFoldable::fold_with::hb9d93c431a7ec7b5 40: 0x7fc7e35c2f71 - rustc_middle::ty::fold::TypeFoldable::fold_with::h3135aea27392ba50 41: 0x7fc7e35adea6 - rustc_middle::ty::fold::::replace_escaping_bound_vars::h5cf075ddf1deeeeb 42: 0x7fc7e35d5aad - as rustc_infer::infer::canonical::substitute::CanonicalExt>::substitute::h93affbe28c0c9ef3 43: 0x7fc7e3503ff6 - rustc_infer::infer::InferCtxtBuilder::enter_with_canonical::hd23a0573e5f86874 44: 0x7fc7e3583d8b - rustc_traits::evaluate_obligation::evaluate_obligation::h37d3030edaefeb83 45: 0x7fc7e515400d - rustc_middle::ty::query:: for rustc_middle::ty::query::queries::evaluate_obligation>::compute::h5c2f5bf7ef42484f 46: 0x7fc7e5326b1f - rustc_middle::dep_graph::::with_deps::h45a5040942bd31da 47: 0x7fc7e518b99e - rustc_query_system::dep_graph::graph::DepGraph::with_task_impl::hb3a6f3b3831b0586 48: 0x7fc7e5335534 - rustc_data_structures::stack::ensure_sufficient_stack::ha48abf22717c1ecb 49: 0x7fc7e52c2da2 - rustc_query_system::query::plumbing::get_query_impl::hec5410c900012bf5 50: 0x7fc7e517618e - ::evaluate_obligation::h1bc69e1e9d429a19 51: 0x7fc7e517622d - ::evaluate_obligation_no_overflow::h41e65ac72fa684f4 52: 0x7fc7e51b558b - rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions::hb8f3ee865e26a7ad 53: 0x7fc7e3462cfa - rustc_infer::infer::InferCtxtBuilder::enter::hd84950fd3c8e55d7 54: 0x7fc7e3472f53 - rustc_ty::common_traits::is_sized_raw::h41c8cfacbf9e965f 55: 0x7fc7e5a86772 - rustc_middle::dep_graph::::with_deps::h55a87572ef414720 56: 0x7fc7e5631cb1 - rustc_query_system::dep_graph::graph::DepGraph::with_task_impl::hea56d66e775c0b78 57: 0x7fc7e573bc8c - rustc_data_structures::stack::ensure_sufficient_stack::h212c8b563ff0983a 58: 0x7fc7e5be5dcd - rustc_query_system::query::plumbing::get_query_impl::hd07ddb15e09fc401 59: 0x7fc7e582748f - rustc_middle::ty::util::::is_sized::h57881d263c4723dc 60: 0x5611cb4ba097 - clippy_lints::types::Types::check_ty::hefa0da5590de0119 61: 0x5611cb4b8381 - ::check_fn::heabc8d1aa89d9bd6 62: 0x7fc7e50b55b2 - ::check_fn::h0aeeb4ae56d9ea99 63: 0x7fc7e0ee64be - rustc_hir::intravisit::walk_item::h531b5bb267282b52 64: 0x7fc7e0f91a57 - rustc_hir::intravisit::Visitor::visit_nested_item::haa0c15703c3698cd 65: 0x7fc7e0ee663d - rustc_hir::intravisit::walk_item::h531b5bb267282b52 66: 0x7fc7e0f91a57 - rustc_hir::intravisit::Visitor::visit_nested_item::haa0c15703c3698cd 67: 0x7fc7e0ee074e - rustc_hir::intravisit::walk_crate::h67dfeba653290f64 68: 0x7fc7e0f65e8c - rustc_lint::late::late_lint_pass_crate::h04cb4df74ac84c70 69: 0x7fc7e0f6fa54 - rustc_session::utils::::time::hae7283bebe534055 70: 0x7fc7e0fa3925 - as core::ops::function::FnOnce<()>>::call_once::h5a3d382b6fa02267 71: 0x7fc7e0f6e1d8 - rustc_session::utils::::time::h68279150b9d7dfa2 72: 0x7fc7e0fc3b5e - rustc_interface::passes::analysis::hccd2e7d0281cdbea 73: 0x7fc7e0dbe862 - rustc_middle::ty::query:: for rustc_middle::ty::query::queries::analysis>::compute::h5c666acddcaeeeaf 74: 0x7fc7e0d009b8 - rustc_middle::dep_graph::::with_deps::h507d7bf5b643adee 75: 0x7fc7e0d82e84 - rustc_query_system::dep_graph::graph::DepGraph::with_task_impl::h6e6421c20d4bb870 76: 0x7fc7e0d93f40 - rustc_data_structures::stack::ensure_sufficient_stack::hb3295eb0be61668b 77: 0x7fc7e0d26c6e - rustc_query_system::query::plumbing::get_query_impl::h00fc7191d06b31f2 78: 0x7fc7e0dbf86f - rustc_interface::passes::QueryContext::enter::hc1ecc9b89b663dd9 79: 0x7fc7e0d9158c - rustc_interface::queries::::enter::hd95de6fb5f21524f 80: 0x7fc7e0d66297 - rustc_span::with_source_map::h9ca2e3b3b60ab68d 81: 0x7fc7e0d8d991 - scoped_tls::ScopedKey::set::hd63d0bb6407e5eea 82: 0x7fc7e0d948c1 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha55be4216e8091db 83: 0x7fc7e0d11b2e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h85ff70c719001250 84: 0x7fc7e00e56fa - as core::ops::function::FnOnce>::call_once::hbb39a3e615f69ef9 at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1042 85: 0x7fc7e00e56fa - as core::ops::function::FnOnce>::call_once::h79630a683aed732c at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/alloc/src/boxed.rs:1042 86: 0x7fc7e00e56fa - std::sys::unix::thread::Thread::new::thread_start::h4afaeade0da13617 at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/sys/unix/thread.rs:87 87: 0x7fc7dfffa609 - start_thread 88: 0x7fc7dfdb5293 - clone 89: 0x0 - ```

giraffate commented 3 years ago

This is similar to https://github.com/rust-lang/rust/issues/78823. I guess this doesn't seem to be a Clippy bug.

elpiel commented 3 years ago

Ok, thanks! I'm closing this issue and will follow up the issue you provided.