]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/closure.rs
Auto merge of #30036 - mitaa:doc_id, r=alexcrichton
[rust.git] / src / librustc_typeck / check / closure.rs
index 82c898214c5b69f23fcac152225c3587d8c7fea0..4f7a6395395461f4d444916b0934d5e5d3f4a42f 100644 (file)
@@ -13,7 +13,6 @@
 use super::{check_fn, Expectation, FnCtxt};
 
 use astconv;
-use middle::def_id::DefId;
 use middle::subst;
 use middle::ty::{self, ToPolyTraitRef, Ty};
 use std::cmp;
@@ -46,7 +45,7 @@ fn check_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
                           decl: &'tcx hir::FnDecl,
                           body: &'tcx hir::Block,
                           expected_sig: Option<ty::FnSig<'tcx>>) {
-    let expr_def_id = DefId::local(expr.id);
+    let expr_def_id = fcx.tcx().map.local_def_id(expr.id);
 
     debug!("check_closure opt_kind={:?} expected_sig={:?}",
            opt_kind,