Skip to content

Commit

Permalink
Small inference fix
Browse files Browse the repository at this point in the history
As per comment: #39297 (comment)
  • Loading branch information
canndrew committed Feb 9, 2017
1 parent 29dece1 commit d87644c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 47 deletions.
11 changes: 0 additions & 11 deletions src/librustc_typeck/check/mod.rs
Expand Up @@ -4156,17 +4156,6 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
};

if self.diverges.get().always() {
if let ExpectHasType(ety) = expected {
// Avoid forcing a type (only `!` for now) in unreachable code.
// FIXME(aburka) do we need this special case? and should it be is_uninhabited?
if !ety.is_never() {
if let Some(ref e) = blk.expr {
// Coerce the tail expression to the right type.
self.demand_coerce(e, ty, ety);
}
}
}

ty = self.next_diverging_ty_var(TypeVariableOrigin::DivergingBlockExpr(blk.span));
} else if let ExpectHasType(ety) = expected {
if let Some(ref e) = blk.expr {
Expand Down
19 changes: 0 additions & 19 deletions src/test/compile-fail/issue-10176.rs

This file was deleted.

17 changes: 0 additions & 17 deletions src/test/compile-fail/issue-5500.rs

This file was deleted.

0 comments on commit d87644c

Please sign in to comment.