Refactor away fn must_be_known_in_context
This commit is contained in:
parent
f8c140465f
commit
b813718f6d
1 changed files with 7 additions and 11 deletions
|
|
@ -4940,20 +4940,16 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
if !ty.is_ty_var() {
|
||||
ty
|
||||
} else {
|
||||
self.must_be_known_in_context(sp, ty)
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
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,
|
||||
ctxt: BreakableCtxt<'gcx, 'tcx>, f: F)
|
||||
-> (BreakableCtxt<'gcx, 'tcx>, R) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue