提交 b813718f 编写于 作者: L leonardo.yvens

Refactor away `fn must_be_known_in_context`

上级 f8c14046
......@@ -4940,18 +4940,14 @@ pub fn structurally_resolved_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
if !ty.is_ty_var() {
ty
} else {
self.must_be_known_in_context(sp, ty)
}
}
fn must_be_known_in_context(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
if !self.is_tainted_by_errors() {
type_error_struct!(self.tcx.sess, sp, ty, E0619,
"the type of this value must be known in this context")
.emit();
if !self.is_tainted_by_errors() {
type_error_struct!(self.tcx.sess, sp, ty, E0619,
"the type of this value must be known in this context")
.emit();
}
self.demand_suptype(sp, self.tcx.types.err, ty);
self.tcx.types.err
}
self.demand_suptype(sp, self.tcx.types.err, ty);
self.tcx.types.err
}
fn with_breakable_ctxt<F: FnOnce() -> R, R>(&self, id: ast::NodeId,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册