1
Fork 0

Rollup merge of #137763 - compiler-errors:ty-nits, r=BoxyUwU

Use `mk_ty_from_kind` a bit less, clean up lifetime handling in borrowck

r? ``@BoxyUwU``

Pulled out of my attempt to turn that `*const dyn Tr + '_` casting into a lint (which failed lmao)
This commit is contained in:
Matthias Krüger 2025-03-01 11:34:00 +01:00 committed by GitHub
commit 1d9992d4d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 37 deletions

View file

@ -224,7 +224,7 @@ impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<D> for Ty<'tcx> {
})
} else {
let tcx = decoder.interner();
tcx.mk_ty_from_kind(rustc_type_ir::TyKind::decode(decoder))
tcx.mk_ty_from_kind(ty::TyKind::decode(decoder))
}
}
}

View file

@ -462,7 +462,7 @@ impl<'tcx> Ty<'tcx> {
#[inline]
pub fn new_param(tcx: TyCtxt<'tcx>, index: u32, name: Symbol) -> Ty<'tcx> {
tcx.mk_ty_from_kind(Param(ParamTy { index, name }))
Ty::new(tcx, Param(ParamTy { index, name }))
}
#[inline]