Auto merge of #120100 - oli-obk:astconv_lifetimes, r=BoxyUwU

Don't forget that the lifetime on hir types is `'tcx`

This PR just tracks the `'tcx` lifetime to wherever the original objects actually have that lifetime. This code is needed for https://github.com/rust-lang/rust/pull/107606 (now #120131) so that `ast_ty_to_ty` can invoke `lit_to_const` on an argument passed to it. Currently the argument is `&hir::Ty<'_>`, but after this PR it is `&'tcx hir::Ty<'tcx>`.
This commit is contained in:
bors
2024-01-21 00:33:43 +00:00
26 changed files with 105 additions and 98 deletions

View File

@@ -1790,7 +1790,7 @@ fn receiver_is_implemented<'tcx>(
fn check_variances_for_type_defn<'tcx>(
tcx: TyCtxt<'tcx>,
item: &hir::Item<'tcx>,
hir_generics: &hir::Generics<'_>,
hir_generics: &hir::Generics<'tcx>,
) {
let identity_args = ty::GenericArgs::identity_for_item(tcx, item.owner_id);