Skip to content

Commit b813718

Browse files
committed
Refactor away fn must_be_known_in_context
1 parent f8c1404 commit b813718

File tree

1 file changed

+7
-11
lines changed
  • src/librustc_typeck/check

1 file changed

+7
-11
lines changed

src/librustc_typeck/check/mod.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -4940,18 +4940,14 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
49404940
if !ty.is_ty_var() {
49414941
ty
49424942
} else {
4943-
self.must_be_known_in_context(sp, ty)
4944-
}
4945-
}
4946-
4947-
fn must_be_known_in_context(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
4948-
if !self.is_tainted_by_errors() {
4949-
type_error_struct!(self.tcx.sess, sp, ty, E0619,
4950-
"the type of this value must be known in this context")
4951-
.emit();
4943+
if !self.is_tainted_by_errors() {
4944+
type_error_struct!(self.tcx.sess, sp, ty, E0619,
4945+
"the type of this value must be known in this context")
4946+
.emit();
4947+
}
4948+
self.demand_suptype(sp, self.tcx.types.err, ty);
4949+
self.tcx.types.err
49524950
}
4953-
self.demand_suptype(sp, self.tcx.types.err, ty);
4954-
self.tcx.types.err
49554951
}
49564952

49574953
fn with_breakable_ctxt<F: FnOnce() -> R, R>(&self, id: ast::NodeId,

0 commit comments

Comments
 (0)