Skip to content

Commit c8b3b2e

Browse files
committed
lowering: move wrap_in_try_constructor -> expr.rs
1 parent 8ddd173 commit c8b3b2e

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/librustc/hir/lowering.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,18 +5113,6 @@ impl<'a> LoweringContext<'a> {
51135113
)
51145114
}
51155115
}
5116-
5117-
fn wrap_in_try_constructor(
5118-
&mut self,
5119-
method: Symbol,
5120-
e: hir::Expr,
5121-
unstable_span: Span,
5122-
) -> P<hir::Expr> {
5123-
let path = &[sym::ops, sym::Try, method];
5124-
let from_err = P(self.expr_std_path(unstable_span, path, None,
5125-
ThinVec::new()));
5126-
P(self.expr_call(e.span, from_err, hir_vec![e]))
5127-
}
51285116
}
51295117

51305118
fn body_ids(bodies: &BTreeMap<hir::BodyId, hir::Body>) -> Vec<hir::BodyId> {

src/librustc/hir/lowering/expr.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,17 @@ impl LoweringContext<'_> {
368368
})
369369
}
370370

371+
fn wrap_in_try_constructor(
372+
&mut self,
373+
method: Symbol,
374+
e: hir::Expr,
375+
unstable_span: Span,
376+
) -> P<hir::Expr> {
377+
let path = &[sym::ops, sym::Try, method];
378+
let from_err = P(self.expr_std_path(unstable_span, path, None, ThinVec::new()));
379+
P(self.expr_call(e.span, from_err, hir_vec![e]))
380+
}
381+
371382
/// Desugar `<expr>.await` into:
372383
/// ```rust
373384
/// {

0 commit comments

Comments
 (0)