use hir::def_id::DefId;
use middle::region;
use traits::{ObligationCause, ObligationCauseCode};
-use ty::{self, Region, TyCtxt, TypeFoldable};
+use ty::{self, Region, Ty, TyCtxt, TypeFoldable};
use ty::error::TypeError;
use syntax::ast::DUMMY_NODE_ID;
use syntax_pos::{Pos, Span};
mod named_anon_conflict;
#[macro_use]
mod util;
-mod anon_anon_conflict;
+mod different_lifetimes;
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
pub fn note_and_explain_region(self,
// for imported and non-imported crates
if exp_path == found_path
|| exp_abs_path == found_abs_path {
- let crate_name = self.tcx.sess.cstore.crate_name(did1.krate);
+ let crate_name = self.tcx.crate_name(did1.krate);
err.span_note(sp, &format!("Perhaps two different versions \
of crate `{}` are being used?",
crate_name));
name: String,
sub: &ty::subst::Substs<'tcx>,
pos: usize,
- other_ty: &ty::Ty<'tcx>) {
+ other_ty: &Ty<'tcx>) {
// `value` and `other_value` hold two incomplete type representation for display.
// `name` is the path of both types being compared. `sub`
value.push_highlighted(name);
path: String,
sub: &ty::subst::Substs<'tcx>,
other_path: String,
- other_ty: &ty::Ty<'tcx>) -> Option<()> {
+ other_ty: &Ty<'tcx>) -> Option<()> {
for (i, ta) in sub.types().enumerate() {
if &ta == other_ty {
self.highlight_outer(&mut t1_out, &mut t2_out, path, sub, i, &other_ty);
/// Compare two given types, eliding parts that are the same between them and highlighting
/// relevant differences, and return two representation of those types for highlighted printing.
- fn cmp(&self, t1: ty::Ty<'tcx>, t2: ty::Ty<'tcx>)
+ fn cmp(&self, t1: Ty<'tcx>, t2: Ty<'tcx>)
-> (DiagnosticStyledString, DiagnosticStyledString)
{
match (&t1.sty, &t2.sty) {
}
fn expected_found_str_ty(&self,
- exp_found: &ty::error::ExpectedFound<ty::Ty<'tcx>>)
+ exp_found: &ty::error::ExpectedFound<Ty<'tcx>>)
-> Option<(DiagnosticStyledString, DiagnosticStyledString)> {
let exp_found = self.resolve_type_vars_if_possible(exp_found);
if exp_found.references_error() {
name)
}
infer::UpvarRegion(ref upvar_id, _) => {
- format!(" for capture of `{}` by closure",
- self.tcx.local_var_name_str_def_index(upvar_id.var_id))
+ let var_node_id = self.tcx.hir.hir_to_node_id(upvar_id.var_id);
+ let var_name = self.tcx.hir.name(var_node_id);
+ format!(" for capture of `{}` by closure", var_name)
}
};