// We compare strings because PathMod and PathName can be different
// for imported and non-imported crates
if exp_path == found_path {
+ let crate_name = self.tcx.sess.cstore
+ .get_crate_data(did1.krate).name();
self.tcx.sess.span_note(sp, &format!("Perhaps two different versions \
of crate `{}` are being used?",
- exp_path[0]));
+ crate_name));
}
}
};
extern crate crate_a1 as a;
a::try_foo(foo2); //~ ERROR mismatched types
//~^ HELP run
- //~^^ NOTE Perhaps two different versions of crate `main`
+ //~^^ NOTE Perhaps two different versions of crate `crate_a1`
a::try_bar(bar2); //~ ERROR mismatched types
//~^ HELP run
- //~^^ NOTE Perhaps two different versions of crate `main`
+ //~^^ NOTE Perhaps two different versions of crate `crate_a1`
}
}