Skip to content

ICE with conservative_impl_trait #45690

Description

@YaLTeR
rustc 1.23.0-nightly (8b22e70b2 2017-10-31)
binary: rustc
commit-hash: 8b22e70b2de5152db3b0c53cfa16eb96b0b9e40e
commit-date: 2017-10-31
host: x86_64-unknown-linux-gnu
release: 1.23.0-nightly
LLVM version: 4.0

Somewhat minimal example.

Interestingly enough the error I'm getting in the actual project where I stumbled upon this is slightly different, here's a backtrace of that:

error: internal compiler error: unexpected panic

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.23.0-nightly (8b22e70b2 2017-10-31) running on x86_64-unknown-linux-gnu

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'assertion failed: match *region { ty::ReLateBound(..) => false, _ => true, }', /checkout/src/librustc/infer/higher_ranked/mod.rs:466:8
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:69
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:58
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:391
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:577
   5: std::panicking::begin_panic
   6: _ZN5rustc5infer13higher_ranked15fold_regions_in28_$u7b$$u7b$closure$u7d$$u7d$17h30f5524df740fa84E.llvm.630148A9
   7: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &'a mut F>::call_once
   8: <rustc_data_structures::accumulate_vec::AccumulateVec<A> as core::iter::traits::FromIterator<<A as rustc_data_structures::array_vec::Array>::Element>>::from_iter
   9: rustc::ty::fold::TypeFoldable::fold_with
  10: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_fold_with
  11: rustc::infer::InferCtxt::commit_if_ok
  12: rustc::infer::InferCtxt::match_poly_projection_predicate
  13: _ZN5rustc6traits7project27confirm_param_env_candidate17h06fc8c3394c685c7E.llvm.99C222EF
  14: _ZN5rustc6traits7project29opt_normalize_projection_type17haba371006e77bf1bE.llvm.99C222EF
  15: rustc::traits::project::project_and_unify_type
  16: rustc::infer::InferCtxt::commit_if_ok
  17: <rustc::traits::fulfill::FulfillProcessor<'a, 'b, 'gcx, 'tcx> as rustc_data_structures::obligation_forest::ObligationProcessor>::process_obligation
  18: <rustc_data_structures::obligation_forest::ObligationForest<O>>::process_obligations
  19: rustc::traits::fulfill::FulfillmentContext::select_where_possible
  20: rustc_typeck::check::FnCtxt::select_obligations_where_possible
  21: _ZN12rustc_typeck5check6FnCtxt35expected_inputs_for_expected_output17h47816a40ae27fe9dE.llvm.CA7E285C
  22: _ZN12rustc_typeck5check6FnCtxt27check_method_argument_types17hd792747dd1cbee99E.llvm.CA7E285C
  23: _ZN12rustc_typeck5check6FnCtxt15check_expr_kind17hed39f487d9109845E.llvm.CA7E285C
  24: _ZN12rustc_typeck5check6FnCtxt43check_expr_with_expectation_and_lvalue_pref17h76312c6992bfae9eE.llvm.CA7E285C
  25: _ZN12rustc_typeck5check6FnCtxt16check_decl_local17h4b2c05208ab7daadE.llvm.CA7E285C
  26: _ZN12rustc_typeck5check6FnCtxt25check_block_with_expected28_$u7b$$u7b$closure$u7d$$u7d$17hba43225a196e714eE.llvm.CA7E285C
  27: _ZN12rustc_typeck5check6FnCtxt25check_block_with_expected17hf53dea4009c5de1fE.llvm.CA7E285C
  28: _ZN12rustc_typeck5check6FnCtxt15check_expr_kind17hed39f487d9109845E.llvm.CA7E285C
  29: _ZN12rustc_typeck5check6FnCtxt43check_expr_with_expectation_and_lvalue_pref17h76312c6992bfae9eE.llvm.CA7E285C
  30: _ZN12rustc_typeck5check6FnCtxt17check_return_expr17h57dad756584b790cE.llvm.CA7E285C
  31: rustc_typeck::check::check_fn
  32: <std::thread::local::LocalKey<T>>::with
  33: rustc::ty::context::GlobalCtxt::enter_local
  34: _ZN12rustc_typeck5check16typeck_tables_of17hac67adeb3caf8538E.llvm.CA7E285C
  35: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::compute_result
  36: _ZN5rustc9dep_graph5graph8DepGraph14with_task_impl17h1ef644a010fa467cE.llvm.647F93AF
  37: rustc_errors::Handler::track_diagnostics
  38: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  39: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::force
  40: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  41: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  42: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::ensure
  43: rustc::session::Session::track_errors
  44: _ZN12rustc_typeck5check18typeck_item_bodies17h0abef6ddded349dbE.llvm.CA7E285C
  45: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::compute_result
  46: _ZN5rustc9dep_graph5graph8DepGraph14with_task_impl17h3c5118fe37d9feb7E.llvm.647F93AF
  47: rustc_errors::Handler::track_diagnostics
  48: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  49: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::force
  50: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  51: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  52: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  53: rustc::util::common::time
  54: rustc_typeck::check_crate
  55: <std::thread::local::LocalKey<T>>::with
  56: <std::thread::local::LocalKey<T>>::with
  57: rustc::ty::context::TyCtxt::create_and_enter
  58: rustc_driver::driver::compile_input
  59: rustc_driver::run_compiler

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions