Put param_env into infcx.

Because they get passed around together a lot.
This commit is contained in:
Nicholas Nethercote
2024-11-01 13:51:00 +11:00
parent c9283f8fa9
commit af50fe407e
14 changed files with 72 additions and 81 deletions

View File

@@ -305,7 +305,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
let Some(copy_trait_def) = self.infcx.tcx.lang_items().copy_trait() else { return false };
// This is only going to be ambiguous if there are incoherent impls, because otherwise
// ambiguity should never happen in MIR.
self.infcx.type_implements_trait(copy_trait_def, [ty], self.param_env).may_apply()
self.infcx.type_implements_trait(copy_trait_def, [ty], self.infcx.param_env).may_apply()
}
fn report_cannot_move_from_static(&mut self, place: Place<'tcx>, span: Span) -> Diag<'infcx> {