Merge if and match expressions that don't make sense to have separated
This commit is contained in:
parent
e2efb6ab29
commit
b92840accf
1 changed files with 10 additions and 15 deletions
|
@ -214,7 +214,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
VarValue::Value(cur_region) => {
|
VarValue::Value(cur_region) => {
|
||||||
let lub = match *cur_region {
|
match *cur_region {
|
||||||
// If this empty region is from a universe that can name the
|
// If this empty region is from a universe that can name the
|
||||||
// placeholder universe, then the LUB is the Placeholder region
|
// placeholder universe, then the LUB is the Placeholder region
|
||||||
// (which is the cur_region). Otherwise, the LUB is the Static
|
// (which is the cur_region). Otherwise, the LUB is the Static
|
||||||
|
@ -222,15 +222,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
RePlaceholder(placeholder)
|
RePlaceholder(placeholder)
|
||||||
if !a_universe.can_name(placeholder.universe) =>
|
if !a_universe.can_name(placeholder.universe) =>
|
||||||
{
|
{
|
||||||
self.tcx().lifetimes.re_static
|
let lub = self.tcx().lifetimes.re_static;
|
||||||
}
|
|
||||||
|
|
||||||
_ => cur_region,
|
|
||||||
};
|
|
||||||
|
|
||||||
if lub == cur_region {
|
|
||||||
false
|
|
||||||
} else {
|
|
||||||
debug!(
|
debug!(
|
||||||
"Expanding value of {:?} from {:?} to {:?}",
|
"Expanding value of {:?} from {:?} to {:?}",
|
||||||
b_vid, cur_region, lub
|
b_vid, cur_region, lub
|
||||||
|
@ -239,6 +231,9 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||||
*b_data = VarValue::Value(lub);
|
*b_data = VarValue::Value(lub);
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ => false,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VarValue::ErrorValue => false,
|
VarValue::ErrorValue => false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue