use rustc::ty::subst::{Subst, InternalSubsts};
use rustc::ty::{self, ParamEnvAnd, Ty, TyCtxt};
use rustc::util::nodemap::FxHashSet;
-use rustc_data_structures::sync::Lrc;
use syntax::source_map::{Span, DUMMY_SP};
crate fn provide(p: &mut Providers<'_>) {
}
fn dropck_outlives<'tcx>(
- tcx: TyCtxt<'_, 'tcx, 'tcx>,
+ tcx: TyCtxt<'tcx, 'tcx>,
canonical_goal: CanonicalTyGoal<'tcx>,
-) -> Result<Lrc<Canonical<'tcx, QueryResponse<'tcx, DropckOutlivesResult<'tcx>>>>, NoSolution> {
+) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, DropckOutlivesResult<'tcx>>>, NoSolution> {
debug!("dropck_outlives(goal={:#?})", canonical_goal);
tcx.infer_ctxt().enter_with_canonical(
/// Returns a set of constraints that needs to be satisfied in
/// order for `ty` to be valid for destruction.
-fn dtorck_constraint_for_ty<'a, 'gcx, 'tcx>(
- tcx: TyCtxt<'a, 'gcx, 'tcx>,
+fn dtorck_constraint_for_ty<'gcx, 'tcx>(
+ tcx: TyCtxt<'gcx, 'tcx>,
span: Span,
for_ty: Ty<'tcx>,
depth: usize,
}
ty::Tuple(tys) => tys.iter()
- .map(|ty| dtorck_constraint_for_ty(tcx, span, for_ty, depth + 1, ty))
+ .map(|ty| dtorck_constraint_for_ty(tcx, span, for_ty, depth + 1, ty.expect_ty()))
.collect(),
ty::Closure(def_id, substs) => substs
}
/// Calculates the dtorck constraint for a type.
-crate fn adt_dtorck_constraint<'a, 'tcx>(
- tcx: TyCtxt<'a, 'tcx, 'tcx>,
+crate fn adt_dtorck_constraint<'tcx>(
+ tcx: TyCtxt<'tcx, 'tcx>,
def_id: DefId,
) -> Result<DtorckConstraint<'tcx>, NoSolution> {
let def = tcx.adt_def(def_id);