Change:
Update: Reduced test case in Just got this rustc crash in running : Full Backtrace: <details2019-01-09T07:10:29.1359447Z error: internal compiler error: unexpected region in query response: 2019-01-09T07:10:29.1360436Z 2019-01-09T07:10:29.1361373Z thread 'rustc' panicked at 'Box<Any', 2019-01-09T07:10:29.1361759Z stack backtrace: 2019-01-09T07:10:29.3044175Z 0: 0x7faf81185633 - std::sys::unix::backtrace::tracing::imp::unwindbacktrace::h27fa36261e6c0e63 2019-01-09T07:10:29.3115220Z at 2019-01-09T07:10:29.3117735Z 1: 0x7faf8117dc98 - std::syscommon::backtrace::print::h83d70a6b41e54a96 2019-01-09T07:10:29.3119788Z at 2019-01-09T07:10:29.3123029Z 2: 0x7faf811817c2 - std::panicking::defaulthook::{{closure}}::h737fa74ccb8187d6 2019-01-09T07:10:29.3124252Z at 2019-01-09T07:10:29.3125927Z at 2019-01-09T07:10:29.3127692Z 3: 0x7faf81181534 - std::panicking::defaulthook::h95b33c1859e68c42 2019-01-09T07:10:29.3129344Z at 2019-01-09T07:10:29.3131572Z 4: 0x7faf7cc44fbf - rustc::util::common::panichook::hc3b5de1afa219d3e 2019-01-09T07:10:29.3133377Z 5: 0x7faf81181fa9 - std::panicking::rustpanicwithhook::h99028c1ffb70ec6c 2019-01-09T07:10:29.3136009Z at 2019-01-09T07:10:29.3139012Z 6: 0x7faf7ba5b54c - std::panicking::beginpanic::ha8fb39166559f6fc 2019-01-09T07:10:29.3142270Z 7: 0x7faf7ba7a2ee - rustcerrors::Handler::bug::h52124d7aeb9c7fd4 2019-01-09T07:10:29.3145394Z 8: 0x7faf7c97055e - rustc::util::bug::optspanbugfmt::{{closure}}::h2b9fc57d0a0effa1 2019-01-09T07:10:29.3148429Z 9: 0x7faf7c96e5a9 - rustc::ty::context::tls::withopt::{{closure}}::h876699748b23fd1a 2019-01-09T07:10:29.3151984Z 10: 0x7faf7c96e4c4 - rustc::ty::context::tls::withcontextopt::h08fd1b14b9b37bad 2019-01-09T07:10:29.3154978Z 11: 0x7faf7c96e556 - rustc::ty::context::tls::withopt::h031bc85f74c8b5f5 2019-01-09T07:10:29.3157599Z 12: 0x7faf7c970464 - rustc::util::bug::optspanbugfmt::h9ac97a87949dcc1f 2019-01-09T07:10:29.3161160Z 13: 0x7faf7c9703d6 - rustc::util::bug::bugfmt::ha46366496e812bc3 2019-01-09T07:10:29.3165421Z 14: 0x7faf7cdb2e9e - <rustc::infer::canonical::canonicalizer::CanonicalizeQueryResponse as rustc::infer::canonical::canonicalizer::CanonicalizeRegionMode::canonicalizefreeregion::hb20855203554b141 2019-01-09T07:10:29.3170834Z 15: 0x7faf804ae1e2 - <rustc::infer::canonical::canonicalizer::Canonicalizer<'cx, 'gcx, 'tcxas rustc::ty::fold::TypeFolder<'gcx, 'tcx::foldbinder::hc9c87ea23c310a6d 2019-01-09T07:10:29.3174012Z 16: 0x7faf804a3d3f - rustc::ty::fold::TypeFoldable::foldwith::h7e3b766f2010c13a 2019-01-09T07:10:29.3176837Z 17: 0x7faf804b6073 - rustc::infer::canonical::canonicalizer::Canonicalizer::canonicalize::h94c8b15ec82441c4 2019-01-09T07:10:29.3181331Z 18: 0x7faf8042a6d3 - rustc::infer::canonical::queryresponse::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx::makecanonicalizedqueryresponse::h5fd5664469b4f467 2019-01-09T07:10:29.3184298Z 19: 0x7faf80492cd7 - rustc::ty::context::GlobalCtxt::enterlocal::h1f55605a2fa570c8 2019-01-09T07:10:29.3187081Z 20: 0x7faf804c5ae2 - rustctraits::typeop::typeopprovepredicate::hac79da90828ae7f1 2019-01-09T07:10:29.3190930Z 21: 0x7faf7c73670f - rustc::ty::query::querycompute::typeopprovepredicate::h7882d718114c6595 2019-01-09T07:10:29.3195724Z 22: 0x7faf7cb9d510 - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::typeopprovepredicate<'tcx::compute::ha0a22e439c583e0c 2019-01-09T07:10:29.3198480Z 23: 0x7faf7c81be7d - rustc::depgraph::graph::DepGraph::withtaskimpl::hfa60f5e02294bab2 2019-01-09T07:10:29.3203489Z 24: 0x7faf7c9c8cf2 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h1f97e191d0c8020c 2019-01-09T07:10:29.3207571Z 25: 0x7faf7c964b41 - <rustc::traits::query::typeop::provepredicate::ProvePredicate<'tcxas rustc::traits::query::typeop::QueryTypeOp<'gcx, 'tcx::performquery::h14af7bf1a4623951 2019-01-09T07:10:29.3211249Z 26: 0x7faf7d6960cf - rustc::traits::query::typeop::QueryTypeOp::fullyperforminto::h872744c4a3994a98 2019-01-09T07:10:29.3215748Z 27: 0x7faf7d824537 - <rustc::ty::ParamEnvAnd<'tcx, Qas rustc::traits::query::typeop::TypeOp<'gcx, 'tcx::fullyperform::h3e366726f127bd41 2019-01-09T07:10:29.3219338Z 28: 0x7faf7d6ab75c - rustcmir::borrowcheck::nll::typecheck::TypeChecker::provepredicate::hb7ef6ce272275f2e 2019-01-09T07:10:29.3222696Z 29: 0x7faf7d6aa2ce - rustcmir::borrowcheck::nll::typecheck::TypeChecker::checkstmt::h1ee6c6f7393dbb48 2019-01-09T07:10:29.3225633Z 30: 0x7faf7d6abc6c - rustcmir::borrowcheck::nll::typecheck::TypeChecker::typeckmir::h29dbb0a4198dfa55 2019-01-09T07:10:29.3229142Z 31: 0x7faf7d6a1dd2 - rustcmir::borrowcheck::nll::typecheck::typecheckinternal::hffa4ef19a1580b02 2019-01-09T07:10:29.3232380Z 32: 0x7faf7d616bda - rustc::ty::context::GlobalCtxt::enterlocal::h2a8d3ec35b4f82ce 2019-01-09T07:10:29.3235610Z 33: 0x7faf7d6af97b - <rustcmir::borrowcheck::nll::typecheck::TypeckMir as rustcmir::transform::MirPass::runpass::h2f175b6bc17f76c6 2019-01-09T07:10:29.3239999Z 34: 0x7faf7d70621a - rustcmir::transform::runpasses::{{closure}}::h519bb7163684e841 2019-01-09T07:10:29.3243916Z 35: 0x7faf7d705ed9 - rustcmir::transform::runpasses::ha3cc06ce83f98300 2019-01-09T07:10:29.3248221Z 36: 0x7faf7d706603 - rustcmir::transform::mirconst::he9f9e4792f0fd52c 2019-01-09T07:10:29.3252418Z 37: 0x7faf7d7c25bc - rustc::ty::query::querycompute::mirconst::h4a18e1bad2c2cd20 2019-01-09T07:10:29.3257572Z 38: 0x7faf7d588a9c - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirconst<'tcx::compute::h11b8ce581ca21481 2019-01-09T07:10:29.3261743Z 39: 0x7faf7d8c7333 - rustc::depgraph::graph::DepGraph::withtaskimpl::hc2d1738bc17dffea 2019-01-09T07:10:29.3266580Z 40: 0x7faf7d5c3937 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h8be6d20eace6785b 2019-01-09T07:10:29.3275198Z 41: 0x7faf7d70681d - rustcmir::transform::mirvalidated::hf49c21f9e6f17ece 2019-01-09T07:10:29.3282827Z 42: 0x7faf7d7bfd3c - rustc::ty::query::querycompute::mirvalidated::h134b798c5daffd05 2019-01-09T07:10:29.3287818Z 43: 0x7faf7d588cec - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirvalidated<'tcx::compute::h35a85da1fde27e28 2019-01-09T07:10:29.3292236Z 44: 0x7faf7d8c7333 - rustc::depgraph::graph::DepGraph::withtaskimpl::hc2d1738bc17dffea 2019-01-09T07:10:29.3296618Z 45: 0x7faf7d5e08a7 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::haa63274f42abed8b 2019-01-09T07:10:29.3300480Z 46: 0x7faf7d80e484 - rustcmir::borrowcheck::mirborrowck::h9ccb54a927514fa9 2019-01-09T07:10:29.3304384Z 47: 0x7faf7d7bfb43 - rustc::ty::query::querycompute::mirborrowck::hc72c7cdf2f3ee3df 2019-01-09T07:10:29.3310471Z 48: 0x7faf7d588c94 - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirborrowck<'tcx::compute::h671d21d87040d722 2019-01-09T07:10:29.3314354Z 49: 0x7faf7d8cab20 - rustc::depgraph::graph::DepGraph::withtaskimpl::hf50fbb2327d62dfd 2019-01-09T07:10:29.3319379Z 50: 0x7faf7d5f1266 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::hd2829b231b0df250 2019-01-09T07:10:29.3323594Z 51: 0x7faf7d6a7d8f - rustcmir::borrowcheck::nll::typecheck::TypeChecker::checkstmt::h1ee6c6f7393dbb48 2019-01-09T07:10:29.3327074Z 52: 0x7faf7d6abc6c - rustcmir::borrowcheck::nll::typecheck::TypeChecker::typeckmir::h29dbb0a4198dfa55 2019-01-09T07:10:29.3331189Z 53: 0x7faf7d6a1dd2 - rustcmir::borrowcheck::nll::typecheck::typecheckinternal::hffa4ef19a1580b02 2019-01-09T07:10:29.3335299Z 54: 0x7faf7d616bda - rustc::ty::context::GlobalCtxt::enterlocal::h2a8d3ec35b4f82ce 2019-01-09T07:10:29.3340076Z 55: 0x7faf7d6af97b - <rustcmir::borrowcheck::nll::typecheck::TypeckMir as rustcmir::transform::MirPass::runpass::h2f175b6bc17f76c6 2019-01-09T07:10:29.3344116Z 56: 0x7faf7d70621a - rustcmir::transform::runpasses::{{closure}}::h519bb7163684e841 2019-01-09T07:10:29.3347311Z 57: 0x7faf7d705ed9 - rustcmir::transform::runpasses::ha3cc06ce83f98300 2019-01-09T07:10:29.3351202Z 58: 0x7faf7d706603 - rustcmir::transform::mirconst::he9f9e4792f0fd52c 2019-01-09T07:10:29.3354882Z 59: 0x7faf7d7c25bc - rustc::ty::query::querycompute::mirconst::h4a18e1bad2c2cd20 2019-01-09T07:10:29.3359821Z 60: 0x7faf7d588a9c - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirconst<'tcx::compute::h11b8ce581ca21481 2019-01-09T07:10:29.3363068Z 61: 0x7faf7d8c7333 - rustc::depgraph::graph::DepGraph::withtaskimpl::hc2d1738bc17dffea 2019-01-09T07:10:29.3366918Z 62: 0x7faf7d5c3937 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h8be6d20eace6785b 2019-01-09T07:10:29.3370839Z 63: 0x7faf7d70681d - rustcmir::transform::mirvalidated::hf49c21f9e6f17ece 2019-01-09T07:10:29.3373993Z 64: 0x7faf7d7bfd3c - rustc::ty::query::querycompute::mirvalidated::h134b798c5daffd05 2019-01-09T07:10:29.3378121Z 65: 0x7faf7d588cec - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirvalidated<'tcx::compute::h35a85da1fde27e28 2019-01-09T07:10:29.3381634Z 66: 0x7faf7d8c7333 - rustc::depgraph::graph::DepGraph::withtaskimpl::hc2d1738bc17dffea 2019-01-09T07:10:29.3385804Z 67: 0x7faf7d5e08a7 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::haa63274f42abed8b 2019-01-09T07:10:29.3388374Z 68: 0x7faf7d80e484 - rustcmir::borrowcheck::mirborrowck::h9ccb54a927514fa9 2019-01-09T07:10:29.3391777Z 69: 0x7faf7d7bfb43 - rustc::ty::query::querycompute::mirborrowck::hc72c7cdf2f3ee3df 2019-01-09T07:10:29.3396214Z 70: 0x7faf7d588c94 - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirborrowck<'tcx::compute::h671d21d87040d722 2019-01-09T07:10:29.3399705Z 71: 0x7faf7d8cab20 - rustc::depgraph::graph::DepGraph::withtaskimpl::hf50fbb2327d62dfd 2019-01-09T07:10:29.3404136Z 72: 0x7faf7d5f1266 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::hd2829b231b0df250 2019-01-09T07:10:29.3407046Z 73: 0x7faf7d6a7d8f - rustcmir::borrowcheck::nll::typecheck::TypeChecker::checkstmt::h1ee6c6f7393dbb48 2019-01-09T07:10:29.3410534Z 74: 0x7faf7d6abc6c - rustcmir::borrowcheck::nll::typecheck::TypeChecker::typeckmir::h29dbb0a4198dfa55 2019-01-09T07:10:29.3413827Z 75: 0x7faf7d6a1dd2 - rustcmir::borrowcheck::nll::typecheck::typecheckinternal::hffa4ef19a1580b02 2019-01-09T07:10:29.3417156Z 76: 0x7faf7d616bda - rustc::ty::context::GlobalCtxt::enterlocal::h2a8d3ec35b4f82ce 2019-01-09T07:10:29.3421291Z 77: 0x7faf7d6af97b - <rustcmir::borrowcheck::nll::typecheck::TypeckMir as rustcmir::transform::MirPass::runpass::h2f175b6bc17f76c6 2019-01-09T07:10:29.3424836Z 78: 0x7faf7d70621a - rustcmir::transform::runpasses::{{closure}}::h519bb7163684e841 2019-01-09T07:10:29.3427813Z 79: 0x7faf7d705ed9 - rustcmir::transform::runpasses::ha3cc06ce83f98300 2019-01-09T07:10:29.3431430Z 80: 0x7faf7d706603 - rustcmir::transform::mirconst::he9f9e4792f0fd52c 2019-01-09T07:10:29.3434507Z 81: 0x7faf7d7c25bc - rustc::ty::query::querycompute::mirconst::h4a18e1bad2c2cd20 2019-01-09T07:10:29.3439380Z 82: 0x7faf7d588a9c - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirconst<'tcx::compute::h11b8ce581ca21481 2019-01-09T07:10:29.3442924Z 83: 0x7faf7d8c7333 - rustc::depgraph::graph::DepGraph::withtaskimpl::hc2d1738bc17dffea 2019-01-09T07:10:29.3447408Z 84: 0x7faf7d5c3937 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h8be6d20eace6785b 2019-01-09T07:10:29.3451213Z 85: 0x7faf7d70681d - rustcmir::transform::mirvalidated::hf49c21f9e6f17ece 2019-01-09T07:10:29.3455845Z 86: 0x7faf7cb9bfac - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirvalidated<'tcx::compute::h35a85da1fde27e28 2019-01-09T07:10:29.3459226Z 87: 0x7faf7c7e82f6 - rustc::depgraph::graph::DepGraph::withtaskimpl::h3b820c9594b2cec0 2019-01-09T07:10:29.3463568Z 88: 0x7faf7c9b1a7b - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h115c183808c121a5 2019-01-09T07:10:29.3467590Z 89: 0x7faf7caf16dc - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::ensurequery::h1eb3b1bdb1673ac8 2019-01-09T07:10:29.3471028Z 90: 0x7faf7ddb3bc5 - rustcborrowck::borrowck::borrowck::hfe7e7029a4f8860a 2019-01-09T07:10:29.3474346Z 91: 0x7faf7dd833cc - rustc::ty::query::querycompute::borrowck::hd756d7f12d24fe3c 2019-01-09T07:10:29.3479197Z 92: 0x7faf7dd8d37c - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::borrowck<'tcx::compute::h9fdf8c53c24da732 2019-01-09T07:10:29.3482921Z 93: 0x7faf7dd85aab - rustc::depgraph::graph::DepGraph::withtaskimpl::h835f89accfc9d52d 2019-01-09T07:10:29.3487496Z 94: 0x7faf7dd8f9d4 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h20bbb6fc8beccebc 2019-01-09T07:10:29.3504076Z 95: 0x7faf7dd98381 - rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::parbodyowners::h39e78c11d92c15e8 2019-01-09T07:10:29.3509043Z 96: 0x7faf7ddb3977 - rustcborrowck::borrowck::checkcrate::hbede2c1b6a8ef496 2019-01-09T07:10:29.3511820Z 97: 0x7faf814e7f81 - rustc::util::common::time::haff8156274509ff5 2019-01-09T07:10:29.3514171Z 98: 0x7faf8152e485 - <std::thread::local::LocalKey<T::with::ha529ac533f89a17f 2019-01-09T07:10:29.3516396Z 99: 0x7faf814edb46 - rustcdriver::driver::compileinput::had70b272120da9cf 2019-01-09T07:10:29.3518224Z query stack during panic: 2019-01-09T07:10:29.3521356Z [typeopprovepredicate] evaluating 2019-01-09T07:10:29.3523696Z [mirconst] processing 2019-01-09T07:10:29.3525416Z [mirvalidated] processing 2019-01-09T07:10:29.3527141Z [mirborrowck] processing 2019-01-09T07:10:29.3529430Z [mirconst] processing 2019-01-09T07:10:29.3531436Z [mirvalidated] processing 2019-01-09T07:10:29.3533438Z [mirborrowck] processing 2019-01-09T07:10:29.3535150Z [mirconst] processing 2019-01-09T07:10:29.3536845Z [mirvalidated] processing 2019-01-09T07:10:29.3539025Z [borrowck] processing 2019-01-09T07:10:29.3540875Z end of query stack 2019-01-09T07:10:29.3581342Z error: aborting due to previous error 2019-01-09T07:10:29.3583496Z 2019-01-09T07:10:29.3628291Z 2019-01-09T07:10:29.3630438Z note: the compiler unexpectedly panicked. this is a bug. 2019-01-09T07:10:29.3630666Z 2019-01-09T07:10:29.3631276Z note: we would appreciate a bug report: 2019-01-09T07:10:29.3631460Z 2019-01-09T07:10:29.3631907Z note: rustc 1.33.0-nightly ( 2019-01-08) running on x8664-unknown-linux-gnu 2019-01-09T07:10:29.3632241Z 2019-01-09T07:10:29.3632577Z note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin 2019-01-09T07:10:29.3632771Z 2019-01-09T07:10:29.3632983Z note: some of the compiler flags provided by cargo are hidden 2019-01-09T07:10:29.3633054Z 2019-01-09T07:10:29.3667450Z error: Could not compile . 2019-01-09T07:10:29.3667734Z 2019-01-09T07:10:29.3667928Z Caused by: 2019-01-09T07:10:29.3670723Z process didn't exit successfully: (exit code: 101) 2019-01-09T07:10:29.3671404Z warning: build failed, waiting for other jobs to finish... 2019-01-09T07:10:29.4097253Z error: internal compiler error: unexpected region in query response: 2019-01-09T07:10:29.4098388Z 2019-01-09T07:10:29.4099563Z thread 'rustc' panicked at 'Box<Any', 2019-01-09T07:10:29.4099927Z stack backtrace: 2019-01-09T07:10:29.5720141Z 0: 0x7fc92e77a633 - std::sys::unix::backtrace::tracing::imp::unwindbacktrace::h27fa36261e6c0e63 2019-01-09T07:10:29.5808741Z at 2019-01-09T07:10:29.5810340Z 1: 0x7fc92e772c98 - std::syscommon::backtrace::print::h83d70a6b41e54a96 2019-01-09T07:10:29.5813335Z at 2019-01-09T07:10:29.5814094Z 2: 0x7fc92e7767c2 - std::panicking::defaulthook::{{closure}}::h737fa74ccb8187d6 2019-01-09T07:10:29.5816364Z at 2019-01-09T07:10:29.5820203Z at 2019-01-09T07:10:29.5822572Z 3: 0x7fc92e776534 - std::panicking::defaulthook::h95b33c1859e68c42 2019-01-09T07:10:29.5825233Z at 2019-01-09T07:10:29.5826981Z 4: 0x7fc92a239fbf - rustc::util::common::panichook::hc3b5de1afa219d3e 2019-01-09T07:10:29.5827746Z 5: 0x7fc92e776fa9 - std::panicking::rustpanicwithhook::h99028c1ffb70ec6c 2019-01-09T07:10:29.5828015Z at 2019-01-09T07:10:29.5828880Z 6: 0x7fc92905054c - std::panicking::beginpanic::ha8fb39166559f6fc 2019-01-09T07:10:29.5829529Z 7: 0x7fc92906f2ee - rustcerrors::Handler::bug::h52124d7aeb9c7fd4 2019-01-09T07:10:29.5830056Z 8: 0x7fc929f6555e - rustc::util::bug::optspanbugfmt::{{closure}}::h2b9fc57d0a0effa1 2019-01-09T07:10:29.5830570Z 9: 0x7fc929f635a9 - rustc::ty::context::tls::withopt::{{closure}}::h876699748b23fd1a 2019-01-09T07:10:29.5831149Z 10: 0x7fc929f634c4 - rustc::ty::context::tls::withcontextopt::h08fd1b14b9b37bad 2019-01-09T07:10:29.5831649Z 11: 0x7fc929f63556 - rustc::ty::context::tls::withopt::h031bc85f74c8b5f5 2019-01-09T07:10:29.5832281Z 12: 0x7fc929f65464 - rustc::util::bug::optspanbugfmt::h9ac97a87949dcc1f 2019-01-09T07:10:29.5832750Z 13: 0x7fc929f653d6 - rustc::util::bug::bugfmt::ha46366496e812bc3 2019-01-09T07:10:29.5833326Z 14: 0x7fc92a3a7e9e - <rustc::infer::canonical::canonicalizer::CanonicalizeQueryResponse as rustc::infer::canonical::canonicalizer::CanonicalizeRegionMode::canonicalizefreeregion::hb20855203554b141 2019-01-09T07:10:29.5833919Z 15: 0x7fc92daa31e2 - <rustc::infer::canonical::canonicalizer::Canonicalizer<'cx, 'gcx, 'tcxas rustc::ty::fold::TypeFolder<'gcx, 'tcx::foldbinder::hc9c87ea23c310a6d 2019-01-09T07:10:29.5834408Z 16: 0x7fc92da98d3f - rustc::ty::fold::TypeFoldable::foldwith::h7e3b766f2010c13a 2019-01-09T07:10:29.5834968Z 17: 0x7fc92daab073 - rustc::infer::canonical::canonicalizer::Canonicalizer::canonicalize::h94c8b15ec82441c4 2019-01-09T07:10:29.5835515Z 18: 0x7fc92da1f6d3 - rustc::infer::canonical::queryresponse::<impl rustc::infer::InferCtxt<'cx, 'gcx, 'tcx::makecanonicalizedqueryresponse::h5fd5664469b4f467 2019-01-09T07:10:29.5836048Z 19: 0x7fc92da87cd7 - rustc::ty::context::GlobalCtxt::enterlocal::h1f55605a2fa570c8 2019-01-09T07:10:29.5836530Z 20: 0x7fc92dabaae2 - rustctraits::typeop::typeopprovepredicate::hac79da90828ae7f1 2019-01-09T07:10:29.5837040Z 21: 0x7fc929d2b70f - rustc::ty::query::querycompute::typeopprovepredicate::h7882d718114c6595 2019-01-09T07:10:29.5837623Z 22: 0x7fc92a192510 - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::typeopprovepredicate<'tcx::compute::ha0a22e439c583e0c 2019-01-09T07:10:29.5838117Z 23: 0x7fc929e10e7d - rustc::depgraph::graph::DepGraph::withtaskimpl::hfa60f5e02294bab2 2019-01-09T07:10:29.5839497Z 24: 0x7fc929fbdcf2 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h1f97e191d0c8020c 2019-01-09T07:10:29.5840159Z 25: 0x7fc929f59b41 - <rustc::traits::query::typeop::provepredicate::ProvePredicate<'tcxas rustc::traits::query::typeop::QueryTypeOp<'gcx, 'tcx::performquery::h14af7bf1a4623951 2019-01-09T07:10:29.5840914Z 26: 0x7fc92ac8b0cf - rustc::traits::query::typeop::QueryTypeOp::fullyperforminto::h872744c4a3994a98 2019-01-09T07:10:29.5841494Z 27: 0x7fc92ae19537 - <rustc::ty::ParamEnvAnd<'tcx, Qas rustc::traits::query::typeop::TypeOp<'gcx, 'tcx::fullyperform::h3e366726f127bd41 2019-01-09T07:10:29.5842067Z 28: 0x7fc92aca075c - rustcmir::borrowcheck::nll::typecheck::TypeChecker::provepredicate::hb7ef6ce272275f2e 2019-01-09T07:10:29.5842848Z 29: 0x7fc92aca05c0 - rustcmir::borrowcheck::nll::typecheck::TypeChecker::normalizeandproveinstantiatedpredicates::h255e9fb239711ae2 2019-01-09T07:10:29.5843649Z 30: 0x7fc92ac970de - <rustcmir::borrowcheck::nll::typecheck::TypeVerifier<'a, 'b, 'gcx, 'tcxas rustc::mir::visit::Visitor<'tcx::visitconstant::h7187d25a2e406efd 2019-01-09T07:10:29.5844157Z 31: 0x7fc92ac98217 - <rustcmir::borrowcheck::nll::typecheck::TypeVerifier<'a, 'b, 'gcx, 'tcxas rustc::mir::visit::Visitor<'tcx::visitmir::ha0c0ad5513e2672a 2019-01-09T07:10:29.5844600Z 32: 0x7fc92ac96dbe - rustcmir::borrowcheck::nll::typecheck::typecheckinternal::hffa4ef19a1580b02 2019-01-09T07:10:29.5844988Z 33: 0x7fc92ac0bbda - rustc::ty::context::GlobalCtxt::enterlocal::h2a8d3ec35b4f82ce 2019-01-09T07:10:29.5845446Z 34: 0x7fc92aca497b - <rustcmir::borrowcheck::nll::typecheck::TypeckMir as rustcmir::transform::MirPass::runpass::h2f175b6bc17f76c6 2019-01-09T07:10:29.5845833Z 35: 0x7fc92acfb21a - rustcmir::transform::runpasses::{{closure}}::h519bb7163684e841 2019-01-09T07:10:29.5846221Z 36: 0x7fc92acfaed9 - rustcmir::transform::runpasses::ha3cc06ce83f98300 2019-01-09T07:10:29.5846616Z 37: 0x7fc92acfb603 - rustcmir::transform::mirconst::he9f9e4792f0fd52c 2019-01-09T07:10:29.5846996Z 38: 0x7fc92adb75bc - rustc::ty::query::querycompute::mirconst::h4a18e1bad2c2cd20 2019-01-09T07:10:29.5847556Z 39: 0x7fc92ab7da9c - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirconst<'tcx::compute::h11b8ce581ca21481 2019-01-09T07:10:29.5847963Z 40: 0x7fc92aebc333 - rustc::depgraph::graph::DepGraph::withtaskimpl::hc2d1738bc17dffea 2019-01-09T07:10:29.5848975Z 41: 0x7fc92abb8937 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h8be6d20eace6785b 2019-01-09T07:10:29.5849529Z 42: 0x7fc92acfb81d - rustcmir::transform::mirvalidated::hf49c21f9e6f17ece 2019-01-09T07:10:29.5850035Z 43: 0x7fc92a190fac - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::mirvalidated<'tcx::compute::h35a85da1fde27e28 2019-01-09T07:10:29.5850513Z 44: 0x7fc929ddd2f6 - rustc::depgraph::graph::DepGraph::withtaskimpl::h3b820c9594b2cec0 2019-01-09T07:10:29.5850966Z 45: 0x7fc929fa6a7b - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h115c183808c121a5 2019-01-09T07:10:29.5851446Z 46: 0x7fc92a0e66dc - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::ensurequery::h1eb3b1bdb1673ac8 2019-01-09T07:10:29.5851970Z 47: 0x7fc92b3a8bc5 - rustcborrowck::borrowck::borrowck::hfe7e7029a4f8860a 2019-01-09T07:10:29.5852365Z 48: 0x7fc92b3783cc - rustc::ty::query::querycompute::borrowck::hd756d7f12d24fe3c 2019-01-09T07:10:29.5852821Z 49: 0x7fc92b38237c - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcxfor rustc::ty::query::queries::borrowck<'tcx::compute::h9fdf8c53c24da732 2019-01-09T07:10:29.5853214Z 50: 0x7fc92b37aaab - rustc::depgraph::graph::DepGraph::withtaskimpl::h835f89accfc9d52d 2019-01-09T07:10:29.5853854Z 51: 0x7fc92b3849d4 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::trygetwith::h20bbb6fc8beccebc 2019-01-09T07:10:29.5854283Z 52: 0x7fc92b38d381 - rustc::ty::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx::parbodyowners::h39e78c11d92c15e8 2019-01-09T07:10:29.5854683Z 53: 0x7fc92b3a8977 - rustcborrowck::borrowck::checkcrate::hbede2c1b6a8ef496 2019-01-09T07:10:29.5855045Z 54: 0x7fc92eadcf81 - rustc::util::common::time::haff8156274509ff5 2019-01-09T07:10:29.5855423Z 55: 0x7fc92eb23485 - <std::thread::local::LocalKey<T::with::ha529ac533f89a17f 2019-01-09T07:10:29.5855815Z 56: 0x7fc92eae2b46 - rustcdriver::driver::compileinput::had70b272120da9cf 2019-01-09T07:10:29.5856185Z 57: 0x7fc92ea6fbf0 - rustcdriver::runcompilerwithpool::h9a09586d390d81f7 2019-01-09T07:10:29.5856579Z 58: 0x7fc92ea7ac95 - <scopedtls::ScopedKey<T::set::hde29fd112e350f04 2019-01-09T07:10:29.5857109Z 59: 0x7fc92ea6ea3a - rustcdriver::runcompiler::ha251c7865eed2337 2019-01-09T07:10:29.5857485Z 60: 0x7fc92ea7ae4a - <scopedtls::ScopedKey<T::set::hfc0ece120fe30385 2019-01-09T07:10:29.5857905Z 61: 0x7fc92eb4bc52 - std::syscommon::backtrace::rustbeginshortbacktrace::h7bafd171c84cd5b6 2019-01-09T07:10:29.5858256Z 62: 0x7fc92e788539 - rustmaybecatchpanic 2019-01-09T07:10:29.5858802Z at 2019-01-09T07:10:29.5859333Z 63: 0x7fc92eb56ff0 - <F as alloc::boxed::FnBox<A::callbox::h89839b7683f86c15 2019-01-09T07:10:29.5859755Z 64: 0x7fc92e78731d - std::sys::unix::thread::Thread::new::threadstart::hf3d97e1814c21dcd 2019-01-09T07:10:29.5859954Z at 2019-01-09T07:10:29.5860096Z at 2019-01-09T07:10:29.5860274Z at 2019-01-09T07:10:29.5860627Z 65: 0x7fc92e4fc6b9 - startthread 2019-01-09T07:10:29.5860980Z 66: 0x7fc92de2641c - clone 2019-01-09T07:10:29.5861344Z 67: 0x0 - <unknown2019-01-09T07:10:29.5861508Z query stack during panic: 2019-01-09T07:10:29.5863064Z [typeopprovepredicate] evaluating 2019-01-09T07:10:29.5863415Z [mirconst] processing 2019-01-09T07:10:29.5863552Z [mirvalidated] processing 2019-01-09T07:10:29.5863710Z [borrowck] processing 2019-01-09T07:10:29.5863864Z end of query stack 2019-01-09T07:10:29.5898930Z error: aborting due to previous error 2019-01-09T07:10:29.5899185Z 2019-01-09T07:10:29.5949635Z 2019-01-09T07:10:29.5950076Z note: the compiler unexpectedly panicked. this is a bug. 2019-01-09T07:10:29.5950277Z 2019-01-09T07:10:29.5951163Z note: we would appreciate a bug report: 2019-01-09T07:10:29.5952442Z 2019-01-09T07:10:29.5952924Z note: rustc 1.33.0-nightly ( 2019-01-08) running on x8664-unknown-linux-gnu 2019-01-09T07:10:29.5952971Z 2019-01-09T07:10:29.5953221Z note: compiler flags: -C debuginfo=2 -C incremental 2019-01-09T07:10:29.5953260Z 2019-01-09T07:10:29.5953331Z note: some of the compiler flags provided by cargo are hidden 2019-01-09T07:10:29.5953367Z 2019-01-09T07:10:29.6146618Z error: Could not compile . 2019-01-09T07:10:29.6146725Z 2019-01-09T07:10:29.6146778Z Caused by: 2019-01-09T07:10:29.6149419Z process didn't exit successfully: (exit code: 101) </details
Works fine with stable and , fails with and later. Steps to repro: bash git clone ; cd juniper/juniper_hyper; cargo test;
I bisected: So the regression was caused by
Which was this PR: /cc
triage: P-high. assigning to self for initial investigation.
thanks for bisecting
friendly ping since this is now a .
I have narrowed this down to a single file test case that depends solely on , which means we can at least demo on the playpen. Code ():
(my planned next step is to remove the dependence on the crate, so that we can really dive in from the viewpoint of itself without worrying about that other code.)
Okay I've now reduced it to a single file that only depends on . Code (): Its pretty hard to reduce it past this point though. There's a lot of inter-depedencies; I assume the bug is arising from some nasty interactions between normalizing the various associated items above along with the (and of course the lifetime introduced by the borrow in the closure). But in any case a standalone file gives us a much better place to work from now.
There is a comment above the ICE in question: Looking at the RUST_LOG output here, I wonder if there are any obvious counter-examples to that claim that we should never see any names apart from or . In particular, I see: Does the presence of that constraint provide a hint as to how not-exactly-named regions are leaking into the canonicalization... (or maybe we should be cleaning out such regions before they leak out into the itself...)
Note that this bug remains open because even thought PR side-steps the problem under AST-borrowck, it still arises under NLL and the 2018 edition. (The play link still works since 2018 is the default.)
Update: I have a generalization of PR that fixes this with and without NLL. Update 2: The aforementioned generalization has been posted as PR
With the latest nightly I now get: Which seems suspect as the first fix for this was adding . Config: Will that be fixed with the newest PR?
Self contained example that still ICEs with AST borrowck on nightly:
A smaller case:
(I've closed PR since found cases that it did not address. I will attempt to look into the root problem.)
Hi, Will a 'fix release' land on stable ? I really need this fix to compile an project on stable (which compiles on nightly).
I don't think anyone felt the bug was widespread enough to justify a backport of PR to the beta/stable channels. Or at least, no one nominated it for such. PR landed on nightly 13 days ago, and the beta-stable and nightly-beta rollovers will occur next week. We do not have enough time between now and next week to backport PR to beta before the beta-stable rollover. But I also don't want to dismiss the idea of trying to get the fix backported all the way to the stable channel. (I don't think a backport is terribly likely, but the team should at least discuss it at the meeting next Thursday.) I'll go ahead and nominate PR for the backport.
I'm voicing my support for backporting to beta. This has broken for many months on stable. With a beta backport at least it will be fixed quite a bit earlier.
thank you for the explanation! If I understand correctly, if is not backported to beta during the next week, we will not have the fix on stable at least before ? (sorry I'm new to Rust release system)

Discussion:
<ins> use rustc_data_structures::fx::FxHashMap; use syntax_pos::Span; </ins> use crate::hir::def_id::DefId; use crate::hir; use crate::hir::Node; use crate::infer::{self, InferCtxt, InferOk, TypeVariableOrigin}; use crate::infer::outlives::free_region_map::FreeRegionRelations; <del> use rustc_data_structures::fx::FxHashMap; </del> use crate::traits::{self, PredicateObligation}; use crate::ty::{self, Ty, TyCtxt, GenericParamDefKind}; <del> use crate::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder}; use crate::ty::outlives::Component; </del> <ins> use crate::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder, TypeVisitor}; </ins> use crate::ty::subst::{Kind, InternalSubsts, SubstsRef, UnpackedKind}; use crate::util::nodemap::DefIdMap;

let least_region = least_region.unwrap_or(self.tcx.lifetimes.re_static); debug!("constrain_opaque_types: least_region={:?}", least_region); <del> // Require that the type `concrete_ty` outlives // `least_region`, modulo any type parameters that appear // in the type, which we ignore. This is because impl // trait values are assumed to capture all the in-scope // type parameters. This little loop here just invokes // `outlives` repeatedly, draining all the nested // obligations that result. let mut types = vec![concrete_ty]; let bound_region = |r| self.sub_regions(infer::CallReturn(span), least_region, r); while let Some(ty) = types.pop() { let mut components = smallvec![]; self.tcx.push_outlives_components(ty, &mut components); while let Some(component) = components.pop() { match component { Component::Region(r) => { bound_region(r); } Component::Param(_) => { // ignore type parameters like `T`, they are captured // implicitly by the `impl Trait` } Component::UnresolvedInferenceVariable(_) => { // we should get an error that more type // annotations are needed in this case self.tcx .sess .delay_span_bug(span, "unresolved inf var in opaque"); } Component::Projection(ty::ProjectionTy { substs, item_def_id: _, }) => { for k in substs { match k.unpack() { UnpackedKind::Lifetime(lt) => bound_region(lt), UnpackedKind::Type(ty) => types.push(ty), UnpackedKind::Const(_) => { // Const parameters don't impose constraints. } } } } Component::EscapingProjection(more_components) => { components.extend(more_components); } } } } </del> <ins> concrete_ty.visit_with(&mut OpaqueTypeOutlivesVisitor { infcx: self, least_region, span, }); </ins> } /// Given the fully resolved, instantiated type for an opaque

} } <ins> // Visitor that requires that (almost) all regions in the type visited outlive // `least_region`. We cannot use `push_outlives_components` because regions in // closure signatures are not included in their outlives components. We need to // ensure all regions outlive the given bound so that we don't end up with, // say, `ReScope` appearing in a return type and causing ICEs when other // functions end up with region constraints involving regions from other // functions. // // We also cannot use `for_each_free_region` because for closures it includes // the regions parameters from the enclosing item. // // We ignore any type parameters because impl trait values are assumed to // capture all the in-scope type parameters. struct OpaqueTypeOutlivesVisitor<'a, 'gcx, 'tcx> { infcx: &'a InferCtxt<'a, 'gcx, 'tcx>, least_region: ty::Region<'tcx>, span: Span, } impl<'tcx> TypeVisitor<'tcx> for OpaqueTypeOutlivesVisitor<'_, '_, 'tcx> { fn visit_binder<T: TypeFoldable<'tcx>>(&mut self, t: &ty::Binder<T>) -> bool { t.skip_binder().visit_with(self); false // keep visiting } fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool { match *r { // ignore bound regions, keep visiting ty::ReLateBound(_, _) => false, _ => { self.infcx.sub_regions(infer::CallReturn(self.span), self.least_region, r); false } } } fn visit_ty(&mut self, ty: Ty<'tcx>) -> bool { // We're only interested in types involving regions if !ty.flags.intersects(ty::TypeFlags::HAS_FREE_REGIONS) { return false; // keep visiting } match ty.sty { ty::Closure(def_id, ref substs) => { // Skip lifetime parameters of the enclosing item(s) for upvar_ty in substs.upvar_tys(def_id, self.infcx.tcx) { upvar_ty.visit_with(self); } substs.closure_sig_ty(def_id, self.infcx.tcx).visit_with(self); } ty::Generator(def_id, ref substs, _) => { // Skip lifetime parameters of the enclosing item(s) // Also skip the witness type, because that has no free regions. for upvar_ty in substs.upvar_tys(def_id, self.infcx.tcx) { upvar_ty.visit_with(self); } substs.return_ty(def_id, self.infcx.tcx).visit_with(self); substs.yield_ty(def_id, self.infcx.tcx).visit_with(self); } _ => { ty.super_visit_with(self); } } false } } </ins> struct ReverseMapper<'cx, 'gcx: 'tcx, 'tcx: 'cx> { tcx: TyCtxt<'cx, 'gcx, 'tcx>,

// ignore `'static`, as that can appear anywhere ty::ReStatic | <del> // ignore `ReScope`, as that can appear anywhere // See `src/test/run-pass/issue-49556.rs` for example. </del> <ins> // ignore `ReScope`, which may appear in impl Trait in bindings. </ins> ty::ReScope(..) => return r, _ => { }

<ins> // Test that we are special casing "outlives" for opaque types. // // The return type of a closure is not required to outlive the closure. As such // the following code would not compile if we used a standard outlives check // when checking the return type, because the return type of the closure would // be `&ReEmpty i32`, and we don't allow `ReEmpty` to occur in the concrete // type used for an opaque type. // // However, opaque types are special cased to include check all regions in the // concrete type against the bound, which forces the return type to be // `&'static i32` here. // compile-pass fn make_identity() -> impl Sized { |x: &'static i32| x } fn main() {} </ins>

// This used to ICE because it creates an `impl Trait` that captures a // hidden empty region. <del> #![feature(conservative_impl_trait)] </del> <ins> // compile-pass </ins> <del> fn server() -> impl FilterBase2 { //~ ERROR [E0700] </del> <ins> fn server() -> impl FilterBase2 { </ins> segment2(|| { loop { } }).map2(|| "") }

<del> error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> $DIR/issue-55608-captures-empty-region.rs:6:16 | LL | fn server() -> impl FilterBase2 { |                ^^^^^^^^^^^^^^^^ | = note: hidden type `Map2<[closure@$DIR/issue-55608-captures-empty-region.rs:7:36: 7:41]>` captures an empty lifetime error: aborting due to previous error For more information about this error, try `rustc --explain E0700`. </del>

<ins> // Regression test for issue 57464. // // Closure are (surprisingly) allowed to outlive their signature. As such it // was possible to end up with `ReScope`s appearing in the concrete type of an // opaque type. As all regions are now required to outlive the bound in an // opaque type we avoid the issue here. // compile-pass struct A<F>(F); unsafe impl <'a, 'b, F: Fn(&'a i32) -> &'b i32> Send for A<F> {} fn wrapped_closure() -> impl Sized { let f = |x| x; f(&0); A(f) } fn main() { let x: Box<dyn Send> = Box::new(wrapped_closure()); } </ins>

fn iter<'a>(data: &'a [usize]) -> impl Iterator<Item = usize> + 'a { data.iter() .map( <del> |x| x // fn(&'a usize) -> &'(ReScope) usize </del> <ins> |x| x // fn(&'a usize) -> &'a usize </ins> ) .map( <del> |x| *x // fn(&'(ReScope) usize) -> usize </del> <ins> |x| *x // fn(&'a usize) -> usize </ins> ) }