@@ -21,7 +21,7 @@ use semcheck::changes::ChangeType::*;
21
21
use semcheck:: changes:: ChangeSet ;
22
22
use semcheck:: mapping:: { IdMapping , NameMapping } ;
23
23
use semcheck:: mismatch:: Mismatch ;
24
- use semcheck:: translate:: translate_item_type;
24
+ use semcheck:: translate:: { translate_item_type, translate_param_env } ;
25
25
26
26
use std:: collections:: { BTreeMap , HashSet , VecDeque } ;
27
27
@@ -45,7 +45,7 @@ pub fn run_analysis<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, old: DefId, new: DefI
45
45
46
46
// third pass
47
47
for ( old, new) in id_mapping. items ( ) {
48
- diff_bounds ( & mut changes, tcx, old. def_id ( ) , new. def_id ( ) ) ;
48
+ diff_bounds ( & mut changes, & id_mapping , tcx, old, new) ;
49
49
}
50
50
51
51
// fourth pass
@@ -540,21 +540,36 @@ fn diff_generics(changes: &mut ChangeSet,
540
540
// being exported.
541
541
542
542
/// Given two items, compare the bounds on their type and region parameters.
543
- fn diff_bounds < ' a , ' tcx > ( _changes : & mut ChangeSet ,
544
- _tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
545
- _old : DefId ,
546
- _new : DefId )
547
- -> ( Vec < ChangeType < ' tcx > > , Vec < ( DefId , DefId ) > )
548
- {
543
+ fn diff_bounds < ' a , ' tcx > ( changes : & mut ChangeSet ,
544
+ id_mapping : & IdMapping ,
545
+ tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
546
+ old : Def ,
547
+ new : Def ) {
548
+ use rustc:: hir:: def:: Def :: Macro ;
549
+
550
+ let old_def_id = old. def_id ( ) ;
551
+ let new_def_id = new. def_id ( ) ;
552
+
553
+ if changes. item_breaking ( old_def_id) ||
554
+ id_mapping. get_trait_def ( & old_def_id)
555
+ . map_or ( false , |did| changes. trait_item_breaking ( did) ) {
556
+ return ;
557
+ }
558
+
559
+ if let Macro ( _, _) = old {
560
+ return ; // TODO: more cases like this one
561
+ }
562
+
563
+ let old_param_env =
564
+ translate_param_env ( id_mapping, tcx, old_def_id, tcx. param_env ( old_def_id) ) ;
565
+
549
566
/* let old_param_env = tcx.param_env(old);
550
567
let res = Default::default();
551
568
552
569
let old_preds = tcx.predicates_of(old).predicates;
553
570
let new_preds = tcx.predicates_of(new).predicates;
554
571
555
572
res */
556
-
557
- Default :: default ( )
558
573
}
559
574
560
575
// Below functions constitute the fourth and last pass of analysis, in which the types of
0 commit comments