Skip to content

Commit b2c0fd0

Browse files
committed
Remove redundant code in copy_clone_conditions
This was left over from when closure copy and clone were gated behind feature flags.
1 parent 6d59933 commit b2c0fd0

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/librustc/traits/select.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,16 +2505,10 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
25052505
}
25062506

25072507
ty::Closure(def_id, substs) => {
2508-
let trait_id = obligation.predicate.def_id();
2509-
let is_copy_trait = Some(trait_id) == self.tcx().lang_items().copy_trait();
2510-
let is_clone_trait = Some(trait_id) == self.tcx().lang_items().clone_trait();
2511-
if is_copy_trait || is_clone_trait {
2512-
Where(ty::Binder::bind(
2513-
substs.upvar_tys(def_id, self.tcx()).collect(),
2514-
))
2515-
} else {
2516-
None
2517-
}
2508+
// (*) binder moved here
2509+
Where(ty::Binder::bind(
2510+
substs.upvar_tys(def_id, self.tcx()).collect(),
2511+
))
25182512
}
25192513

25202514
ty::Adt(..) | ty::Projection(..) | ty::Param(..) | ty::Opaque(..) => {

0 commit comments

Comments
 (0)