Skip to content

Commit b92840a

Browse files
committed
Merge if and match expressions that don't make sense to have separated
1 parent e2efb6a commit b92840a

File tree

1 file changed

+10
-15
lines changed
  • compiler/rustc_infer/src/infer/lexical_region_resolve

1 file changed

+10
-15
lines changed

compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs

+10-15
Original file line numberDiff line numberDiff line change
@@ -214,30 +214,25 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
214214
true
215215
}
216216
VarValue::Value(cur_region) => {
217-
let lub = match *cur_region {
217+
match *cur_region {
218218
// If this empty region is from a universe that can name the
219219
// placeholder universe, then the LUB is the Placeholder region
220220
// (which is the cur_region). Otherwise, the LUB is the Static
221221
// lifetime.
222222
RePlaceholder(placeholder)
223223
if !a_universe.can_name(placeholder.universe) =>
224224
{
225-
self.tcx().lifetimes.re_static
225+
let lub = self.tcx().lifetimes.re_static;
226+
debug!(
227+
"Expanding value of {:?} from {:?} to {:?}",
228+
b_vid, cur_region, lub
229+
);
230+
231+
*b_data = VarValue::Value(lub);
232+
true
226233
}
227234

228-
_ => cur_region,
229-
};
230-
231-
if lub == cur_region {
232-
false
233-
} else {
234-
debug!(
235-
"Expanding value of {:?} from {:?} to {:?}",
236-
b_vid, cur_region, lub
237-
);
238-
239-
*b_data = VarValue::Value(lub);
240-
true
235+
_ => false,
241236
}
242237
}
243238

0 commit comments

Comments
 (0)