use super::Expectation;
use super::expected_types_for_fn_args;
use super::FnCtxt;
-use super::LvaluePreference;
use super::method;
use super::structurally_resolved_type;
use super::TupleArgumentsFlag;
use super::write_call;
use CrateCtxt;
-use middle::def_id::{DefId, LOCAL_CRATE};
+use middle::cstore::LOCAL_CRATE;
+use middle::def_id::DefId;
use middle::infer;
-use middle::ty::{self, Ty};
+use middle::ty::{self, LvaluePreference, Ty};
use syntax::codemap::Span;
use syntax::parse::token;
use syntax::ptr::P;
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.