File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,10 @@ pub(crate) fn synthesize_auto_trait_impls<'tcx>(
25
25
let ty = tcx. type_of ( item_def_id) . instantiate_identity ( ) ;
26
26
27
27
let finder = auto_trait:: AutoTraitFinder :: new ( tcx) ;
28
- let mut auto_trait_impls: Vec < _ > = cx
29
- . auto_traits
30
- . clone ( )
31
- . into_iter ( )
32
- . filter_map ( |trait_def_id| {
28
+ let auto_traits = std:: mem:: take ( & mut cx. auto_traits ) ;
29
+ let mut auto_trait_impls: Vec < _ > = auto_traits
30
+ . iter ( )
31
+ . filter_map ( |& trait_def_id| {
33
32
synthesize_auto_trait_impl (
34
33
cx,
35
34
ty,
@@ -41,6 +40,7 @@ pub(crate) fn synthesize_auto_trait_impls<'tcx>(
41
40
)
42
41
} )
43
42
. collect ( ) ;
43
+ cx. auto_traits = auto_traits;
44
44
// We are only interested in case the type *doesn't* implement the `Sized` trait.
45
45
if !ty. is_sized ( tcx, typing_env)
46
46
&& let Some ( sized_trait_def_id) = tcx. lang_items ( ) . sized_trait ( )
You can’t perform that action at this time.
0 commit comments