@@ -203,7 +203,7 @@ impl<'tcx> ty::ParamEnv<'tcx> {
203
203
let cause = ObligationCause { span, ..ObligationCause :: dummy ( ) } ;
204
204
let ctx = traits:: FulfillmentContext :: new ( ) ;
205
205
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) {
207
207
infringing. push ( field) ;
208
208
}
209
209
Err ( errors) => {
@@ -628,12 +628,12 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
628
628
/// does copies even when the type actually doesn't satisfy the
629
629
/// full requirements for the `Copy` trait (cc #29149) -- this
630
630
/// 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 ) )
637
637
}
638
638
639
639
/// 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>,
947
947
// `ManuallyDrop` doesn't have a destructor regardless of field types.
948
948
ty:: Adt ( def, _) if Some ( def. did ) == tcx. lang_items ( ) . manually_drop ( ) => false ,
949
949
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
951
951
// normalized version of the type, and therefore will definitely
952
952
// know whether the type implements Copy (and thus needs no
953
953
// 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 ,
955
955
956
956
// ... (issue #22536 continued) but as an optimization, still use
957
957
// prior logic of asking for the structural "may drop".
0 commit comments