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> {
471471 // all regions are subregions of static, so we can ignore this
472472 }
473473 ( 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+ }
475477 }
476478 ( _, ReVar ( sup_id) ) => {
477479 self . add_constraint ( Constraint :: RegSubVar ( sub, sup_id) , origin) ;
@@ -480,7 +482,9 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
480482 self . add_constraint ( Constraint :: VarSubReg ( sub_id, sup) , origin) ;
481483 }
482484 _ => {
483- self . add_constraint ( Constraint :: RegSubReg ( sub, sup) , origin) ;
485+ if sub != sup {
486+ self . add_constraint ( Constraint :: RegSubReg ( sub, sup) , origin) ;
487+ }
484488 }
485489 }
486490 }
You can’t perform that action at this time.
0 commit comments