Rename function name in comments
This commit is contained in:
parent
a141d29612
commit
462c74007e
2 changed files with 5 additions and 5 deletions
|
@ -1499,12 +1499,12 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn return_type_impl_trait(self, scope_def_id: LocalDefId) -> Option<(Ty<'tcx>, Span)> {
|
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);
|
let hir_id = self.hir().local_def_id_to_hir_id(scope_def_id);
|
||||||
match self.hir().get(hir_id) {
|
match self.hir().get(hir_id) {
|
||||||
Node::Item(item) => {
|
Node::Item(item) => {
|
||||||
match item.kind {
|
match item.kind {
|
||||||
ItemKind::Fn(..) => { /* `type_of_def_id()` will work */ }
|
ItemKind::Fn(..) => { /* `type_of()` will work */ }
|
||||||
_ => {
|
_ => {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
@ -1516,7 +1516,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
return None;
|
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);
|
let ret_ty = self.type_of(scope_def_id);
|
||||||
|
|
|
@ -492,7 +492,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
|
||||||
|
|
||||||
x => tcx.ty_error_with_message(
|
x => tcx.ty_error_with_message(
|
||||||
DUMMY_SP,
|
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 => {
|
x => {
|
||||||
bug!("unexpected sort of node in type_of_def_id(): {:?}", x);
|
bug!("unexpected sort of node in type_of(): {:?}", x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue