Skip to content

Commit fe044a8

Browse files
committed
rename hir::map::expect_expr_by_hir_id to expect_expr
1 parent 2d1e223 commit fe044a8

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

src/librustc/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ impl<'hir> Map<'hir> {
927927
}
928928
}
929929

930-
pub fn expect_expr_by_hir_id(&self, id: HirId) -> &'hir Expr {
930+
pub fn expect_expr(&self, id: HirId) -> &'hir Expr {
931931
match self.find_by_hir_id(id) { // read recorded by find
932932
Some(Node::Expr(expr)) => expr,
933933
_ => bug!("expected expr, found {}", self.node_to_string(id))

src/librustc/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
617617
}
618618
hir::MatchSource::TryDesugar => {
619619
if let Some(ty::error::ExpectedFound { expected, .. }) = exp_found {
620-
let discrim_expr = self.tcx.hir().expect_expr_by_hir_id(discrim_hir_id);
620+
let discrim_expr = self.tcx.hir().expect_expr(discrim_hir_id);
621621
let discrim_ty = if let hir::ExprKind::Call(_, args) = &discrim_expr.node {
622622
let arg_expr = args.first().expect("try desugaring call w/out arg");
623623
self.in_progress_tables.and_then(|tables| {

src/librustc/infer/error_reporting/need_type_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
133133
};
134134

135135
if let Some(body_id) = body_id {
136-
let expr = self.tcx.hir().expect_expr_by_hir_id(body_id.hir_id);
136+
let expr = self.tcx.hir().expect_expr(body_id.hir_id);
137137
local_visitor.visit_expr(expr);
138138
}
139139

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ impl BorrowckCtxt<'_, 'tcx> {
702702
move_data::MovePat => (self.tcx.hir().span(hir_id), ""),
703703

704704
move_data::Captured =>
705-
(match self.tcx.hir().expect_expr_by_hir_id(hir_id).node {
705+
(match self.tcx.hir().expect_expr(hir_id).node {
706706
hir::ExprKind::Closure(.., fn_decl_span, _) => fn_decl_span,
707707
ref r => bug!("Captured({:?}) maps to non-closure: {:?}",
708708
the_move.id, r),

src/librustc_mir/borrow_check/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
659659
def_id, target_place, places
660660
);
661661
let hir_id = self.infcx.tcx.hir().as_local_hir_id(def_id)?;
662-
let expr = &self.infcx.tcx.hir().expect_expr_by_hir_id(hir_id).node;
662+
let expr = &self.infcx.tcx.hir().expect_expr(hir_id).node;
663663
debug!("closure_span: hir_id={:?} expr={:?}", hir_id, expr);
664664
if let hir::ExprKind::Closure(
665665
.., args_span, _

src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
237237

238238
if let DefiningTy::Closure(def_id, substs) = def_ty {
239239
let args_span = if let hir::ExprKind::Closure(_, _, _, span, _) =
240-
tcx.hir().expect_expr_by_hir_id(mir_hir_id).node
240+
tcx.hir().expect_expr(mir_hir_id).node
241241
{
242242
span
243243
} else {

src/librustc_passes/loops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
116116
let loop_kind = if loop_id == hir::DUMMY_HIR_ID {
117117
None
118118
} else {
119-
Some(match self.hir_map.expect_expr_by_hir_id(loop_id).node {
119+
Some(match self.hir_map.expect_expr(loop_id).node {
120120
hir::ExprKind::While(..) => LoopKind::WhileLoop,
121121
hir::ExprKind::Loop(_, _, source) => LoopKind::Loop(source),
122122
ref r => span_bug!(e.span,

src/librustc_save_analysis/dump_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tcx, '
15321532
match ex.node {
15331533
ast::ExprKind::Struct(ref path, ref fields, ref base) => {
15341534
let expr_hir_id = self.save_ctxt.tcx.hir().node_to_hir_id(ex.id);
1535-
let hir_expr = self.save_ctxt.tcx.hir().expect_expr_by_hir_id(expr_hir_id);
1535+
let hir_expr = self.save_ctxt.tcx.hir().expect_expr(expr_hir_id);
15361536
let adt = match self.save_ctxt.tables.expr_ty_opt(&hir_expr) {
15371537
Some(ty) if ty.ty_adt_def().is_some() => ty.ty_adt_def().unwrap(),
15381538
_ => {

src/librustc_save_analysis/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
514514

515515
pub fn get_expr_data(&self, expr: &ast::Expr) -> Option<Data> {
516516
let expr_hir_id = self.tcx.hir().node_to_hir_id(expr.id);
517-
let hir_node = self.tcx.hir().expect_expr_by_hir_id(expr_hir_id);
517+
let hir_node = self.tcx.hir().expect_expr(expr_hir_id);
518518
let ty = self.tables.expr_ty_adjusted_opt(&hir_node);
519519
if ty.is_none() || ty.unwrap().sty == ty::Error {
520520
return None;

src/librustc_typeck/check/method/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
389389
Applicability::MachineApplicable,
390390
);
391391
} else {
392-
let call_expr = self.tcx.hir().expect_expr_by_hir_id(
392+
let call_expr = self.tcx.hir().expect_expr(
393393
self.tcx.hir().get_parent_node_by_hir_id(expr.hir_id),
394394
);
395395

0 commit comments

Comments
 (0)