]> git.lizzy.rs Git - rust.git/commitdiff
lowering: move wrap_in_try_constructor -> expr.rs
authorMazdak Farrokhzad <twingoow@gmail.com>
Sat, 10 Aug 2019 13:11:22 +0000 (15:11 +0200)
committerMazdak Farrokhzad <twingoow@gmail.com>
Sat, 10 Aug 2019 18:24:42 +0000 (20:24 +0200)
src/librustc/hir/lowering.rs
src/librustc/hir/lowering/expr.rs

index 5793dc019c37bd59e110f6773f6d2c4fca9dcd3c..db70d18bd832585ab51ea9b663ae2cd18915cb9a 100644 (file)
@@ -5113,18 +5113,6 @@ fn maybe_lint_bare_trait(&self, span: Span, id: NodeId, is_global: bool) {
             )
         }
     }
-
-    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> {
index 711ec662301c160268141ae7406758640568587d..378588d25b2e77f3e5337c8fef3d8ac9d0844c65 100644 (file)
@@ -368,6 +368,17 @@ fn lower_expr_try_block(&mut self, body: &Block) -> hir::ExprKind {
         })
     }
 
+    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
     /// {