@@ -737,8 +737,8 @@ fn super_predicates_of<'a, 'tcx>(
737
737
}
738
738
739
739
fn trait_def < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , def_id : DefId ) -> & ' tcx ty:: TraitDef {
740
- let node_id = tcx. hir ( ) . as_local_node_id ( def_id) . unwrap ( ) ;
741
- let item = tcx. hir ( ) . expect_item ( node_id ) ;
740
+ let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
741
+ let item = tcx. hir ( ) . expect_item_by_hir_id ( hir_id ) ;
742
742
743
743
let ( is_auto, unsafety) = match item. node {
744
744
hir:: ItemKind :: Trait ( is_auto, unsafety, ..) => ( is_auto == hir:: IsAuto :: Yes , unsafety) ,
@@ -1509,8 +1509,8 @@ fn impl_trait_ref<'a, 'tcx>(
1509
1509
) -> Option < ty:: TraitRef < ' tcx > > {
1510
1510
let icx = ItemCtxt :: new ( tcx, def_id) ;
1511
1511
1512
- let node_id = tcx. hir ( ) . as_local_node_id ( def_id) . unwrap ( ) ;
1513
- match tcx. hir ( ) . expect_item ( node_id ) . node {
1512
+ let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
1513
+ match tcx. hir ( ) . expect_item_by_hir_id ( hir_id ) . node {
1514
1514
hir:: ItemKind :: Impl ( .., ref opt_trait_ref, _, _) => {
1515
1515
opt_trait_ref. as_ref ( ) . map ( |ast_trait_ref| {
1516
1516
let selfty = tcx. type_of ( def_id) ;
@@ -1522,8 +1522,8 @@ fn impl_trait_ref<'a, 'tcx>(
1522
1522
}
1523
1523
1524
1524
fn impl_polarity < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > , def_id : DefId ) -> hir:: ImplPolarity {
1525
- let node_id = tcx. hir ( ) . as_local_node_id ( def_id) . unwrap ( ) ;
1526
- match tcx. hir ( ) . expect_item ( node_id ) . node {
1525
+ let hir_id = tcx. hir ( ) . as_local_hir_id ( def_id) . unwrap ( ) ;
1526
+ match tcx. hir ( ) . expect_item_by_hir_id ( hir_id ) . node {
1527
1527
hir:: ItemKind :: Impl ( _, polarity, ..) => polarity,
1528
1528
ref item => bug ! ( "impl_polarity: {:?} not an impl" , item) ,
1529
1529
}
0 commit comments