diff options
| author | bors <bors@rust-lang.org> | 2015-09-19 00:08:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-19 00:08:38 +0000 |
| commit | 6e5a3254747cf1f76f8ea698d37f688e13344392 (patch) | |
| tree | 026d81d77fe58c84ea2051d42ee728ec58132979 /src | |
| parent | fb5de8ce57a36e504af2dd6626365d94b5f4262d (diff) | |
| parent | 66f662f37de1ab689602d909761ad0f0745b4648 (diff) | |
| download | rust-6e5a3254747cf1f76f8ea698d37f688e13344392.tar.gz rust-6e5a3254747cf1f76f8ea698d37f688e13344392.zip | |
Auto merge of #28484 - nrc:fix-save, r=alexcrichton
Should be lowering ast expressions to HIR expressions, not cheating via the hir map. That goes wrong now that there is not a 1:1 mapping between ast and hir (in the case of the crash due to ExprParen).
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_trans/save/dump_csv.rs | 2 | ||||
| -rw-r--r-- | src/librustc_trans/save/mod.rs | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustc_trans/save/dump_csv.rs b/src/librustc_trans/save/dump_csv.rs index 62b2f2949fa..9f50e7a1e6d 100644 --- a/src/librustc_trans/save/dump_csv.rs +++ b/src/librustc_trans/save/dump_csv.rs @@ -1097,7 +1097,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DumpCsvVisitor<'l, 'tcx> { self.visit_expr(&**sub_ex); - let hir_node = self.tcx.map.expect_expr(sub_ex.id); + let hir_node = lower_expr(sub_ex); let ty = &self.tcx.expr_ty_adjusted(&hir_node).sty; match *ty { ty::TyStruct(def, _) => { diff --git a/src/librustc_trans/save/mod.rs b/src/librustc_trans/save/mod.rs index 9c6f1a0eb5a..afd16bea6d7 100644 --- a/src/librustc_trans/save/mod.rs +++ b/src/librustc_trans/save/mod.rs @@ -18,7 +18,7 @@ use std::path::{Path, PathBuf}; use rustc_front; use rustc::front::map::NodeItem; -use rustc_front::hir; +use rustc_front::{hir, lowering}; use syntax::attr; use syntax::ast::{self, NodeId}; @@ -442,7 +442,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { pub fn get_expr_data(&self, expr: &ast::Expr) -> Option<Data> { match expr.node { ast::ExprField(ref sub_ex, ident) => { - let hir_node = self.tcx.map.expect_expr(sub_ex.id); + let hir_node = lowering::lower_expr(sub_ex); let ty = &self.tcx.expr_ty_adjusted(&hir_node).sty; match *ty { ty::TyStruct(def, _) => { @@ -462,8 +462,8 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { } } ast::ExprStruct(ref path, _, _) => { - let hir_node = self.tcx.map.expect_expr(expr.id); - let ty = &self.tcx.expr_ty_adjusted(hir_node).sty; + let hir_node = lowering::lower_expr(expr); + let ty = &self.tcx.expr_ty_adjusted(&hir_node).sty; match *ty { ty::TyStruct(def, _) => { let sub_span = self.span_utils.span_for_last_ident(path.span); |
