From 90c2b238e6a38e3309a7ffc1162e6361db14ffdd Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 27 Jun 2024 19:54:28 -0400 Subject: [PATCH 1/2] Failing test for computing drop shim that has const param --- .../const-generics/polymorphic-drop-shim.rs | 21 ++ .../polymorphic-drop-shim.stderr | 257 ++++++++++++++++++ 2 files changed, 278 insertions(+) create mode 100644 tests/ui/const-generics/polymorphic-drop-shim.rs create mode 100644 tests/ui/const-generics/polymorphic-drop-shim.stderr diff --git a/tests/ui/const-generics/polymorphic-drop-shim.rs b/tests/ui/const-generics/polymorphic-drop-shim.rs new file mode 100644 index 0000000000000..97ade9fe69a30 --- /dev/null +++ b/tests/ui/const-generics/polymorphic-drop-shim.rs @@ -0,0 +1,21 @@ +//@ compile-flags: -Zinline-mir=yes --crate-type=lib + +//@ known-bug: unknown +//@ build-fail +//@ failure-status: 101 + +use std::mem::ManuallyDrop; + +pub struct Foo([T; N]); + +pub struct Dorp {} + +impl Drop for Dorp { + fn drop(&mut self) {} +} + +#[inline] +// SAFETY: call this with a valid allocation idk +pub unsafe fn drop(x: *mut Foo) { + std::ptr::drop_in_place(x); +} diff --git a/tests/ui/const-generics/polymorphic-drop-shim.stderr b/tests/ui/const-generics/polymorphic-drop-shim.stderr new file mode 100644 index 0000000000000..3a445a524097d --- /dev/null +++ b/tests/ui/const-generics/polymorphic-drop-shim.stderr @@ -0,0 +1,257 @@ +thread 'rustc' panicked at compiler/rustc_middle/src/ty/sty.rs:360:36: +called `Option::unwrap()` on a `None` value +stack backtrace: + 0: begin_panic_handler + at ./library/std/src/panicking.rs:661:5 + 1: panic_fmt + at ./library/core/src/panicking.rs:74:14 + 2: panic + at ./library/core/src/panicking.rs:148:5 + 3: core::option::unwrap_failed + at ./library/core/src/option.rs:2013:5 + 4: unwrap + at ./library/core/src/option.rs:963:21 + 5: find_ty_from_env + at ./compiler/rustc_middle/src/ty/sty.rs:360:18 + 6: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1016:29 + 7: maybe_grow, rustc_trait_selection::traits::select::{impl#1}::evaluate_predicate_recursively::{closure#0}::{closure_env#0}> + at /home/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:55:9 + 8: ensure_sufficient_stack, rustc_trait_selection::traits::select::{impl#1}::evaluate_predicate_recursively::{closure#0}::{closure_env#0}> + at ./compiler/rustc_data_structures/src/stack.rs:17:5 + 9: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:664:9 + 10: evaluate_predicate_recursively + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:643:5 + 11: evaluate_predicates_recursively, alloc::alloc::Global>> + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:631:24 + 12: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1317:21 + 13: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:596:26 + 14: probe, rustc_trait_selection::traits::select::{impl#1}::evaluation_probe::{closure_env#0}> + at ./compiler/rustc_infer/src/infer/snapshot/mod.rs:85:17 + 15: ::evaluation_probe::<::evaluate_candidate::{closure#0}::{closure#0}> + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:594:9 + 16: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1298:26 + 17: evaluate_candidate + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1286:5 + 18: evaluate_stack + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1257:28 + 19: {closure#1} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1083:30 + 20: {closure#0}> + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1445:88 + 21: with_anon_task>, core::result::Result> + at ./compiler/rustc_query_system/src/dep_graph/graph.rs:306:22 + 22: in_task> + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1445:13 + 23: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1082:34 + 24: evaluate_trait_predicate_recursively + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1037:5 + 25: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:671:21 + 26: maybe_grow, rustc_trait_selection::traits::select::{impl#1}::evaluate_predicate_recursively::{closure#0}::{closure_env#0}> + at /home/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:55:9 + 27: ensure_sufficient_stack, rustc_trait_selection::traits::select::{impl#1}::evaluate_predicate_recursively::{closure#0}::{closure_env#0}> + at ./compiler/rustc_data_structures/src/stack.rs:17:5 + 28: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:664:9 + 29: evaluate_predicate_recursively + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:643:5 + 30: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:572:30 + 31: {closure#0} + at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:596:26 + 32: probe, rustc_trait_selection::traits::select::{impl#1}::evaluation_probe::{closure_env#0}> + at ./compiler/rustc_infer/src/infer/snapshot/mod.rs:85:17 + 33: evaluate_obligation + at ./compiler/rustc_traits/src/evaluate_obligation.rs:29:5 + 34: {closure#0} + at ./compiler/rustc_query_impl/src/plumbing.rs:281:9 + [... omitted 22 frames ...] + 35: query_get_at>, rustc_middle::query::erase::Erased<[u8; 2]>>> + at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 + 36: evaluate_obligation + at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 + 37: evaluate_obligation + at ./compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs:93:13 + 38: evaluate_obligation_no_overflow + at ./compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs:107:15 + 39: {closure#0}> + at ./compiler/rustc_trait_selection/src/traits/mod.rs:221:18 + 40: pred_known_to_hold_modulo_regions> + at ./compiler/rustc_trait_selection/src/traits/mod.rs:213:1 + 41: rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions + at ./compiler/rustc_trait_selection/src/traits/mod.rs:206:5 + 42: rustc_ty_utils::common_traits::is_item_raw + at ./compiler/rustc_ty_utils/src/common_traits.rs:33:5 + 43: {closure#0} + at ./compiler/rustc_query_impl/src/plumbing.rs:281:9 + [... omitted 22 frames ...] + 44: query_get_at, rustc_middle::query::erase::Erased<[u8; 1]>>> + at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 + 45: is_copy_raw + at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 + 46: is_copy_raw + at ./compiler/rustc_middle/src/query/plumbing.rs:414:17 + 47: is_copy_modulo_regions + at ./compiler/rustc_middle/src/ty/util.rs:1243:48 + 48: next, alloc::vec::into_iter::IntoIter> + at ./compiler/rustc_ty_utils/src/needs_drop.rs:184:26 + 49: try_fold>, (), core::iter::traits::iterator::Iterator::find::check::{closure_env#0}, &mut rustc_ty_utils::needs_drop::filter_array_elements::{closure_env#0}>, core::ops::control_flow::ControlFlow, ()>> + at ./library/core/src/iter/traits/iterator.rs:2409:29 + 50: find>, &mut rustc_ty_utils::needs_drop::filter_array_elements::{closure_env#0}> + at ./library/core/src/iter/traits/iterator.rs:2880:9 + 51: next>, rustc_ty_utils::needs_drop::filter_array_elements::{closure_env#0}> + at ./library/core/src/iter/adapters/filter.rs:96:9 + 52: needs_drop_raw + at ./compiler/rustc_ty_utils/src/needs_drop.rs:24:15 + 53: {closure#0} + at ./compiler/rustc_query_impl/src/plumbing.rs:281:9 + [... omitted 22 frames ...] + 54: query_get_at, rustc_middle::query::erase::Erased<[u8; 1]>>> + at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 + 55: needs_drop_raw + at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 + 56: needs_drop_raw + at ./compiler/rustc_middle/src/query/plumbing.rs:414:17 + 57: needs_drop + at ./compiler/rustc_middle/src/ty/util.rs:1433:17 + 58: {closure#0} + at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:378:13 + 59: {closure#0}<(rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, rustc_mir_dataflow::elaborate_drops::{impl#2}::drop_ladder::{closure_env#0}> + at ./library/alloc/src/vec/mod.rs:1683:32 + 60: process_loop), alloc::alloc::Global, rustc_mir_dataflow::elaborate_drops::{impl#2}::drop_ladder::{closure_env#0}>, (rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, false> + at ./library/alloc/src/vec/mod.rs:1763:21 + 61: retain_mut<(rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, alloc::vec::{impl#1}::retain::{closure_env#0}<(rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, rustc_mir_dataflow::elaborate_drops::{impl#2}::drop_ladder::{closure_env#0}>> + at ./library/alloc/src/vec/mod.rs:1789:9 + 62: retain<(rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, rustc_mir_dataflow::elaborate_drops::{impl#2}::drop_ladder::{closure_env#0}> + at ./library/alloc/src/vec/mod.rs:1683:9 + 63: drop_ladder + at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:377:9 + 64: open_drop_for_adt_contents + at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:488:13 + 65: {closure#0} + at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:461:13 + 66: open_drop_for_adt + at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:440:5 + 67: open_drop + at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:869:35 + 68: elaborate_drop + at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:253:31 + 69: rustc_mir_dataflow::elaborate_drops::elaborate_drop:: + at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:192:5 + 70: build_drop_shim + at ./compiler/rustc_mir_transform/src/shim.rs:283:13 + 71: make_shim + at ./compiler/rustc_mir_transform/src/shim.rs:128:13 + 72: {closure#0} + at ./compiler/rustc_query_impl/src/plumbing.rs:281:9 + [... omitted 22 frames ...] + 73: query_get_at>> + at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 + 74: mir_shims + at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 + 75: mir_shims + at ./compiler/rustc_middle/src/query/plumbing.rs:414:17 + 76: instance_mir + at ./compiler/rustc_middle/src/ty/mod.rs:1738:62 + 77: try_instance_mir + at ./compiler/rustc_mir_transform/src/inline.rs:1082:8 + 78: try_inlining + at ./compiler/rustc_mir_transform/src/inline.rs:194:27 + 79: process_blocks + at ./compiler/rustc_mir_transform/src/inline.rs:139:19 + 80: inline + at ./compiler/rustc_mir_transform/src/inline.rs:97:5 + 81: run_pass + at ./compiler/rustc_mir_transform/src/inline.rs:62:12 + 82: run_passes_inner + at ./compiler/rustc_mir_transform/src/pass_manager.rs:144:17 + 83: rustc_mir_transform::pass_manager::run_passes + at ./compiler/rustc_mir_transform/src/pass_manager.rs:87:5 + 84: run_optimization_passes + at ./compiler/rustc_mir_transform/src/lib.rs:561:5 + 85: inner_optimized_mir + at ./compiler/rustc_mir_transform/src/lib.rs:667:5 + 86: optimized_mir + at ./compiler/rustc_mir_transform/src/lib.rs:630:21 + 87: {closure#0} + at ./compiler/rustc_query_impl/src/plumbing.rs:285:13 + [... omitted 22 frames ...] + 88: query_get_at>> + at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 + 89: optimized_mir + at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 + 90: optimized_mir + at ./compiler/rustc_middle/src/query/plumbing.rs:414:17 + 91: encode_mir + at ./compiler/rustc_metadata/src/rmeta/encoder.rs:1656:74 + 92: {closure#15} + at ./compiler/rustc_metadata/src/rmeta/encoder.rs:639:29 + 93: encode_crate_root + at ./compiler/rustc_metadata/src/rmeta/encoder.rs:600:27 + 94: encode_metadata + at ./compiler/rustc_metadata/src/rmeta/encoder.rs:2269:16 + 95: encode_and_write_metadata + at ./compiler/rustc_metadata/src/fs.rs:65:13 + 96: start_codegen + at ./compiler/rustc_interface/src/passes.rs:1024:44 + 97: {closure#0} + at ./compiler/rustc_interface/src/queries.rs:122:35 + 98: {closure#1}> + at ./compiler/rustc_middle/src/ty/context.rs:1288:37 + 99: {closure#0}>, core::result::Result> + at ./compiler/rustc_middle/src/ty/context/tls.rs:82:9 + 100: try_with, rustc_middle::ty::context::tls::enter_context::{closure_env#0}>, core::result::Result>, core::result::Result> + at ./library/std/src/thread/local.rs:283:12 + 101: with, rustc_middle::ty::context::tls::enter_context::{closure_env#0}>, core::result::Result>, core::result::Result> + at ./library/std/src/thread/local.rs:260:9 + 102: enter_context>, core::result::Result> + at ./compiler/rustc_middle/src/ty/context/tls.rs:79:5 + 103: enter> + at ./compiler/rustc_middle/src/ty/context.rs:1288:9 + 104: >::enter::, ::codegen_and_build_linker::{closure#0}> + at ./compiler/rustc_interface/src/queries.rs:64:9 + 105: codegen_and_build_linker + at ./compiler/rustc_interface/src/queries.rs:121:9 + 106: {closure#1} + at ./compiler/rustc_driver_impl/src/lib.rs:451:26 + 107: enter, rustc_span::ErrorGuaranteed>> + at ./compiler/rustc_interface/src/queries.rs:202:19 + 108: {closure#0} + at ./compiler/rustc_driver_impl/src/lib.rs:389:22 + 109: {closure#1}, rustc_driver_impl::run_compiler::{closure_env#0}> + at ./compiler/rustc_interface/src/interface.rs:502:27 + 110: {closure#0}, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>> + at ./compiler/rustc_interface/src/util.rs:154:13 + 111: {closure#0}, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>> + at ./compiler/rustc_interface/src/util.rs:106:21 + 112: set, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>> + at /home/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/scoped-tls-1.0.1/src/lib.rs:137:9 + 113: create_session_globals_then, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>> + at ./compiler/rustc_span/src/lib.rs:134:5 + 114: {closure#0}, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>> + at ./compiler/rustc_interface/src/util.rs:105:17 +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 make sure that you have updated to the latest nightly + +note: rustc 1.81.0-dev running on x86_64-unknown-linux-gnu + +note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/home/michael/.cargo -Z ignore-directory-in-diagnostics-source-blocks=/home/michael/programming/rust2/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0 -Z inline-mir=yes --crate-type lib + +query stack during panic: +#0 [evaluate_obligation] evaluating trait selection obligation `[Dorp; M]: core::marker::Copy` +#1 [is_copy_raw] computing whether `[Dorp; M]` is `Copy` +#2 [needs_drop_raw] computing whether `[Dorp; M]` needs drop +#3 [mir_shims] generating MIR shim for `core::ptr::drop_in_place` +#4 [optimized_mir] optimizing MIR for `drop` +end of query stack From f17b27b3014adea0c40df55b31bd2fbbd72e76c4 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Fri, 28 Jun 2024 10:18:13 -0400 Subject: [PATCH 2/2] Don't inline drop shims with unsubstituted generic consts in MIR inliner --- compiler/rustc_mir_transform/src/inline.rs | 12 +- .../const-generics/polymorphic-drop-shim.rs | 5 +- .../polymorphic-drop-shim.stderr | 257 ------------------ 3 files changed, 12 insertions(+), 262 deletions(-) delete mode 100644 tests/ui/const-generics/polymorphic-drop-shim.stderr diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index 0a5fc697d0321..07482d0571a2f 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -11,7 +11,7 @@ use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs} use rustc_middle::mir::visit::*; use rustc_middle::mir::*; use rustc_middle::ty::TypeVisitableExt; -use rustc_middle::ty::{self, Instance, InstanceKind, ParamEnv, Ty, TyCtxt}; +use rustc_middle::ty::{self, Instance, InstanceKind, ParamEnv, Ty, TyCtxt, TypeFlags}; use rustc_session::config::{DebugInfo, OptLevel}; use rustc_span::source_map::Spanned; use rustc_span::sym; @@ -306,6 +306,16 @@ impl<'tcx> Inliner<'tcx> { InstanceKind::Intrinsic(_) | InstanceKind::Virtual(..) => { return Err("instance without MIR (intrinsic / virtual)"); } + + // FIXME(#127030): `ConstParamHasTy` has bad interactions with + // the drop shim builder, which does not evaluate predicates in + // the correct param-env for types being dropped. Stall resolving + // the MIR for this instance until all of its const params are + // substituted. + InstanceKind::DropGlue(_, Some(ty)) if ty.has_type_flags(TypeFlags::HAS_CT_PARAM) => { + return Err("still needs substitution"); + } + // This cannot result in an immediate cycle since the callee MIR is a shim, which does // not get any optimizations run on it. Any subsequent inlining may cause cycles, but we // do not need to catch this here, we can wait until the inliner decides to continue diff --git a/tests/ui/const-generics/polymorphic-drop-shim.rs b/tests/ui/const-generics/polymorphic-drop-shim.rs index 97ade9fe69a30..4ca2e86cff915 100644 --- a/tests/ui/const-generics/polymorphic-drop-shim.rs +++ b/tests/ui/const-generics/polymorphic-drop-shim.rs @@ -1,8 +1,5 @@ //@ compile-flags: -Zinline-mir=yes --crate-type=lib - -//@ known-bug: unknown -//@ build-fail -//@ failure-status: 101 +//@ build-pass use std::mem::ManuallyDrop; diff --git a/tests/ui/const-generics/polymorphic-drop-shim.stderr b/tests/ui/const-generics/polymorphic-drop-shim.stderr deleted file mode 100644 index 3a445a524097d..0000000000000 --- a/tests/ui/const-generics/polymorphic-drop-shim.stderr +++ /dev/null @@ -1,257 +0,0 @@ -thread 'rustc' panicked at compiler/rustc_middle/src/ty/sty.rs:360:36: -called `Option::unwrap()` on a `None` value -stack backtrace: - 0: begin_panic_handler - at ./library/std/src/panicking.rs:661:5 - 1: panic_fmt - at ./library/core/src/panicking.rs:74:14 - 2: panic - at ./library/core/src/panicking.rs:148:5 - 3: core::option::unwrap_failed - at ./library/core/src/option.rs:2013:5 - 4: unwrap - at ./library/core/src/option.rs:963:21 - 5: find_ty_from_env - at ./compiler/rustc_middle/src/ty/sty.rs:360:18 - 6: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1016:29 - 7: maybe_grow, rustc_trait_selection::traits::select::{impl#1}::evaluate_predicate_recursively::{closure#0}::{closure_env#0}> - at /home/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:55:9 - 8: ensure_sufficient_stack, rustc_trait_selection::traits::select::{impl#1}::evaluate_predicate_recursively::{closure#0}::{closure_env#0}> - at ./compiler/rustc_data_structures/src/stack.rs:17:5 - 9: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:664:9 - 10: evaluate_predicate_recursively - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:643:5 - 11: evaluate_predicates_recursively, alloc::alloc::Global>> - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:631:24 - 12: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1317:21 - 13: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:596:26 - 14: probe, rustc_trait_selection::traits::select::{impl#1}::evaluation_probe::{closure_env#0}> - at ./compiler/rustc_infer/src/infer/snapshot/mod.rs:85:17 - 15: ::evaluation_probe::<::evaluate_candidate::{closure#0}::{closure#0}> - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:594:9 - 16: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1298:26 - 17: evaluate_candidate - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1286:5 - 18: evaluate_stack - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1257:28 - 19: {closure#1} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1083:30 - 20: {closure#0}> - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1445:88 - 21: with_anon_task>, core::result::Result> - at ./compiler/rustc_query_system/src/dep_graph/graph.rs:306:22 - 22: in_task> - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1445:13 - 23: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1082:34 - 24: evaluate_trait_predicate_recursively - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:1037:5 - 25: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:671:21 - 26: maybe_grow, rustc_trait_selection::traits::select::{impl#1}::evaluate_predicate_recursively::{closure#0}::{closure_env#0}> - at /home/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/stacker-0.1.15/src/lib.rs:55:9 - 27: ensure_sufficient_stack, rustc_trait_selection::traits::select::{impl#1}::evaluate_predicate_recursively::{closure#0}::{closure_env#0}> - at ./compiler/rustc_data_structures/src/stack.rs:17:5 - 28: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:664:9 - 29: evaluate_predicate_recursively - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:643:5 - 30: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:572:30 - 31: {closure#0} - at ./compiler/rustc_trait_selection/src/traits/select/mod.rs:596:26 - 32: probe, rustc_trait_selection::traits::select::{impl#1}::evaluation_probe::{closure_env#0}> - at ./compiler/rustc_infer/src/infer/snapshot/mod.rs:85:17 - 33: evaluate_obligation - at ./compiler/rustc_traits/src/evaluate_obligation.rs:29:5 - 34: {closure#0} - at ./compiler/rustc_query_impl/src/plumbing.rs:281:9 - [... omitted 22 frames ...] - 35: query_get_at>, rustc_middle::query::erase::Erased<[u8; 2]>>> - at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 - 36: evaluate_obligation - at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 - 37: evaluate_obligation - at ./compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs:93:13 - 38: evaluate_obligation_no_overflow - at ./compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs:107:15 - 39: {closure#0}> - at ./compiler/rustc_trait_selection/src/traits/mod.rs:221:18 - 40: pred_known_to_hold_modulo_regions> - at ./compiler/rustc_trait_selection/src/traits/mod.rs:213:1 - 41: rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions - at ./compiler/rustc_trait_selection/src/traits/mod.rs:206:5 - 42: rustc_ty_utils::common_traits::is_item_raw - at ./compiler/rustc_ty_utils/src/common_traits.rs:33:5 - 43: {closure#0} - at ./compiler/rustc_query_impl/src/plumbing.rs:281:9 - [... omitted 22 frames ...] - 44: query_get_at, rustc_middle::query::erase::Erased<[u8; 1]>>> - at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 - 45: is_copy_raw - at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 - 46: is_copy_raw - at ./compiler/rustc_middle/src/query/plumbing.rs:414:17 - 47: is_copy_modulo_regions - at ./compiler/rustc_middle/src/ty/util.rs:1243:48 - 48: next, alloc::vec::into_iter::IntoIter> - at ./compiler/rustc_ty_utils/src/needs_drop.rs:184:26 - 49: try_fold>, (), core::iter::traits::iterator::Iterator::find::check::{closure_env#0}, &mut rustc_ty_utils::needs_drop::filter_array_elements::{closure_env#0}>, core::ops::control_flow::ControlFlow, ()>> - at ./library/core/src/iter/traits/iterator.rs:2409:29 - 50: find>, &mut rustc_ty_utils::needs_drop::filter_array_elements::{closure_env#0}> - at ./library/core/src/iter/traits/iterator.rs:2880:9 - 51: next>, rustc_ty_utils::needs_drop::filter_array_elements::{closure_env#0}> - at ./library/core/src/iter/adapters/filter.rs:96:9 - 52: needs_drop_raw - at ./compiler/rustc_ty_utils/src/needs_drop.rs:24:15 - 53: {closure#0} - at ./compiler/rustc_query_impl/src/plumbing.rs:281:9 - [... omitted 22 frames ...] - 54: query_get_at, rustc_middle::query::erase::Erased<[u8; 1]>>> - at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 - 55: needs_drop_raw - at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 - 56: needs_drop_raw - at ./compiler/rustc_middle/src/query/plumbing.rs:414:17 - 57: needs_drop - at ./compiler/rustc_middle/src/ty/util.rs:1433:17 - 58: {closure#0} - at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:378:13 - 59: {closure#0}<(rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, rustc_mir_dataflow::elaborate_drops::{impl#2}::drop_ladder::{closure_env#0}> - at ./library/alloc/src/vec/mod.rs:1683:32 - 60: process_loop), alloc::alloc::Global, rustc_mir_dataflow::elaborate_drops::{impl#2}::drop_ladder::{closure_env#0}>, (rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, false> - at ./library/alloc/src/vec/mod.rs:1763:21 - 61: retain_mut<(rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, alloc::vec::{impl#1}::retain::{closure_env#0}<(rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, rustc_mir_dataflow::elaborate_drops::{impl#2}::drop_ladder::{closure_env#0}>> - at ./library/alloc/src/vec/mod.rs:1789:9 - 62: retain<(rustc_middle::mir::syntax::Place, core::option::Option<()>), alloc::alloc::Global, rustc_mir_dataflow::elaborate_drops::{impl#2}::drop_ladder::{closure_env#0}> - at ./library/alloc/src/vec/mod.rs:1683:9 - 63: drop_ladder - at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:377:9 - 64: open_drop_for_adt_contents - at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:488:13 - 65: {closure#0} - at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:461:13 - 66: open_drop_for_adt - at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:440:5 - 67: open_drop - at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:869:35 - 68: elaborate_drop - at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:253:31 - 69: rustc_mir_dataflow::elaborate_drops::elaborate_drop:: - at ./compiler/rustc_mir_dataflow/src/elaborate_drops.rs:192:5 - 70: build_drop_shim - at ./compiler/rustc_mir_transform/src/shim.rs:283:13 - 71: make_shim - at ./compiler/rustc_mir_transform/src/shim.rs:128:13 - 72: {closure#0} - at ./compiler/rustc_query_impl/src/plumbing.rs:281:9 - [... omitted 22 frames ...] - 73: query_get_at>> - at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 - 74: mir_shims - at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 - 75: mir_shims - at ./compiler/rustc_middle/src/query/plumbing.rs:414:17 - 76: instance_mir - at ./compiler/rustc_middle/src/ty/mod.rs:1738:62 - 77: try_instance_mir - at ./compiler/rustc_mir_transform/src/inline.rs:1082:8 - 78: try_inlining - at ./compiler/rustc_mir_transform/src/inline.rs:194:27 - 79: process_blocks - at ./compiler/rustc_mir_transform/src/inline.rs:139:19 - 80: inline - at ./compiler/rustc_mir_transform/src/inline.rs:97:5 - 81: run_pass - at ./compiler/rustc_mir_transform/src/inline.rs:62:12 - 82: run_passes_inner - at ./compiler/rustc_mir_transform/src/pass_manager.rs:144:17 - 83: rustc_mir_transform::pass_manager::run_passes - at ./compiler/rustc_mir_transform/src/pass_manager.rs:87:5 - 84: run_optimization_passes - at ./compiler/rustc_mir_transform/src/lib.rs:561:5 - 85: inner_optimized_mir - at ./compiler/rustc_mir_transform/src/lib.rs:667:5 - 86: optimized_mir - at ./compiler/rustc_mir_transform/src/lib.rs:630:21 - 87: {closure#0} - at ./compiler/rustc_query_impl/src/plumbing.rs:285:13 - [... omitted 22 frames ...] - 88: query_get_at>> - at ./compiler/rustc_middle/src/query/plumbing.rs:145:17 - 89: optimized_mir - at ./compiler/rustc_middle/src/query/plumbing.rs:423:31 - 90: optimized_mir - at ./compiler/rustc_middle/src/query/plumbing.rs:414:17 - 91: encode_mir - at ./compiler/rustc_metadata/src/rmeta/encoder.rs:1656:74 - 92: {closure#15} - at ./compiler/rustc_metadata/src/rmeta/encoder.rs:639:29 - 93: encode_crate_root - at ./compiler/rustc_metadata/src/rmeta/encoder.rs:600:27 - 94: encode_metadata - at ./compiler/rustc_metadata/src/rmeta/encoder.rs:2269:16 - 95: encode_and_write_metadata - at ./compiler/rustc_metadata/src/fs.rs:65:13 - 96: start_codegen - at ./compiler/rustc_interface/src/passes.rs:1024:44 - 97: {closure#0} - at ./compiler/rustc_interface/src/queries.rs:122:35 - 98: {closure#1}> - at ./compiler/rustc_middle/src/ty/context.rs:1288:37 - 99: {closure#0}>, core::result::Result> - at ./compiler/rustc_middle/src/ty/context/tls.rs:82:9 - 100: try_with, rustc_middle::ty::context::tls::enter_context::{closure_env#0}>, core::result::Result>, core::result::Result> - at ./library/std/src/thread/local.rs:283:12 - 101: with, rustc_middle::ty::context::tls::enter_context::{closure_env#0}>, core::result::Result>, core::result::Result> - at ./library/std/src/thread/local.rs:260:9 - 102: enter_context>, core::result::Result> - at ./compiler/rustc_middle/src/ty/context/tls.rs:79:5 - 103: enter> - at ./compiler/rustc_middle/src/ty/context.rs:1288:9 - 104: >::enter::, ::codegen_and_build_linker::{closure#0}> - at ./compiler/rustc_interface/src/queries.rs:64:9 - 105: codegen_and_build_linker - at ./compiler/rustc_interface/src/queries.rs:121:9 - 106: {closure#1} - at ./compiler/rustc_driver_impl/src/lib.rs:451:26 - 107: enter, rustc_span::ErrorGuaranteed>> - at ./compiler/rustc_interface/src/queries.rs:202:19 - 108: {closure#0} - at ./compiler/rustc_driver_impl/src/lib.rs:389:22 - 109: {closure#1}, rustc_driver_impl::run_compiler::{closure_env#0}> - at ./compiler/rustc_interface/src/interface.rs:502:27 - 110: {closure#0}, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>> - at ./compiler/rustc_interface/src/util.rs:154:13 - 111: {closure#0}, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>> - at ./compiler/rustc_interface/src/util.rs:106:21 - 112: set, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>> - at /home/michael/.cargo/registry/src/index.crates.io-6f17d22bba15001f/scoped-tls-1.0.1/src/lib.rs:137:9 - 113: create_session_globals_then, rustc_interface::util::run_in_thread_with_globals::{closure#0}::{closure#0}::{closure_env#0}, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>> - at ./compiler/rustc_span/src/lib.rs:134:5 - 114: {closure#0}, rustc_driver_impl::run_compiler::{closure_env#0}>, core::result::Result<(), rustc_span::ErrorGuaranteed>>, core::result::Result<(), rustc_span::ErrorGuaranteed>> - at ./compiler/rustc_interface/src/util.rs:105:17 -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 make sure that you have updated to the latest nightly - -note: rustc 1.81.0-dev running on x86_64-unknown-linux-gnu - -note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/home/michael/.cargo -Z ignore-directory-in-diagnostics-source-blocks=/home/michael/programming/rust2/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0 -Z inline-mir=yes --crate-type lib - -query stack during panic: -#0 [evaluate_obligation] evaluating trait selection obligation `[Dorp; M]: core::marker::Copy` -#1 [is_copy_raw] computing whether `[Dorp; M]` is `Copy` -#2 [needs_drop_raw] computing whether `[Dorp; M]` needs drop -#3 [mir_shims] generating MIR shim for `core::ptr::drop_in_place` -#4 [optimized_mir] optimizing MIR for `drop` -end of query stack