Rollup merge of #120872 - petrochenkov:opthirpar, r=cjgillot
hir: Refactor getters for HIR parents See individual commits. I ended up removing on of the FIXMEs from https://github.com/rust-lang/rust/pull/120206 instead of addressing it.
This commit is contained in:
commit
4c154a1a48
79 changed files with 263 additions and 342 deletions
|
@ -3508,7 +3508,7 @@ impl<'hir> Node<'hir> {
|
|||
/// ```ignore (illustrative)
|
||||
/// ctor
|
||||
/// .ctor_hir_id()
|
||||
/// .and_then(|ctor_id| tcx.hir().find_parent(ctor_id))
|
||||
/// .map(|ctor_id| tcx.parent_hir_node(ctor_id))
|
||||
/// .and_then(|parent| parent.ident())
|
||||
/// ```
|
||||
pub fn ident(&self) -> Option<Ident> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue