mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-11 01:17:39 +00:00
lowering: move wrap_in_try_constructor -> expr.rs
This commit is contained in:
parent
8ddd173811
commit
c8b3b2e052
@ -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> {
|
fn body_ids(bodies: &BTreeMap<hir::BodyId, hir::Body>) -> Vec<hir::BodyId> {
|
||||||
|
@ -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:
|
/// Desugar `<expr>.await` into:
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// {
|
/// {
|
||||||
|
Loading…
Reference in New Issue
Block a user