rename create_raw_ty -> handle_raw_ty

This commit is contained in:
Ali MJ Al-Nasrawy 2022-11-23 11:30:58 +03:00
parent 8afd3c47a8
commit dca15fd5b9
2 changed files with 6 additions and 6 deletions

View File

@ -369,14 +369,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}
pub fn create_raw_ty(&self, span: Span, ty: Ty<'tcx>) -> RawTy<'tcx> {
pub fn handle_raw_ty(&self, span: Span, ty: Ty<'tcx>) -> RawTy<'tcx> {
RawTy { raw: ty, normalized: self.normalize(span, ty) }
}
pub fn to_ty(&self, ast_t: &hir::Ty<'_>) -> RawTy<'tcx> {
let t = <dyn AstConv<'_>>::ast_ty_to_ty(self, ast_t);
self.register_wf_obligation(t.into(), ast_t.span, traits::WellFormed(None));
self.create_raw_ty(ast_t.span, t)
self.handle_raw_ty(ast_t.span, t)
}
pub fn to_ty_saving_user_provided_ty(&self, ast_ty: &hir::Ty<'_>) -> Ty<'tcx> {
@ -767,7 +767,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// We manually call `register_wf_obligation` in the success path
// below.
let ty = <dyn AstConv<'_>>::ast_ty_to_ty_in_path(self, qself);
(self.create_raw_ty(span, ty), qself, segment)
(self.handle_raw_ty(span, ty), qself, segment)
}
QPath::LangItem(..) => {
bug!("`resolve_ty_and_res_fully_qualified_call` called on `LangItem`")

View File

@ -1683,7 +1683,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
QPath::Resolved(ref maybe_qself, ref path) => {
let self_ty = maybe_qself.as_ref().map(|qself| self.to_ty(qself).raw);
let ty = <dyn AstConv<'_>>::res_to_ty(self, self_ty, path, true);
(path.res, self.create_raw_ty(path_span, ty))
(path.res, self.handle_raw_ty(path_span, ty))
}
QPath::TypeRelative(ref qself, ref segment) => {
let ty = self.to_ty(qself);
@ -1692,7 +1692,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
self, hir_id, path_span, ty.raw, qself, segment, true,
);
let ty = result.map(|(ty, _, _)| ty).unwrap_or_else(|_| self.tcx().ty_error());
let ty = self.create_raw_ty(path_span, ty);
let ty = self.handle_raw_ty(path_span, ty);
let result = result.map(|(_, kind, def_id)| (kind, def_id));
// Write back the new resolution.
@ -1702,7 +1702,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
QPath::LangItem(lang_item, span, id) => {
let (res, ty) = self.resolve_lang_item_path(lang_item, span, hir_id, id);
(res, self.create_raw_ty(path_span, ty))
(res, self.handle_raw_ty(path_span, ty))
}
}
}