From 462c74007eea1b71a62aa5565352e82ef481a129 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 24 Jun 2021 14:21:50 +0900 Subject: [PATCH] Rename function name in comments --- compiler/rustc_middle/src/ty/context.rs | 6 +++--- compiler/rustc_typeck/src/collect/type_of.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index bf5176f6585..1988bc17376 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -1499,12 +1499,12 @@ impl<'tcx> TyCtxt<'tcx> { } pub fn return_type_impl_trait(self, scope_def_id: LocalDefId) -> Option<(Ty<'tcx>, Span)> { - // HACK: `type_of_def_id()` will fail on these (#55796), so return `None`. + // HACK: `type_of()` will fail on these (#55796), so return `None`. let hir_id = self.hir().local_def_id_to_hir_id(scope_def_id); match self.hir().get(hir_id) { Node::Item(item) => { match item.kind { - ItemKind::Fn(..) => { /* `type_of_def_id()` will work */ } + ItemKind::Fn(..) => { /* `type_of()` will work */ } _ => { return None; } @@ -1516,7 +1516,7 @@ impl<'tcx> TyCtxt<'tcx> { return None; } } - _ => { /* `type_of_def_id()` will work or panic */ } + _ => { /* `type_of()` will work or panic */ } } let ret_ty = self.type_of(scope_def_id); diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs index 78fa8074a64..ee84974cb73 100644 --- a/compiler/rustc_typeck/src/collect/type_of.rs +++ b/compiler/rustc_typeck/src/collect/type_of.rs @@ -492,7 +492,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> { x => tcx.ty_error_with_message( DUMMY_SP, - &format!("unexpected const parent in type_of_def_id(): {:?}", x), + &format!("unexpected const parent in type_of(): {:?}", x), ), } } @@ -504,7 +504,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> { }, x => { - bug!("unexpected sort of node in type_of_def_id(): {:?}", x); + bug!("unexpected sort of node in type_of(): {:?}", x); } } }