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>(
2525 let ty = tcx. type_of ( item_def_id) . instantiate_identity ( ) ;
2626
2727 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| {
3332 synthesize_auto_trait_impl (
3433 cx,
3534 ty,
@@ -41,6 +40,7 @@ pub(crate) fn synthesize_auto_trait_impls<'tcx>(
4140 )
4241 } )
4342 . collect ( ) ;
43+ cx. auto_traits = auto_traits;
4444 // We are only interested in case the type *doesn't* implement the `Sized` trait.
4545 if !ty. is_sized ( tcx, typing_env)
4646 && let Some ( sized_trait_def_id) = tcx. lang_items ( ) . sized_trait ( )
You can’t perform that action at this time.
0 commit comments