File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
compiler/rustc_middle/src/hir/map Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,7 @@ impl<'hir> Map<'hir> {
408408 /// item (possibly associated), a closure, or a `hir::AnonConst`.
409409 pub fn body_owner ( self , BodyId { hir_id } : BodyId ) -> HirId {
410410 let parent = self . get_parent_node ( hir_id) ;
411- assert ! ( self . find( parent) . map_or( false , |n| is_body_owner( n, hir_id) ) ) ;
411+ assert ! ( self . find( parent) . map_or( false , |n| is_body_owner( n, hir_id) ) , "{hir_id:?}" ) ;
412412 parent
413413 }
414414
@@ -419,7 +419,7 @@ impl<'hir> Map<'hir> {
419419 /// Given a `LocalDefId`, returns the `BodyId` associated with it,
420420 /// if the node is a body owner, otherwise returns `None`.
421421 pub fn maybe_body_owned_by ( self , id : LocalDefId ) -> Option < BodyId > {
422- self . get_if_local ( id. to_def_id ( ) ) . map ( associated_body) . flatten ( )
422+ self . find_by_def_id ( id) . and_then ( associated_body)
423423 }
424424
425425 /// Given a body owner's id, returns the `BodyId` associated with it.
You can’t perform that action at this time.
0 commit comments