Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errors

Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions

Functions in answer:

- `Ty::is_freeze`
- `Ty::is_sized`
- `Ty::is_unpin`
- `Ty::is_copy_modulo_regions`

This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3

r? `@compiler-errors`
This commit is contained in:
Guillaume Gomez 2022-10-29 14:18:03 +02:00 committed by GitHub
commit 2414a4c31a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 191 additions and 172 deletions

View file

@ -69,7 +69,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
let ty = self.resolve_vars_if_possible(ty);
if !(param_env, ty).needs_infer() {
return ty.is_copy_modulo_regions(self.tcx.at(span), param_env);
return ty.is_copy_modulo_regions(self.tcx, param_env);
}
let copy_def_id = self.tcx.require_lang_item(LangItem::Copy, None);