mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Rename function name in comments
This commit is contained in:
parent
a141d29612
commit
462c74007e
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user