@@ -2732,21 +2732,21 @@ fn param_env<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
2732
2732
// are any errors at that point, so after type checking you can be
2733
2733
// sure that this will succeed without errors anyway.
2734
2734
2735
- let id = tcx. hir . as_local_node_id ( def_id) . unwrap ( ) ;
2736
- debug ! ( "param_env: handling def_id={:?}, id={:?}" , def_id, id) ;
2737
-
2738
- if let Some ( hir :: map :: NodeItem ( item ) ) = tcx . hir . find ( id ) {
2739
- debug ! ( " param_env: self node: {:?}" , item. node) ;
2740
- if let hir :: ItemTrait ( .. ) = item . node {
2741
- debug ! ( " param_env: self is trait!" ) ;
2742
- let trait_ref = ty :: TraitRef {
2743
- def_id : def_id ,
2744
- substs : Substs :: identity_for_item ( tcx , def_id )
2745
- } ;
2746
- predicates . push ( trait_ref . to_poly_trait_ref ( ) . to_predicate ( ) ) ;
2735
+ if let Some ( id ) = tcx. hir . as_local_node_id ( def_id) {
2736
+ debug ! ( "param_env: handling def_id={:?}, id={:?}" , def_id, id) ;
2737
+ if let Some ( hir :: map :: NodeItem ( item ) ) = tcx . hir . find ( id ) {
2738
+ debug ! ( " param_env: self node: {:?}" , item . node ) ;
2739
+ if let hir :: ItemTrait ( .. ) = item. node {
2740
+ debug ! ( " param_env: self is trait!" ) ;
2741
+ let trait_ref = ty :: TraitRef {
2742
+ def_id : def_id ,
2743
+ substs : Substs :: identity_for_item ( tcx , def_id )
2744
+ } ;
2745
+ predicates . push ( trait_ref . to_poly_trait_ref ( ) . to_predicate ( ) ) ;
2746
+ }
2747
2747
}
2748
+ debug ! ( " param_env predicates: {:?}" , predicates) ;
2748
2749
}
2749
- debug ! ( " param_env predicates: {:?}" , predicates) ;
2750
2750
2751
2751
let unnormalized_env = ty:: ParamEnv :: new ( tcx. intern_predicates ( & predicates) ,
2752
2752
traits:: Reveal :: UserFacing ) ;
0 commit comments