File tree 1 file changed +2
-2
lines changed
compiler/rustc_middle/src/hir/map
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> {
408
408
/// item (possibly associated), a closure, or a `hir::AnonConst`.
409
409
pub fn body_owner ( self , BodyId { hir_id } : BodyId ) -> HirId {
410
410
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:?}" ) ;
412
412
parent
413
413
}
414
414
@@ -419,7 +419,7 @@ impl<'hir> Map<'hir> {
419
419
/// Given a `LocalDefId`, returns the `BodyId` associated with it,
420
420
/// if the node is a body owner, otherwise returns `None`.
421
421
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)
423
423
}
424
424
425
425
/// Given a body owner's id, returns the `BodyId` associated with it.
You can’t perform that action at this time.
0 commit comments