Skip to content

Commit d87644c

Browse files
committed
Small inference fix
As per comment: #39297 (comment)
1 parent 29dece1 commit d87644c

File tree

3 files changed

+0
-47
lines changed

3 files changed

+0
-47
lines changed

src/librustc_typeck/check/mod.rs

-11
Original file line numberDiff line numberDiff line change
@@ -4156,17 +4156,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
41564156
};
41574157

41584158
if self.diverges.get().always() {
4159-
if let ExpectHasType(ety) = expected {
4160-
// Avoid forcing a type (only `!` for now) in unreachable code.
4161-
// FIXME(aburka) do we need this special case? and should it be is_uninhabited?
4162-
if !ety.is_never() {
4163-
if let Some(ref e) = blk.expr {
4164-
// Coerce the tail expression to the right type.
4165-
self.demand_coerce(e, ty, ety);
4166-
}
4167-
}
4168-
}
4169-
41704159
ty = self.next_diverging_ty_var(TypeVariableOrigin::DivergingBlockExpr(blk.span));
41714160
} else if let ExpectHasType(ety) = expected {
41724161
if let Some(ref e) = blk.expr {

src/test/compile-fail/issue-10176.rs

-19
This file was deleted.

src/test/compile-fail/issue-5500.rs

-17
This file was deleted.

0 commit comments

Comments
 (0)