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: has escaping bound vars, so it cannot be wrapped in a dummy binder in is_copy_raw #11309

Closed
Nashenas88 opened this issue Aug 9, 2023 · 12 comments · Fixed by #11318
Closed
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Nashenas88
Copy link

Summary

thread 'rustc' panicked at /b/s/w/ir/x/w/fuchsia-third_party-rust/compiler/rustc_middle/src/ty/mod.rs:1239:9:
`<(std::vec::Vec<&str>, std::option::Option<&diagnostics_hierarchy::Property>) as std::marker::Copy>` has escaping bound vars, so it cannot be wrapped in a dummy binder.

Not yet minimized. Seems to come from https://cs.opensource.google/fuchsia/fuchsia/+/main:src/connectivity/network/tests/integration/inspect/src/lib.rs;l=1617;drc=40f5937c45609e364e4914cc5b35db2b2b951717

Where diagnostics_hierarchy::Property is defined as seen here https://fuchsia-docs.firebaseapp.com/rust/diagnostics_hierarchy/enum.Property.html

Version

commit-hash: f88a8b71cebb730cbd5058c45ebcae1d4d9be377

Error output

Backtrace

thread 'rustc' panicked at /b/s/w/ir/x/w/fuchsia-third_party-rust/compiler/rustc_middle/src/ty/mod.rs:1239:9:
`<(std::vec::Vec<&str>, std::option::Option<&diagnostics_hierarchy::Property>) as std::marker::Copy>` has escaping bound vars, so it cannot be wrapped in a dummy binder.
stack backtrace:
 0:     0x7f1a9cb5ca7c - std::backtrace_rs::backtrace::libunwind::trace::h712f14a8fac7f164
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
 1:     0x7f1a9cb5ca7c - std::backtrace_rs::backtrace::trace_unsynchronized::h5322245deb6ac6c2
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 2:     0x7f1a9cb5ca7c - std::sys_common::backtrace::_print_fmt::h27cd80640306436f
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/sys_common/backtrace.rs:67:5
 3:     0x7f1a9cb5ca7c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he4f98f1ac24e1f6b
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/sys_common/backtrace.rs:44:22
 4:     0x7f1a9cbc8d4c - core::fmt::rt::Argument::fmt::h48cc59ac50f45555
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/core/src/fmt/rt.rs:138:9
 5:     0x7f1a9cbc8d4c - core::fmt::write::h335d451c552e4fd2
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/core/src/fmt/mod.rs:1094:21
 6:     0x7f1a9cb4f36d - std::io::Write::write_fmt::hf5ebcf85cf27e667
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/io/mod.rs:1714:15
 7:     0x7f1a9cb5c864 - std::sys_common::backtrace::_print::h32363c29e31b936f
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/sys_common/backtrace.rs:47:5
 8:     0x7f1a9cb5c864 - std::sys_common::backtrace::print::h444d8be2f34034b3
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/sys_common/backtrace.rs:34:9
 9:     0x7f1a9cb5f95a - std::panicking::panic_hook_with_disk_dump::{{closure}}::ha42f81f9fec83a62
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/panicking.rs:278:22
10:     0x7f1a9cb5f609 - std::panicking::panic_hook_with_disk_dump::hcb43a89d3a278f2e
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/panicking.rs:305:9
11:     0x7f1a9ec2558d - rustc_driver_impl[a3b376697c1f9d40]::install_ice_hook::{closure#0}
12:     0x7f1a9cb60200 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h00f56d77fc6dac95
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/alloc/src/boxed.rs:2021:9
13:     0x7f1a9cb60200 - std::panicking::rust_panic_with_hook::h41caf18a07c6ee75
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/panicking.rs:733:13
14:     0x7f1a9cb5ff87 - std::panicking::begin_panic_handler::{{closure}}::h8d0512fc6145de1d
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/panicking.rs:621:13
15:     0x7f1a9cb5cfa6 - std::sys_common::backtrace::__rust_end_short_backtrace::h12a966de63cc41e5
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/sys_common/backtrace.rs:170:18
16:     0x7f1a9cb5fcd2 - rust_begin_unwind
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/panicking.rs:617:5
17:     0x7f1a9cbc5153 - core::panicking::panic_fmt::ha5452bec4ffbf995
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/core/src/panicking.rs:67:14
18:     0x7f1aa0a2fc60 - <rustc_infer[5c2cc0ce64fe7196]::traits::Obligation<rustc_middle[4e39534ad143988e]::ty::Predicate>>::with_depth::<rustc_middle[4e39534ad143988e]::ty::sty::TraitRef>
19:     0x7f1aa08efcb0 - rustc_trait_selection[493a1c716c87a16d]::traits::type_known_to_meet_bound_modulo_regions
20:     0x7f1aa0acb3d4 - rustc_ty_utils[2b480d80ea03f19d]::common_traits::is_item_raw
21:     0x7f1aa023ce14 - rustc_query_impl[e5a2310130a23b66]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e5a2310130a23b66]::query_impl::is_copy_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4e39534ad143988e]::query::erase::Erased<[u8; 1usize]>>
22:     0x7f1aa044f76f - <rustc_query_impl[e5a2310130a23b66]::query_impl::is_copy_raw::dynamic_query::{closure#2} as core[8c2eec684c9f2aa7]::ops::function::FnOnce<(rustc_middle[4e39534ad143988e]::ty::context::TyCtxt, rustc_middle[4e39534ad143988e]::ty::ParamEnvAnd<rustc_middle[4e39534ad143988e]::ty::Ty>)>>::call_once
23:     0x7f1aa01930b7 - rustc_query_system[f19bd4f68b2513a8]::query::plumbing::try_execute_query::<rustc_query_impl[e5a2310130a23b66]::DynamicConfig<rustc_query_system[f19bd4f68b2513a8]::query::caches::DefaultCache<rustc_middle[4e39534ad143988e]::ty::ParamEnvAnd<rustc_middle[4e39534ad143988e]::ty::Ty>, rustc_middle[4e39534ad143988e]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[e5a2310130a23b66]::plumbing::QueryCtxt, false>
24:     0x7f1aa02ee339 - rustc_query_impl[e5a2310130a23b66]::query_impl::is_copy_raw::get_query_non_incr::__rust_end_short_backtrace
25:     0x7f1a9fa4ea5d - rustc_middle[4e39534ad143988e]::query::plumbing::query_get_at::<rustc_query_system[f19bd4f68b2513a8]::query::caches::DefaultCache<rustc_middle[4e39534ad143988e]::ty::ParamEnvAnd<rustc_middle[4e39534ad143988e]::ty::Ty>, rustc_middle[4e39534ad143988e]::query::erase::Erased<[u8; 1usize]>>>
26:     0x7f1a9fa4081e - <rustc_middle[4e39534ad143988e]::ty::Ty>::is_copy_modulo_regions
27:     0x5599da0e7d04 - clippy_lints[2cd0747baeaf1ae5]::methods::filter_map_bool_then::check
28:     0x5599d9e729cb - <clippy_lints[2cd0747baeaf1ae5]::methods::Methods>::check_methods
29:     0x5599d9e71148 - <clippy_lints[2cd0747baeaf1ae5]::methods::Methods as rustc_lint[c37bedf9453b9f63]::passes::LateLintPass>::check_expr
30:     0x7f1a9f6650a4 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
31:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
32:     0x7f1a9f68f170 - rustc_hir[2d0b7e40578507b9]::intravisit::walk_expr::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
33:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
34:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
35:     0x7f1a9f6664e1 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_local
36:     0x7f1a9f68f50c - rustc_hir[2d0b7e40578507b9]::intravisit::walk_expr::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
37:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
38:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
39:     0x7f1a9f666988 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_arm
40:     0x7f1a9f68f38f - rustc_hir[2d0b7e40578507b9]::intravisit::walk_expr::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
41:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
42:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
43:     0x7f1a9f68f2fc - rustc_hir[2d0b7e40578507b9]::intravisit::walk_expr::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
44:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
45:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
46:     0x7f1a9f666988 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_arm
47:     0x7f1a9f68f38f - rustc_hir[2d0b7e40578507b9]::intravisit::walk_expr::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
48:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
49:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
50:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
51:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
52:     0x7f1a9f68f526 - rustc_hir[2d0b7e40578507b9]::intravisit::walk_expr::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
53:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
54:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
55:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
56:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
57:     0x7f1a9f68f526 - rustc_hir[2d0b7e40578507b9]::intravisit::walk_expr::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
58:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
59:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
60:     0x7f1a9f6652a1 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_nested_body
61:     0x7f1a9f68f496 - rustc_hir[2d0b7e40578507b9]::intravisit::walk_expr::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
62:     0x7f1a9f6650be - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}>
63:     0x7f1a9f665717 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_expr
64:     0x7f1a9f6652a1 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_nested_body
65:     0x7f1a9f691018 - rustc_hir[2d0b7e40578507b9]::intravisit::walk_item::<rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass>>
66:     0x7f1a9f662525 - <rustc_lint[c37bedf9453b9f63]::late::LateContextAndPass<rustc_lint[c37bedf9453b9f63]::late::RuntimeCombinedLateLintPass> as rustc_hir[2d0b7e40578507b9]::intravisit::Visitor>::visit_nested_item
67:     0x7f1a9f65e78c - <rustc_session[5b68303f1d45cafc]::session::Session>::time::<(), rustc_lint[c37bedf9453b9f63]::late::check_crate::{closure#0}::{closure#0}>
68:     0x7f1a9f589dd8 - <core[8c2eec684c9f2aa7]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[bbd54b40b3118f42]::passes::analysis::{closure#5}::{closure#1}::{closure#2}> as core[8c2eec684c9f2aa7]::ops::function::FnOnce<()>>::call_once
69:     0x7f1a9f58a821 - <core[8c2eec684c9f2aa7]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[bbd54b40b3118f42]::passes::analysis::{closure#5}::{closure#1}> as core[8c2eec684c9f2aa7]::ops::function::FnOnce<()>>::call_once
70:     0x7f1a9f580faa - <rustc_session[5b68303f1d45cafc]::session::Session>::time::<(), rustc_interface[bbd54b40b3118f42]::passes::analysis::{closure#5}>
71:     0x7f1a9f5a2c6a - rustc_interface[bbd54b40b3118f42]::passes::analysis
72:     0x7f1aa0240eaa - rustc_query_impl[e5a2310130a23b66]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e5a2310130a23b66]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4e39534ad143988e]::query::erase::Erased<[u8; 1usize]>>
73:     0x7f1aa0453e48 - <rustc_query_impl[e5a2310130a23b66]::query_impl::analysis::dynamic_query::{closure#2} as core[8c2eec684c9f2aa7]::ops::function::FnOnce<(rustc_middle[4e39534ad143988e]::ty::context::TyCtxt, ())>>::call_once
74:     0x7f1aa018c753 - rustc_query_system[f19bd4f68b2513a8]::query::plumbing::try_execute_query::<rustc_query_impl[e5a2310130a23b66]::DynamicConfig<rustc_query_system[f19bd4f68b2513a8]::query::caches::SingleCache<rustc_middle[4e39534ad143988e]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[e5a2310130a23b66]::plumbing::QueryCtxt, false>
75:     0x7f1aa02cd380 - rustc_query_impl[e5a2310130a23b66]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
76:     0x7f1a9ec2df6f - <rustc_middle[4e39534ad143988e]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[a3b376697c1f9d40]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>>
77:     0x7f1a9ec63198 - rustc_span[fbb5fda749e896f2]::set_source_map::<core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>, rustc_interface[bbd54b40b3118f42]::interface::run_compiler<core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>, rustc_driver_impl[a3b376697c1f9d40]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
78:     0x7f1a9ec89474 - std[d19c269aaf875b3b]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[bbd54b40b3118f42]::util::run_in_thread_pool_with_globals<rustc_interface[bbd54b40b3118f42]::interface::run_compiler<core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>, rustc_driver_impl[a3b376697c1f9d40]::run_compiler::{closure#1}>::{closure#0}, core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>>
79:     0x7f1a9ec8a3c1 - <<std[d19c269aaf875b3b]::thread::Builder>::spawn_unchecked_<rustc_interface[bbd54b40b3118f42]::util::run_in_thread_pool_with_globals<rustc_interface[bbd54b40b3118f42]::interface::run_compiler<core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>, rustc_driver_impl[a3b376697c1f9d40]::run_compiler::{closure#1}>::{closure#0}, core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8c2eec684c9f2aa7]::result::Result<(), rustc_span[fbb5fda749e896f2]::ErrorGuaranteed>>::{closure#1} as core[8c2eec684c9f2aa7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
80:     0x7f1a9cb6aa75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h97ab88829442b712
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/alloc/src/boxed.rs:2007:9
81:     0x7f1a9cb6aa75 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4f26699055889359
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/alloc/src/boxed.rs:2007:9
82:     0x7f1a9cb6aa75 - std::sys::unix::thread::Thread::new::thread_start::ha2de5b20005a4d9b
                             at /b/s/w/ir/x/w/fuchsia-third_party-rust/library/std/src/sys/unix/thread.rs:108:17
83:     0x7f1a9c901fd4 - start_thread
                             at ./nptl/pthread_create.c:442:8
84:     0x7f1a9c9825bc - __GI___clone3
                             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81


rustc version: 1.73.0-nightly (f88a8b71c 2023-08-08)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [is_copy_raw] computing whether `(alloc::vec::Vec<&str>, core::option::Option<&diagnostics_hierarchy::Property>)` is `Copy`
#1 [analysis] running analysis passes on this crate
end of query stack

@Nashenas88 Nashenas88 added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Aug 9, 2023
@Nashenas88
Copy link
Author

I'm currently working to produce a minimized repro.

@Centri3
Copy link
Member

Centri3 commented Aug 9, 2023

Looks like it's from the filter_map_bool_then (one of my own, sorry! 😅)

The issue seems to be in this line:

&& is_copy(cx, cx.typeck_results().node_type(param_ty.hir_id).peel_refs())
, though I have no idea why that's an issue.

Once that minimized repro is available I'll take a look into this.

@Nashenas88
Copy link
Author

Got the minimized repro:

fn check<'a>(iter: impl Iterator<Item = (&'a str, &'a str)>) -> Vec<&'a str> {
    iter.filter_map(|(_, s): (&str, _)| Some(s)).collect()
}

@compiler-errors
Copy link
Member

@Centri3:

node_type(param_ty.hir_id) likely has bound vars from the closure's own binder.

to fix, you can probably take that type, wrap it in a binder with ty::Binder::bind_with_vars using the TyCtxt::late_bound_vars of the closure's hir id, and then liberate the binder to conver them into free regions.

That would be the least hacky way to deal with those bound vars.

@Nashenas88
Copy link
Author

If this is a new lint, could we revert the lint to prevent the ICE from triggering while the fix is being worked on? We don't know exactly which commit this started in since our toolchain was also broken by rust-lang/rust#114597 earlier.

@Centri3
Copy link
Member

Centri3 commented Aug 10, 2023

It was this one. #11115
You could revert it locally and build it yourself, setting up a custom toolchain for exactly that clippy version, but not practically. We'd need to wait until the next sync (which is today, I think!) but getting it into master without approving my own PR would likely take longer.

I doubt there's any reason we can't make a PR against rustc itself, but I don't think I've seen that done before for a clippy issue. Maybe we could do that instead, though that'd result in the two being out of sync intentionally.

@tmandry
Copy link
Member

tmandry commented Aug 10, 2023

I believe a PR on the rust repo would follow the revert policy at https://forge.rust-lang.org/compiler/reviews.html#reverts, but since it's a T-compiler policy it doesn't automatically apply here. The policy says it's okay to self-approve reverts.

edit: The other reason it's nicer to revert on the rust repo is that we don't have to wait for the next subtree sync.

@Centri3
Copy link
Member

Centri3 commented Aug 10, 2023

I think I'll revert it manually and open a PR for that. However, this will result in some issues come the next sync so heads up @flip1995, come the next sync you'll likely need to ignore that PR on the rust -> clippy side, but revert it on clippy -> rust.

@blyxyas
Copy link
Member

blyxyas commented Aug 10, 2023

Before completely reverting the lint, did you try @compiler-errors' solution? In the PR it says that the ICE is unpreventable, but maybe it would fix it.

@Centri3
Copy link
Member

Centri3 commented Aug 10, 2023

Yes, I opened a PR for that (#11318). I mean unpreventable in that it cannot be prevented by the user because in some cases, type annotations are needed (which creates late bound vars, for some reason)

@blyxyas
Copy link
Member

blyxyas commented Aug 10, 2023

Oooh, so rust-lang/rust#114715 reverts the lint so nobody encounters the bug while #11318 fixes it. Right?

@Centri3
Copy link
Member

Centri3 commented Aug 10, 2023

yep

@bors bors closed this as completed in bd1554c Aug 11, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this issue Aug 11, 2023
…ishearth

Revert clippy lint [`filter_map_bool_then`]

r? `@Manishearth`

Issue in question is rust-lang/rust-clippy#11309.

We usually wait until the next sync but this ICE is entirely unpreventable and happens often for code where type annotations are needed alongside a lifetime parameter so I think it's a good idea to revert it here. Also, this got into 1.71.1: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=620a95846a0e4810dffb39d7594d62d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants