Remove redundant code in copy_clone_conditions

This was left over from when closure copy and clone were gated behind
feature flags.
This commit is contained in:
Tyler Mandry 2019-04-21 15:19:53 -07:00
parent 6d599337fa
commit b2c0fd0876

View file

@ -2505,16 +2505,10 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
} }
ty::Closure(def_id, substs) => { ty::Closure(def_id, substs) => {
let trait_id = obligation.predicate.def_id(); // (*) binder moved here
let is_copy_trait = Some(trait_id) == self.tcx().lang_items().copy_trait(); Where(ty::Binder::bind(
let is_clone_trait = Some(trait_id) == self.tcx().lang_items().clone_trait(); substs.upvar_tys(def_id, self.tcx()).collect(),
if is_copy_trait || is_clone_trait { ))
Where(ty::Binder::bind(
substs.upvar_tys(def_id, self.tcx()).collect(),
))
} else {
None
}
} }
ty::Adt(..) | ty::Projection(..) | ty::Param(..) | ty::Opaque(..) => { ty::Adt(..) | ty::Projection(..) | ty::Param(..) | ty::Opaque(..) => {