lowering: move wrap_in_try_constructor -> expr.rs

This commit is contained in:
Mazdak Farrokhzad 2019-08-10 15:11:22 +02:00
parent 8ddd173811
commit c8b3b2e052
2 changed files with 11 additions and 12 deletions

View File

@ -5113,18 +5113,6 @@ impl<'a> LoweringContext<'a> {
)
}
}
fn wrap_in_try_constructor(
&mut self,
method: Symbol,
e: hir::Expr,
unstable_span: Span,
) -> P<hir::Expr> {
let path = &[sym::ops, sym::Try, method];
let from_err = P(self.expr_std_path(unstable_span, path, None,
ThinVec::new()));
P(self.expr_call(e.span, from_err, hir_vec![e]))
}
}
fn body_ids(bodies: &BTreeMap<hir::BodyId, hir::Body>) -> Vec<hir::BodyId> {

View File

@ -368,6 +368,17 @@ impl LoweringContext<'_> {
})
}
fn wrap_in_try_constructor(
&mut self,
method: Symbol,
e: hir::Expr,
unstable_span: Span,
) -> P<hir::Expr> {
let path = &[sym::ops, sym::Try, method];
let from_err = P(self.expr_std_path(unstable_span, path, None, ThinVec::new()));
P(self.expr_call(e.span, from_err, hir_vec![e]))
}
/// Desugar `<expr>.await` into:
/// ```rust
/// {