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

error: internal compiler error: src/librustc/ty/relate.rs:753: impossible case reached: can't relate: (T,) with Lifetime('_#1r) #57156

Closed
KamilaBorowska opened this issue Dec 27, 2018 · 20 comments
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@KamilaBorowska
Copy link
Contributor

I tried the following code in editions 2015 and 2018:

use std::cell::Cell;

trait CloneablePredicate<'a, T>: 'a + Fn(T) -> bool {
    fn clone_boxed(&self) -> Box<dyn CloneablePredicate<'a, T, Output = bool>>;
}

impl<'a, T, F> CloneablePredicate<'a, T> for F
where
    F: 'a + Clone + Fn(T) -> bool,
{
    fn clone_boxed(&self) -> Box<dyn CloneablePredicate<'a, T, Output = bool>> {
        Box::new(self.clone())
    }
}

impl<'a, T> Clone for Box<dyn CloneablePredicate<'a, T, Output = bool>>
where
    T: 'a,
{
    fn clone(&self) -> Self {
        self.clone_boxed()
    }
}

fn main() {
    let cell = Cell::new(4);
    let x: Box<dyn CloneablePredicate<i32, Output = bool>> = Box::new(move |x| {
        let minus_one = cell.get() - 1;
        cell.set(minus_one);
        x == minus_one
    });
    let y = x.clone();
    println!("{}", x(3));
    println!("{}", x(3));
    println!("{}", y(3));
    println!("{}", y(3));
}

I expected it to print:

true
false
true
false

And this does happen on stable, but not on beta or nightly, where I get this (this particular error is from nightly):

error: internal compiler error: src/librustc/ty/relate.rs:753: impossible case reached: can't relate: (T,) with Lifetime('_#1r)

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:590:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error


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.33.0-nightly (a7be40c65 2018-12-26) running on x86_64-unknown-linux-gnu

Meta:

rustc --version --verbose:

rustc 1.33.0-nightly (a7be40c65 2018-12-26)
binary: rustc
commit-hash: a7be40c65ae8ace467c9c40b0a22642973e31a13
commit-date: 2018-12-26
host: x86_64-unknown-linux-gnu
release: 1.33.0-nightly
LLVM version: 8.0

Backtrace:

error: internal compiler error: src/librustc/ty/relate.rs:753: impossible case reached: can't relate: (T,) with Lifetime('_#1r)

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:590:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: <rustc::ty::subst::Kind<'tcx> as rustc::ty::relate::Relate<'tcx>>::relate
  15: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
  16: <smallvec::SmallVec<A> as core::iter::traits::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  17: <core::result::Result<T, E> as rustc::ty::context::InternIteratorElement<T, R>>::intern_with
  18: <rustc::ty::sty::ExistentialTraitRef<'tcx> as rustc::ty::relate::Relate<'tcx>>::relate
  19: rustc::infer::InferCtxt::commit_if_ok
  20: rustc::infer::InferCtxt::commit_if_ok
  21: rustc::traits::project::opt_normalize_projection_type
  22: rustc::traits::project::normalize_projection_type
  23: rustc::ty::context::GlobalCtxt::enter_local
  24: rustc_traits::normalize_projection_ty::normalize_projection_ty
  25: rustc::ty::query::__query_compute::normalize_projection_ty
  26: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::normalize_projection_ty<'tcx>>::compute
  27: rustc::dep_graph::graph::DepGraph::with_task_impl
  28: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  29: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  30: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  31: <rustc::traits::query::normalize::QueryNormalizer<'cx, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  32: <smallvec::SmallVec<A> as core::iter::traits::FromIterator<<A as smallvec::Array>::Item>>::from_iter
  33: rustc::ty::fold::TypeFoldable::fold_with
  34: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_fold_with
  35: <rustc::traits::query::normalize::QueryNormalizer<'cx, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  36: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_fold_with
  37: <rustc::traits::query::normalize::QueryNormalizer<'cx, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
  38: rustc::traits::query::normalize::<impl rustc::infer::at::At<'cx, 'gcx, 'tcx>>::normalize
  39: rustc::ty::context::GlobalCtxt::enter_local
  40: rustc_traits::normalize_erasing_regions::normalize_ty_after_erasing_regions
  41: rustc::ty::query::__query_compute::normalize_ty_after_erasing_regions
  42: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::normalize_ty_after_erasing_regions<'tcx>>::compute
  43: rustc::dep_graph::graph::DepGraph::with_task_impl
  44: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  45: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  46: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  47: rustc::traits::query::normalize_erasing_regions::<impl rustc::ty::context::TyCtxt<'cx, 'tcx, 'tcx>>::normalize_erasing_regions
  48: <rustc::ty::layout::LayoutCx<'tcx, rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>> as rustc_target::abi::LayoutOf>::layout_of
  49: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::virtual_call_violation_for_method::{{closure}}
  50: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::virtual_call_violation_for_method
  51: <&mut I as core::iter::iterator::Iterator>::next
  52: <core::iter::Filter<I, P> as core::iter::iterator::Iterator>::next
  53: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  54: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::object_safety_violations_for_trait
  55: <core::iter::FlatMap<I, U, F> as core::iter::iterator::Iterator>::next
  56: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
  57: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::object_safety_violations
  58: rustc::traits::object_safety::is_object_safe_provider
  59: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::is_object_safe<'tcx>>::compute
  60: rustc::dep_graph::graph::DepGraph::with_task_impl
  61: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  62: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  63: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  64: <rustc_data_structures::obligation_forest::ObligationForest<O>>::process_obligations
  65: <rustc::traits::fulfill::FulfillmentContext<'tcx> as rustc::traits::engine::TraitEngine<'tcx>>::select_where_possible
  66: <rustc::traits::fulfill::FulfillmentContext<'tcx> as rustc::traits::engine::TraitEngine<'tcx>>::select_all_or_error
  67: rustc_typeck::check::FnCtxt::select_all_obligations_or_error
  68: rustc::ty::context::GlobalCtxt::enter_local
  69: rustc_typeck::check::wfcheck::check_item_well_formed
  70: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::check_item_well_formed<'tcx>>::compute
  71: rustc::dep_graph::graph::DepGraph::with_task_impl
  72: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
  73: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
  74: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
  75: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query
  76: <rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_item
  77: rustc::hir::Crate::visit_all_item_likes
  78: rustc_typeck::check_crate
  79: <std::thread::local::LocalKey<T>>::with
  80: rustc::ty::context::TyCtxt::create_and_enter
  81: rustc_driver::driver::compile_input
  82: rustc_driver::run_compiler_with_pool
  83: <scoped_tls::ScopedKey<T>>::set
  84: rustc_driver::run_compiler
  85: <scoped_tls::ScopedKey<T>>::set
query stack during panic:
#0 [normalize_projection_ty] normalizing `Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(TraitPredicate(<Self as CloneablePredicate<'_, T>>)), Binder(TraitPredicate(<T as std::marker::Sized>)), Binder(ProjectionPredicate(ProjectionTy { substs: [Self, (T,)], item_def_id: DefId(2/0:985 ~ core[7549]::ops[0]::function[0]::FnOnce[0]::Output[0]) }, bool)), Binder(TraitPredicate(<Self as std::ops::Fn<(T,)>>)), Binder(TraitPredicate(<Self as std::ops::FnMut<(T,)>>)), Binder(TraitPredicate(<Self as std::ops::FnOnce<(T,)>>)), Binder(OutlivesPredicate(Self, ReLateBound(DebruijnIndex(1), BrAnon(0))))], reveal: All }, value: ProjectionTy { substs: [Self, ReLateBound(DebruijnIndex(0), BrAnon(1)), T], item_def_id: DefId(2/0:985 ~ core[7549]::ops[0]::function[0]::FnOnce[0]::Output[0]) } } }`
#1 [normalize_ty_after_erasing_regions] normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(TraitPredicate(<Self as CloneablePredicate<'a, T>>)), Binder(TraitPredicate(<T as std::marker::Sized>)), Binder(ProjectionPredicate(ProjectionTy { substs: [Self, (T,)], item_def_id: DefId(2/0:985 ~ core[7549]::ops[0]::function[0]::FnOnce[0]::Output[0]) }, bool)), Binder(TraitPredicate(<Self as std::ops::Fn<(T,)>>)), Binder(TraitPredicate(<Self as std::ops::FnMut<(T,)>>)), Binder(TraitPredicate(<Self as std::ops::FnOnce<(T,)>>)), Binder(OutlivesPredicate(Self, ReEarlyBound(1, 'a)))], reveal: All }, value: &dyn CloneablePredicate<T, Output=<Self as std::ops::FnOnce<T>>::Output> }`
#2 [is_object_safe] determine object safety of trait `CloneablePredicate`
#3 [check_item_well_formed] processing `<impl std::clone::Clone for std::boxed::Box<(dyn CloneablePredicate<'a, T, Output=bool, Output=bool> + 'a)>>`
end of query stack
error: aborting due to previous error


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.33.0-nightly (a7be40c65 2018-12-26) running on x86_64-unknown-linux-gnu
@KamilaBorowska KamilaBorowska changed the title error: internal compiler error: src/librustc/ty/relate.rs:721: impossible case reached: can't relate: (T,) with Lifetime('_#1r) error: internal compiler error: src/librustc/ty/relate.rs:753: impossible case reached: can't relate: (T,) with Lifetime('_#1r) Dec 27, 2018
@estebank estebank added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 28, 2018
@pietroalbini
Copy link
Member

Ping @rust-lang/compiler

@nagisa nagisa added P-high High priority and removed I-nominated labels Jan 3, 2019
@nagisa
Copy link
Member

nagisa commented Jan 3, 2019

Discussed at the T-compiler meeting. P-high to at least bisect and figure out where the regression happened.

@nikomatsakis
Copy link
Contributor

Bisected to nightly-2018-11-04, now going to attempt to bisect to a PR

@nikomatsakis
Copy link
Contributor

Bisected to #54383, cc @mikeyhew

@nikomatsakis
Copy link
Contributor

Specifically 3fc70e8

@mikeyhew
Copy link
Contributor

mikeyhew commented Jan 3, 2019

It's this call to layout_of that triggers the ICE much deeper in the stack. Not sure what causes the error yet.

Here is a backtrace with debug symbols, with rustc at 9723a49
error: internal compiler error: src/librustc/ty/relate.rs:763: impossible case reached: can't relate: (T,) with Lifetime('_#1r)

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:600:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:72
             at src/libstd/sys_common/backtrace.rs:60
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:210
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:225
   4: rustc::util::common::panic_hook
             at src/librustc/util/common.rs:49
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:492
   6: std::panicking::begin_panic
             at ./src/libstd/panicking.rs:422
   7: rustc_errors::Handler::bug
             at src/librustc_errors/lib.rs:600
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
             at src/librustc/util/bug.rs:46
   9: rustc::ty::context::tls::with_opt::{{closure}}
             at src/librustc/ty/context.rs:2157
  10: rustc::ty::context::tls::with_context_opt
             at src/librustc/ty/context.rs:2094
  11: rustc::ty::context::tls::with_opt
             at src/librustc/ty/context.rs:2157
  12: rustc::util::bug::opt_span_bug_fmt
             at src/librustc/util/bug.rs:42
  13: rustc::util::bug::bug_fmt
             at src/librustc/util/bug.rs:22
  14: <rustc::ty::subst::Kind<'tcx> as rustc::ty::relate::Relate<'tcx>>::relate
             at src/librustc/ty/relate.rs:763
  15: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at src/librustc/ty/relate.rs:67
             at src/librustc/infer/sub.rs:71
             at src/librustc/ty/relate.rs:157
             at ./src/libcore/ops/function.rs:289
  16: <smallvec::SmallVec<A> as core::iter::traits::FromIterator<<A as smallvec::Array>::Item>>::from_iter
             at ./src/libcore/option.rs:424
             at ./src/libcore/iter/mod.rs:1330
             at ./src/libcore/result.rs:1232
             at ./src/libcore/iter/iterator.rs:2625
             at /users/mahewson/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-0.6.7/lib.rs:1359
             at /users/mahewson/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-0.6.7/lib.rs:1333
  17: <core::result::Result<T, E> as rustc::ty::context::InternIteratorElement<T, R>>::intern_with
             at ./src/libcore/result.rs:1249
             at ./src/libcore/iter/iterator.rs:1478
             at src/librustc/ty/context.rs:3030
  18: rustc::ty::relate::relate_substs
             at src/librustc/ty/context.rs:3002
             at src/librustc/ty/context.rs:2852
             at src/librustc/ty/relate.rs:160
  19: <rustc::ty::sty::ExistentialTraitRef<'tcx> as rustc::ty::relate::Relate<'tcx>>::relate
             at src/librustc/ty/relate.rs:309
  20: rustc::infer::InferCtxt::commit_if_ok
             at src/librustc/ty/relate.rs:67
             at src/librustc/infer/higher_ranked/mod.rs:72
             at src/librustc/infer/mod.rs:844
  21: rustc::infer::higher_ranked::<impl rustc::infer::combine::CombineFields<'a, 'gcx, 'tcx>>::higher_ranked_sub
             at src/librustc/infer/higher_ranked/mod.rs:50
  22: rustc::infer::InferCtxt::commit_if_ok
             at src/librustc/infer/sub.rs:154
             at src/librustc/ty/relate.rs:713
             at src/librustc/ty/relate.rs:67
             at src/librustc/infer/at.rs:236
             at src/librustc/infer/mod.rs:844
  23: rustc::infer::at::At::sub_exp
             at src/librustc/infer/at.rs:234
             at src/librustc/infer/at.rs:99
  24: rustc::infer::InferCtxt::probe
             at src/librustc/infer/at.rs:112
             at src/librustc/traits/project.rs:1025
             at src/librustc/infer/mod.rs:876
  25: rustc::traits::project::assemble_candidates_from_predicates
             at src/librustc/traits/project.rs:1020
  26: rustc::traits::project::opt_normalize_projection_type
             at src/librustc/traits/project.rs:948
             at src/librustc/traits/project.rs:904
             at src/librustc/traits/project.rs:642
  27: rustc::traits::project::normalize_projection_type
             at src/librustc/traits/project.rs:489
  28: rustc::ty::context::tls::with_related_context
             at src/librustc_traits/normalize_projection_ty.rs:49
             at ./src/librustc/infer/canonical/query_response.rs:73
             at ./src/librustc/infer/mod.rs:527
             at ./src/librustc/infer/mod.rs:543
             at ./src/librustc/ty/context.rs:1648
             at ./src/librustc/ty/context.rs:2017
             at ./src/librustc/ty/context.rs:1952
             at ./src/librustc/ty/context.rs:2016
             at ./src/librustc/ty/context.rs:1647
             at ./src/librustc/ty/context.rs:2119
             at ./src/librustc/ty/context.rs:2103
             at ./src/librustc/ty/context.rs:2094
             at ./src/librustc/ty/context.rs:2103
             at ./src/librustc/ty/context.rs:2114
  29: rustc::infer::canonical::query_response::<impl rustc::infer::InferCtxtBuilder<'cx, 'gcx, 'tcx>>::enter_canonical_trait_query
             at ./src/librustc/ty/context.rs:1640
             at ./src/librustc/infer/mod.rs:542
             at ./src/librustc/infer/mod.rs:524
             at ./src/librustc/infer/canonical/query_response.rs:68
  30: rustc_traits::normalize_projection_ty::normalize_projection_ty
             at src/librustc_traits/normalize_projection_ty.rs:38
  31: rustc::ty::query::__query_compute::normalize_projection_ty
             at src/librustc/ty/query/plumbing.rs:870
             at src/librustc/ty/query/plumbing.rs:829
  32: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::normalize_projection_ty<'tcx>>::compute
             at src/librustc/ty/query/plumbing.rs:862
  33: rustc::dep_graph::graph::DepGraph::with_task_impl
             at src/librustc/dep_graph/graph.rs:342
  34: rustc::ty::context::tls::with_related_context
             at src/librustc/dep_graph/graph.rs:208
             at src/librustc/ty/query/plumbing.rs:565
             at src/librustc/ty/query/plumbing.rs:218
             at src/librustc/ty/context.rs:2017
             at src/librustc/ty/context.rs:1952
             at src/librustc/ty/context.rs:2016
             at src/librustc/ty/query/plumbing.rs:217
             at src/librustc/ty/context.rs:2119
             at src/librustc/ty/context.rs:2103
             at src/librustc/ty/context.rs:2094
             at src/librustc/ty/context.rs:2103
             at src/librustc/ty/context.rs:2114
  35: <rustc::ty::query::plumbing::JobOwner<'a, 'tcx, Q>>::start
             at src/librustc/ty/query/plumbing.rs:207
  36: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at src/librustc/ty/query/plumbing.rs:558
  37: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
             at src/librustc/ty/query/plumbing.rs:398
  38: <rustc::traits::query::normalize::QueryNormalizer<'cx, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
             at src/librustc/ty/query/plumbing.rs:664
             at src/librustc/ty/query/plumbing.rs:928
             at src/librustc/ty/query/plumbing.rs:920
             at src/librustc/traits/query/normalize.rs:162
  39: <smallvec::SmallVec<A> as core::iter::traits::FromIterator<<A as smallvec::Array>::Item>>::from_iter
             at src/librustc/ty/structural_impls.rs:763
             at src/librustc/macros.rs:354
             at src/librustc/ty/fold.rs:58
             at src/librustc/macros.rs:407
             at src/librustc/ty/fold.rs:58
             at src/librustc/ty/structural_impls.rs:607
             at ./src/libcore/ops/function.rs:289
             at ./src/libcore/option.rs:424
             at ./src/libcore/iter/mod.rs:1330
             at /users/mahewson/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-0.6.7/lib.rs:1349
             at /users/mahewson/.cargo/registry/src/github.com-1ecc6299db9ec823/smallvec-0.6.7/lib.rs:1333
  40: rustc::ty::fold::TypeFoldable::fold_with
             at ./src/libcore/iter/iterator.rs:1478
             at src/librustc/ty/structural_impls.rs:607
             at src/librustc/ty/fold.rs:58
  41: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_fold_with
             at src/librustc/ty/structural_impls.rs:585
             at src/librustc/ty/sty.rs:839
             at src/librustc/ty/sty.rs:833
             at src/librustc/ty/structural_impls.rs:585
             at src/librustc/ty/fold.rs:166
             at src/librustc/ty/structural_impls.rs:589
             at src/librustc/ty/structural_impls.rs:717
  42: <rustc::traits::query::normalize::QueryNormalizer<'cx, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
             at src/librustc/traits/query/normalize.rs:101
  43: rustc::ty::structural_impls::<impl rustc::ty::fold::TypeFoldable<'tcx> for &'tcx rustc::ty::TyS<'tcx>>::super_fold_with
             at src/librustc/ty/structural_impls.rs:763
             at src/librustc/ty/structural_impls.rs:724
  44: <rustc::traits::query::normalize::QueryNormalizer<'cx, 'gcx, 'tcx> as rustc::ty::fold::TypeFolder<'gcx, 'tcx>>::fold_ty
             at src/librustc/traits/query/normalize.rs:101
  45: rustc::traits::query::normalize::<impl rustc::infer::at::At<'cx, 'gcx, 'tcx>>::normalize
             at ./src/librustc/ty/structural_impls.rs:763
             at ./src/librustc/traits/query/normalize.rs:67
  46: rustc::ty::context::tls::with_related_context
             at src/librustc_traits/normalize_erasing_regions.rs:34
             at ./src/librustc/infer/mod.rs:543
             at ./src/librustc/ty/context.rs:1648
             at ./src/librustc/ty/context.rs:2017
             at ./src/librustc/ty/context.rs:1952
             at ./src/librustc/ty/context.rs:2016
             at ./src/librustc/ty/context.rs:1647
             at ./src/librustc/ty/context.rs:2119
             at ./src/librustc/ty/context.rs:2103
             at ./src/librustc/ty/context.rs:2094
             at ./src/librustc/ty/context.rs:2103
             at ./src/librustc/ty/context.rs:2114
  47: rustc::infer::InferCtxtBuilder::enter
             at ./src/librustc/ty/context.rs:1640
             at ./src/librustc/infer/mod.rs:542
  48: rustc_traits::normalize_erasing_regions::normalize_ty_after_erasing_regions
             at src/librustc_traits/normalize_erasing_regions.rs:32
  49: rustc::ty::query::__query_compute::normalize_ty_after_erasing_regions
             at src/librustc/ty/query/plumbing.rs:870
             at src/librustc/ty/query/plumbing.rs:829
  50: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::normalize_ty_after_erasing_regions<'tcx>>::compute
             at src/librustc/ty/query/plumbing.rs:862
  51: rustc::dep_graph::graph::DepGraph::with_task_impl
             at src/librustc/dep_graph/graph.rs:342
  52: rustc::ty::context::tls::with_related_context
             at src/librustc/dep_graph/graph.rs:208
             at src/librustc/ty/query/plumbing.rs:565
             at src/librustc/ty/query/plumbing.rs:218
             at src/librustc/ty/context.rs:2017
             at src/librustc/ty/context.rs:1952
             at src/librustc/ty/context.rs:2016
             at src/librustc/ty/query/plumbing.rs:217
             at src/librustc/ty/context.rs:2119
             at src/librustc/ty/context.rs:2103
             at src/librustc/ty/context.rs:2094
             at src/librustc/ty/context.rs:2103
             at src/librustc/ty/context.rs:2114
  53: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at src/librustc/ty/query/plumbing.rs:207
             at src/librustc/ty/query/plumbing.rs:558
  54: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
             at src/librustc/ty/query/plumbing.rs:398
  55: rustc::traits::query::normalize_erasing_regions::<impl rustc::ty::context::TyCtxt<'cx, 'tcx, 'tcx>>::normalize_erasing_regions
             at src/librustc/ty/query/plumbing.rs:664
             at src/librustc/ty/query/plumbing.rs:928
             at src/librustc/ty/query/plumbing.rs:920
             at src/librustc/traits/query/normalize_erasing_regions.rs:86
             at src/librustc/ty/structural_impls.rs:763
             at src/librustc/traits/query/normalize_erasing_regions.rs:46
  56: <rustc::ty::layout::LayoutCx<'tcx, rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>> as rustc_target::abi::LayoutOf>::layout_of
             at src/librustc/ty/layout.rs:1530
  57: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::virtual_call_violation_for_method::{{closure}}
             at src/librustc/ty/layout.rs:1591
             at src/librustc/traits/object_safety.rs:357
  58: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::virtual_call_violation_for_method
             at src/librustc/traits/object_safety.rs:384
  59: <&mut I as core::iter::iterator::Iterator>::next
             at src/librustc/traits/object_safety.rs:271
             at src/librustc/traits/object_safety.rs:132
             at ./src/libcore/iter/mod.rs:1576
             at ./src/libcore/iter/iterator.rs:2625
  60: <core::iter::Filter<I, P> as core::iter::iterator::Iterator>::next
             at ./src/libcore/iter/mod.rs:1441
  61: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
             at ./src/liballoc/vec.rs:1788
  62: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::object_safety_violations_for_trait
             at ./src/liballoc/vec.rs:1700
             at ./src/libcore/iter/iterator.rs:1478
             at src/librustc/traits/object_safety.rs:129
  63: <core::iter::FlatMap<I, U, F> as core::iter::iterator::Iterator>::next
             at src/librustc/traits/object_safety.rs:121
             at ./src/libcore/ops/function.rs:289
             at ./src/libcore/option.rs:424
             at ./src/libcore/iter/mod.rs:1330
             at ./src/libcore/iter/mod.rs:2617
             at ./src/libcore/iter/mod.rs:2454
  64: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
             at ./src/liballoc/vec.rs:1788
  65: rustc::traits::object_safety::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'tcx>>::object_safety_violations
             at ./src/liballoc/vec.rs:1700
             at ./src/libcore/iter/iterator.rs:1478
             at src/librustc/traits/object_safety.rs:120
  66: rustc::traits::object_safety::is_object_safe_provider
             at src/librustc/traits/object_safety.rs:681
  67: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::is_object_safe<'tcx>>::compute
             at src/librustc/ty/query/plumbing.rs:862
  68: rustc::dep_graph::graph::DepGraph::with_task_impl
             at src/librustc/dep_graph/graph.rs:342
  69: rustc::ty::context::tls::with_related_context
             at src/librustc/dep_graph/graph.rs:208
             at src/librustc/ty/query/plumbing.rs:565
             at src/librustc/ty/query/plumbing.rs:218
             at src/librustc/ty/context.rs:2017
             at src/librustc/ty/context.rs:1952
             at src/librustc/ty/context.rs:2016
             at src/librustc/ty/query/plumbing.rs:217
             at src/librustc/ty/context.rs:2119
             at src/librustc/ty/context.rs:2103
             at src/librustc/ty/context.rs:2094
             at src/librustc/ty/context.rs:2103
             at src/librustc/ty/context.rs:2114
  70: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at src/librustc/ty/query/plumbing.rs:207
             at src/librustc/ty/query/plumbing.rs:558
  71: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
             at src/librustc/ty/query/plumbing.rs:398
  72: <rustc_data_structures::obligation_forest::ObligationForest<O>>::process_obligations
             at src/librustc/ty/query/plumbing.rs:664
             at src/librustc/ty/query/plumbing.rs:928
             at src/librustc/ty/query/plumbing.rs:920
             at src/librustc/traits/fulfill.rs:433
             at ./src/librustc_data_structures/obligation_forest/mod.rs:336
  73: <rustc::traits::fulfill::FulfillmentContext<'tcx> as rustc::traits::engine::TraitEngine<'tcx>>::select_where_possible
             at src/librustc/traits/fulfill.rs:119
             at src/librustc/traits/fulfill.rs:249
  74: <rustc::traits::fulfill::FulfillmentContext<'tcx> as rustc::traits::engine::TraitEngine<'tcx>>::select_all_or_error
             at src/librustc/traits/fulfill.rs:230
  75: rustc_typeck::check::FnCtxt::select_all_obligations_or_error
             at src/librustc_typeck/check/mod.rs:2516
  76: rustc::ty::context::tls::with_related_context
             at src/librustc_typeck/check/wfcheck.rs:57
             at src/librustc_typeck/check/mod.rs:625
             at ./src/librustc/infer/mod.rs:543
             at ./src/librustc/ty/context.rs:1648
             at ./src/librustc/ty/context.rs:2017
             at ./src/librustc/ty/context.rs:1952
             at ./src/librustc/ty/context.rs:2016
             at ./src/librustc/ty/context.rs:1647
             at ./src/librustc/ty/context.rs:2119
             at ./src/librustc/ty/context.rs:2103
             at ./src/librustc/ty/context.rs:2094
             at ./src/librustc/ty/context.rs:2103
             at ./src/librustc/ty/context.rs:2114
  77: rustc::ty::context::GlobalCtxt::enter_local
             at ./src/librustc/ty/context.rs:1640
  78: rustc_typeck::check::wfcheck::CheckWfFcxBuilder::with_fcx
             at ./src/librustc/infer/mod.rs:542
             at src/librustc_typeck/check/mod.rs:625
             at src/librustc_typeck/check/wfcheck.rs:48
  79: rustc_typeck::check::wfcheck::check_item_well_formed
             at src/librustc_typeck/check/wfcheck.rs:388
             at src/librustc_typeck/check/wfcheck.rs:107
  80: rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors<'tcx> for rustc::ty::query::queries::check_item_well_formed<'tcx>>::compute
             at src/librustc/ty/query/plumbing.rs:862
  81: rustc::dep_graph::graph::DepGraph::with_task_impl
             at src/librustc/dep_graph/graph.rs:342
  82: rustc::ty::context::tls::with_related_context
             at src/librustc/dep_graph/graph.rs:208
             at src/librustc/ty/query/plumbing.rs:565
             at src/librustc/ty/query/plumbing.rs:218
             at src/librustc/ty/context.rs:2017
             at src/librustc/ty/context.rs:1952
             at src/librustc/ty/context.rs:2016
             at src/librustc/ty/query/plumbing.rs:217
             at src/librustc/ty/context.rs:2119
             at src/librustc/ty/context.rs:2103
             at src/librustc/ty/context.rs:2094
             at src/librustc/ty/context.rs:2103
             at src/librustc/ty/context.rs:2114
  83: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::force_query_with_job
             at src/librustc/ty/query/plumbing.rs:207
             at src/librustc/ty/query/plumbing.rs:558
  84: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::try_get_with
             at src/librustc/ty/query/plumbing.rs:398
  85: rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::ensure_query
             at src/librustc/ty/query/plumbing.rs:664
             at src/librustc/ty/query/plumbing.rs:617
  86: <rustc_typeck::check::wfcheck::CheckTypeWellFormedVisitor<'a, 'tcx> as rustc::hir::intravisit::Visitor<'v>>::visit_item
             at src/librustc_typeck/check/wfcheck.rs:1036
  87: rustc::hir::Crate::visit_all_item_likes
             at ./src/librustc/hir/itemlikevisit.rs:80
             at ./src/librustc/hir/mod.rs:748
  88: rustc::session::Session::track_errors
             at src/librustc_typeck/check/mod.rs:708
             at ./src/librustc/session/mod.rs:328
  89: rustc::util::common::time
             at src/librustc_typeck/check/mod.rs:706
             at src/librustc_typeck/lib.rs:355
             at ./src/librustc/util/common.rs:160
             at ./src/librustc/util/common.rs:154
  90: rustc_typeck::check_crate
             at src/librustc_typeck/lib.rs:355
  91: rustc::ty::context::tls::enter_context
             at src/librustc_driver/driver.rs:1282
             at ./src/librustc/ty/context.rs:2050
             at ./src/librustc/ty/context.rs:2017
             at ./src/librustc/ty/context.rs:1952
             at ./src/librustc/ty/context.rs:2016
  92: <std::thread::local::LocalKey<T>>::with
             at ./src/librustc/ty/context.rs:2049
             at ./src/librustc/ty/context.rs:2006
             at ./src/libstd/thread/local.rs:309
             at ./src/libstd/thread/local.rs:255
             at ./src/librustc/ty/context.rs:1998
             at ./src/libstd/thread/local.rs:309
             at ./src/libstd/thread/local.rs:255
  93: rustc::ty::context::TyCtxt::create_and_enter
             at ./src/librustc/ty/context.rs:1990
             at ./src/librustc/ty/context.rs:2028
             at ./src/librustc/ty/context.rs:1223
  94: rustc_driver::driver::phase_3_run_analysis_passes
             at src/librustc_driver/driver.rs:1256
  95: rustc_driver::driver::compile_input
             at src/librustc_driver/driver.rs:286
  96: rustc_driver::run_compiler_with_pool
             at src/librustc_driver/lib.rs:551
  97: <scoped_tls::ScopedKey<T>>::set
             at src/librustc_driver/lib.rs:473
             at src/librustc_driver/driver.rs:76
             at /users/mahewson/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  98: rustc_driver::run_compiler
             at src/librustc_driver/driver.rs:75
             at src/librustc_driver/lib.rs:472
  99: <scoped_tls::ScopedKey<T>>::set
             at src/librustc_driver/lib.rs:1668
             at src/librustc_driver/lib.rs:188
             at /users/mahewson/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
             at ./src/libsyntax/lib.rs:123
             at /users/mahewson/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
query stack during panic:
#0 [normalize_projection_ty] normalizing `Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Region(U0) }, CanonicalVarInfo { kind: Region(U0) }], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(TraitPredicate(<Self as CloneablePredicate<'_, T>>)), Binder(TraitPredicate(<T as std::marker::Sized>)), Binder(ProjectionPredicate(ProjectionTy { substs: [Self, (T,)], item_def_id: DefId(2/0:984 ~ core[8468]::ops[0]::function[0]::FnOnce[0]::Output[0]) }, bool)), Binder(TraitPredicate(<Self as std::ops::Fn<(T,)>>)), Binder(TraitPredicate(<Self as std::ops::FnMut<(T,)>>)), Binder(TraitPredicate(<Self as std::ops::FnOnce<(T,)>>)), Binder(OutlivesPredicate(Self, ReLateBound(DebruijnIndex(1), BrAnon(0))))], reveal: All }, value: ProjectionTy { substs: [Self, ReLateBound(DebruijnIndex(0), BrAnon(1)), T], item_def_id: DefId(2/0:984 ~ core[8468]::ops[0]::function[0]::FnOnce[0]::Output[0]) } } }`
#1 [normalize_ty_after_erasing_regions] normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(TraitPredicate(<Self as CloneablePredicate<'a, T>>)), Binder(TraitPredicate(<T as std::marker::Sized>)), Binder(ProjectionPredicate(ProjectionTy { substs: [Self, (T,)], item_def_id: DefId(2/0:984 ~ core[8468]::ops[0]::function[0]::FnOnce[0]::Output[0]) }, bool)), Binder(TraitPredicate(<Self as std::ops::Fn<(T,)>>)), Binder(TraitPredicate(<Self as std::ops::FnMut<(T,)>>)), Binder(TraitPredicate(<Self as std::ops::FnOnce<(T,)>>)), Binder(OutlivesPredicate(Self, ReEarlyBound(1, 'a)))], reveal: All }, value: &dyn CloneablePredicate<T, Output=<Self as std::ops::FnOnce<T>>::Output> }`
#2 [is_object_safe] determine object safety of trait `CloneablePredicate`
#3 [check_item_well_formed] processing `<impl std::clone::Clone for std::boxed::Box<(dyn CloneablePredicate<'a, T, Output=bool, Output=bool> + 'a)>>`
end of query stack
error: aborting due to previous error


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.33.0-dev running on x86_64-unknown-linux-gnu

@nikomatsakis
Copy link
Contributor

@mikeyhew hmm, that does seem awfully early in the system to invoke the layout code, now that I think about it -- given that this is just an assertion, maybe we can move that logic later in the compiler? Or maybe i'm on the wrong trail here, and the problem is something else.

@mikeyhew
Copy link
Contributor

mikeyhew commented Jan 3, 2019

@nikomatsakis By "moving that logic to later in the compiler", do you mean doing the same assertion but delaying it until later? I don't think that would get rid of the error, but I don't really know, and maybe it's worth a shot. If you meant "later" in a more general sense, there are existing checks during codegen, but @eddyb wanted to also have this check in object-safety as an additional safeguard.

@nikomatsakis
Copy link
Contributor

@mikeyhew

do you mean doing the same assertion but delaying it until later?

that is what I meant, but I was second guessing that after I wrote it. At minimum, it'd be worth digging in a bit more deeply to understand the ICE.

@arielb1
Copy link
Contributor

arielb1 commented Jan 3, 2019

@nikomatsakis @mikeyhew

Relating a type with a lifetime looks like some sort of very silly error that should be fixed.

@mikeyhew
Copy link
Contributor

mikeyhew commented Jan 3, 2019

Here's what I've unwrapped so far:

While determining if CloneablePredicate is object-safe, we compute the layout of &(dyn CloneablePredicate<'a, T, Output=<Self as std::ops::FnOnce<T>>::Output> + 'static), which results in a projection type being normalized (presumably the <Self as FnOnce<T>::Output>).

The error occurs during assemble_candidates_from_predicates, in the call to .sup(...) here.

@arielb1
Copy link
Contributor

arielb1 commented Jan 3, 2019

btw, more reduced and less erroneous example:

trait CP<'a, T>: 'a + Fn(T) -> bool {
    fn cb(&self) -> Box<dyn CP<'a, T, Output=bool>>;
}

impl<'a, T, F> CP<'a, T> for F
where F: 'a + Clone + Fn(T) -> bool
{
    fn cb(&self) -> Box<dyn CP<'a, T, Output=bool>> {
        Box::new(self.clone())
    }
}

impl<'a, T> Clone for Box<dyn CP<'a, T, Output=bool>>
    where T: 'a
{
    fn clone(&self) -> Self {
        self.cb()
    }
}

fn main() {
    let x: Box<dyn CP<i32, Output=bool>> = Box::new(move |x| x == 0);
    let y = x.clone();
    println!("{}", x(0));
    println!("{}", y(1));
}

@mikeyhew
Copy link
Contributor

mikeyhew commented Jan 3, 2019

This is the obligation:

DEBUG 2019-01-03T20:06:54Z: rustc::traits::project: assemble_candidates_from_predicates(obligation=Obligation(predicate=ProjectionTy { substs: [Self, '_#1r, T], item_def_id: DefId(2/0:984 ~ core[8468]::ops[0]::function[0]::FnOnce[0]::Output[0]) },depth=0))

And this is the predicate being considered as a candidate to fulfill the obligation:

DEBUG 2019-01-03T20:06:54Z: rustc::traits::project: assemble_candidates_from_predicates: predicate=Binder(ProjectionPredicate(ProjectionTy { substs: [Self, (T,)], item_def_id: DefId(2/0:984 ~ core[8468]::ops[0]::function[0]::FnOnce[0]::Output[0]) }, bool))

The substs field doesn't seem to line up - in the obligation there is an extra lifetime ('_#1r) which doesn't appear in the candidate's substs

@arielb1
Copy link
Contributor

arielb1 commented Jan 3, 2019

How did the extra lifetime get there? The substs for FnOnce should be of the form <Type, Type>.

@mikeyhew
Copy link
Contributor

mikeyhew commented Jan 3, 2019

Even more reduced:

trait Foo<Args> {
    type Output;
}

trait Bar<'a, T>: Foo<T, Output=bool> {
    fn cb(&self) -> Box<dyn Bar<'a, T, Output=bool>>;
}

remove the 'a parameter on Bar, or Args from Foo and it goes away.

The -> Box<dyn Bar<'a, T, Output=bool>> is there to invoke is_object_safe on Bar.

@mikeyhew
Copy link
Contributor

mikeyhew commented Jan 3, 2019

OK, I'm going to pack it in for today. Here's what we know:

There's an extra lifetime parameter being added to the substs for the ProjectionTy in the obligation. It's a ReLateBound(DebruijnIndex(0), BrAnon(1)), and it shows up in the query backtrace as well as in some log messages I've looked at. The first time I've seen it logged is here: https://github.com/rust-lang/rust/blob/master/src/librustc/traits/query/normalize.rs#L36. That's with RUST_LOG=rustc::traits::query,rustc_traits.

My best guess at this point is maybe there's a bug in the canonicalizer that introduces the new region. That's where I would look next.

EDIT: but I'm definitely in way over my head here

@arielb1
Copy link
Contributor

arielb1 commented Jan 3, 2019

@mikeyhew

You can see that the substs is Self, '_#1r, T as opposed to Self, (T,), which is wrong even without the region (the trait-ref should be <Self as Fn<(T,)>>::Output, with a tuple). Someone is not doing a subst when they should, you just need to track that down.

@mikeyhew
Copy link
Contributor

mikeyhew commented Jan 5, 2019

@arielb1 but where does the lifetime come from? It's an anonymous late-bound region, which I thought could be be the lifetime of the reference in &self. But changing to self: Box<Self> doesn't change anything.

FYI I'm pretty sure I won't be able to find the bug — I don't have the time, and I'm not sure what I'm looking for anyway.

@arielb1
Copy link
Contributor

arielb1 commented Jan 5, 2019

ok I'll have it

@arielb1 arielb1 self-assigned this Jan 5, 2019
arielb1 added a commit to arielb1/rust that referenced this issue Jan 5, 2019
bors added a commit that referenced this issue Jan 11, 2019
use the correct supertrait substitution in `object_ty_for_trait`

beta-nominating because regression.

Fixes #57156.
bors added a commit that referenced this issue Jan 11, 2019
use the correct supertrait substitution in `object_ty_for_trait`

beta-nominating because regression.

Fixes #57156.
pietroalbini pushed a commit to pietroalbini/rust that referenced this issue Jan 11, 2019
@KamilaBorowska
Copy link
Contributor Author

KamilaBorowska commented Feb 27, 2019

After fixing this, Output = bool is no longer necessary, which is really nice 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants