Skip to content

Commit

Permalink
Merge if and match expressions that don't make sense to have separated
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Aug 26, 2023
1 parent e2efb6a commit b92840a
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,30 +214,25 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
true
}
VarValue::Value(cur_region) => {
let lub = match *cur_region {
match *cur_region {
// If this empty region is from a universe that can name the
// placeholder universe, then the LUB is the Placeholder region
// (which is the cur_region). Otherwise, the LUB is the Static
// lifetime.
RePlaceholder(placeholder)
if !a_universe.can_name(placeholder.universe) =>
{
self.tcx().lifetimes.re_static
let lub = self.tcx().lifetimes.re_static;
debug!(
"Expanding value of {:?} from {:?} to {:?}",
b_vid, cur_region, lub
);

*b_data = VarValue::Value(lub);
true
}

_ => cur_region,
};

if lub == cur_region {
false
} else {
debug!(
"Expanding value of {:?} from {:?} to {:?}",
b_vid, cur_region, lub
);

*b_data = VarValue::Value(lub);
true
_ => false,
}
}

Expand Down

0 comments on commit b92840a

Please sign in to comment.