MIR typeck: rustfmt
This commit is contained in:
parent
034018cd90
commit
37945fe3e8
1 changed files with 4 additions and 10 deletions
|
@ -391,10 +391,9 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
|
||||||
traits::ObligationCause::misc(span, self.body_id)
|
traits::ObligationCause::misc(span, self.body_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fully_perform_op<OP, R>(&self,
|
fn fully_perform_op<OP, R>(&self, op: OP) -> Result<R, TypeError<'tcx>>
|
||||||
op: OP)
|
where
|
||||||
-> Result<R, TypeError<'tcx>>
|
OP: FnOnce() -> InferResult<'tcx, R>,
|
||||||
where OP: FnOnce() -> InferResult<'tcx, R>
|
|
||||||
{
|
{
|
||||||
let mut fulfill_cx = FulfillmentContext::new();
|
let mut fulfill_cx = FulfillmentContext::new();
|
||||||
let InferOk { value, obligations } = self.infcx.commit_if_ok(|_| op())?;
|
let InferOk { value, obligations } = self.infcx.commit_if_ok(|_| op())?;
|
||||||
|
@ -405,12 +404,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
|
||||||
Ok(value)
|
Ok(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sub_types(
|
fn sub_types(&self, sub: Ty<'tcx>, sup: Ty<'tcx>, _at_location: Location) -> UnitResult<'tcx> {
|
||||||
&self,
|
|
||||||
sub: Ty<'tcx>,
|
|
||||||
sup: Ty<'tcx>,
|
|
||||||
_at_location: Location,
|
|
||||||
) -> UnitResult<'tcx> {
|
|
||||||
self.fully_perform_op(|| {
|
self.fully_perform_op(|| {
|
||||||
self.infcx
|
self.infcx
|
||||||
.at(&self.misc(self.last_span), self.param_env)
|
.at(&self.misc(self.last_span), self.param_env)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue