mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 18:15:07 +03:00
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:
@@ -2505,16 +2505,10 @@ fn copy_clone_conditions(
|
||||
}
|
||||
|
||||
ty::Closure(def_id, substs) => {
|
||||
let trait_id = obligation.predicate.def_id();
|
||||
let is_copy_trait = Some(trait_id) == self.tcx().lang_items().copy_trait();
|
||||
let is_clone_trait = Some(trait_id) == self.tcx().lang_items().clone_trait();
|
||||
if is_copy_trait || is_clone_trait {
|
||||
Where(ty::Binder::bind(
|
||||
substs.upvar_tys(def_id, self.tcx()).collect(),
|
||||
))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
// (*) binder moved here
|
||||
Where(ty::Binder::bind(
|
||||
substs.upvar_tys(def_id, self.tcx()).collect(),
|
||||
))
|
||||
}
|
||||
|
||||
ty::Adt(..) | ty::Projection(..) | ty::Param(..) | ty::Opaque(..) => {
|
||||
|
||||
Reference in New Issue
Block a user