@@ -203,7 +203,7 @@ impl<'tcx> ty::ParamEnv<'tcx> {
203203 let cause = ObligationCause { span, ..ObligationCause :: dummy ( ) } ;
204204 let ctx = traits:: FulfillmentContext :: new ( ) ;
205205 match traits:: fully_normalize ( & infcx, ctx, cause, self , & ty) {
206- Ok ( ty) => if infcx. type_moves_by_default ( self , ty, span) {
206+ Ok ( ty) => if ! infcx. type_is_copy_modulo_regions ( self , ty, span) {
207207 infringing. push ( field) ;
208208 }
209209 Err ( errors) => {
@@ -628,12 +628,12 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
628628 /// does copies even when the type actually doesn't satisfy the
629629 /// full requirements for the `Copy` trait (cc #29149) -- this
630630 /// winds up being reported as an error during NLL borrow check.
631- pub fn moves_by_default ( & ' tcx self ,
632- tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
633- param_env : ty:: ParamEnv < ' tcx > ,
634- span : Span )
635- -> bool {
636- ! tcx. at ( span) . is_copy_raw ( param_env. and ( self ) )
631+ pub fn is_copy_modulo_regions ( & ' tcx self ,
632+ tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
633+ param_env : ty:: ParamEnv < ' tcx > ,
634+ span : Span )
635+ -> bool {
636+ tcx. at ( span) . is_copy_raw ( param_env. and ( self ) )
637637 }
638638
639639 /// Checks whether values of this type `T` have a size known at
@@ -947,11 +947,11 @@ fn needs_drop_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
947947 // `ManuallyDrop` doesn't have a destructor regardless of field types.
948948 ty:: Adt ( def, _) if Some ( def. did ) == tcx. lang_items ( ) . manually_drop ( ) => false ,
949949
950- // Issue #22536: We first query type_moves_by_default . It sees a
950+ // Issue #22536: We first query `is_copy_modulo_regions` . It sees a
951951 // normalized version of the type, and therefore will definitely
952952 // know whether the type implements Copy (and thus needs no
953953 // cleanup/drop/zeroing) ...
954- _ if ! ty. moves_by_default ( tcx, param_env, DUMMY_SP ) => false ,
954+ _ if ty. is_copy_modulo_regions ( tcx, param_env, DUMMY_SP ) => false ,
955955
956956 // ... (issue #22536 continued) but as an optimization, still use
957957 // prior logic of asking for the structural "may drop".
0 commit comments