File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler/rustc_infer/src/infer/region_constraints Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -471,7 +471,9 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
471
471
// all regions are subregions of static, so we can ignore this
472
472
}
473
473
( ReVar ( sub_id) , ReVar ( sup_id) ) => {
474
- self . add_constraint ( Constraint :: VarSubVar ( sub_id, sup_id) , origin) ;
474
+ if sub_id != sup_id {
475
+ self . add_constraint ( Constraint :: VarSubVar ( sub_id, sup_id) , origin) ;
476
+ }
475
477
}
476
478
( _, ReVar ( sup_id) ) => {
477
479
self . add_constraint ( Constraint :: RegSubVar ( sub, sup_id) , origin) ;
@@ -480,7 +482,9 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
480
482
self . add_constraint ( Constraint :: VarSubReg ( sub_id, sup) , origin) ;
481
483
}
482
484
_ => {
483
- self . add_constraint ( Constraint :: RegSubReg ( sub, sup) , origin) ;
485
+ if sub != sup {
486
+ self . add_constraint ( Constraint :: RegSubReg ( sub, sup) , origin) ;
487
+ }
484
488
}
485
489
}
486
490
}
You can’t perform that action at this time.
0 commit comments