]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/callee.rs
Auto merge of #30036 - mitaa:doc_id, r=alexcrichton
[rust.git] / src / librustc_typeck / check / callee.rs
index dcecec7007d52c2254608eaa8fe694f42d1f9c11..6a23be682e9d3cd0a0c1ff3c4ba7682bf74babd4 100644 (file)
@@ -25,7 +25,7 @@
 use super::write_call;
 
 use CrateCtxt;
-use metadata::cstore::LOCAL_CRATE;
+use middle::cstore::LOCAL_CRATE;
 use middle::def_id::DefId;
 use middle::infer;
 use middle::ty::{self, LvaluePreference, Ty};
@@ -231,6 +231,17 @@ fn confirm_builtin_call<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
                 format!("expected function, found `{}`", actual)
             }, callee_ty, None);
 
+            if let hir::ExprCall(ref expr, _) = call_expr.node {
+                let tcx = fcx.tcx();
+                if let Some(pr) = tcx.def_map.borrow().get(&expr.id) {
+                    if pr.depth == 0 {
+                        if let Some(span) = tcx.map.span_if_local(pr.def_id()) {
+                            tcx.sess.span_note(span, "defined here")
+                        }
+                    }
+                }
+            }
+
             // This is the "default" function signature, used in case of error.
             // In that case, we check each argument against "error" in order to
             // set up all the node type bindings.