Use correct param-env in MissingCopyImplementations · rust-lang/rust@8369dbb (original) (raw)

`@@ -674,11 +674,10 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {

`

674

674

`return;

`

675

675

`}

`

676

676

`}

`

677

``

`-

let param_env = ty::ParamEnv::empty();

`

678

``

`-

if ty.is_copy_modulo_regions(cx.tcx, param_env) {

`

``

677

`+

if ty.is_copy_modulo_regions(cx.tcx, cx.param_env) {

`

679

678

`return;

`

680

679

`}

`

681

``

`-

if type_implements_negative_copy_modulo_regions(cx.tcx, ty, param_env) {

`

``

680

`+

if type_implements_negative_copy_modulo_regions(cx.tcx, ty, cx.param_env) {

`

682

681

`return;

`

683

682

`}

`

684

683

`if def.is_variant_list_non_exhaustive()

`

`@@ -694,7 +693,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {

`

694

693

`.tcx

`

695

694

`.infer_ctxt()

`

696

695

`.build()

`

697

``

`-

.type_implements_trait(iter_trait, [ty], param_env)

`

``

696

`+

.type_implements_trait(iter_trait, [ty], cx.param_env)

`

698

697

`.must_apply_modulo_regions()

`

699

698

`{

`

700

699

`return;

`

`@@ -711,7 +710,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {

`

711

710

``

712

711

`if type_allowed_to_implement_copy(

`

713

712

` cx.tcx,

`

714

``

`-

param_env,

`

``

713

`+

cx.param_env,

`

715

714

` ty,

`

716

715

` traits::ObligationCause::misc(item.span, item.owner_id.def_id),

`

717

716

`)

`