// lifetime parameters.
let mut outlives_environment = OutlivesEnvironment::new(param_env);
outlives_environment.add_implied_bounds(infcx, wf_tys, impl_m_hir_id);
- infcx.check_region_obligations_and_report_errors(&outlives_environment);
+ infcx.check_region_obligations_and_report_errors(
+ impl_m.def_id.expect_local(),
+ &outlives_environment,
+ );
Ok(())
})
if let Some(span) = tcx.hir().span_if_local(trait_m.def_id) {
err.span_label(span, format!("trait method declared without `{self_descr}`"));
} else {
- err.note_trait_signature(trait_m.name.to_string(), trait_m.signature(tcx));
+ err.note_trait_signature(trait_m.name, trait_m.signature(tcx));
}
let reported = err.emit();
return Err(reported);
if let Some(span) = tcx.hir().span_if_local(trait_m.def_id) {
err.span_label(span, format!("`{self_descr}` used in trait"));
} else {
- err.note_trait_signature(trait_m.name.to_string(), trait_m.signature(tcx));
+ err.note_trait_signature(trait_m.name, trait_m.signature(tcx));
}
let reported = err.emit();
return Err(reported);
),
);
} else {
- err.note_trait_signature(trait_m.name.to_string(), trait_m.signature(tcx));
+ err.note_trait_signature(trait_m.name, trait_m.signature(tcx));
}
err.span_label(
impl_span,
}
let outlives_environment = OutlivesEnvironment::new(param_env);
- infcx.resolve_regions_and_report_errors(&outlives_environment);
+ infcx
+ .resolve_regions_and_report_errors(impl_c.def_id.expect_local(), &outlives_environment);
});
}
// Finally, resolve all regions. This catches wily misuses of
// lifetime parameters.
let outlives_environment = OutlivesEnvironment::new(param_env);
- infcx.check_region_obligations_and_report_errors(&outlives_environment);
+ infcx.check_region_obligations_and_report_errors(
+ impl_ty.def_id.expect_local(),
+ &outlives_environment,
+ );
Ok(())
})
};
let mut outlives_environment = OutlivesEnvironment::new(param_env);
outlives_environment.add_implied_bounds(&infcx, implied_bounds, impl_ty_hir_id);
- infcx.check_region_obligations_and_report_errors(&outlives_environment);
+ infcx.check_region_obligations_and_report_errors(
+ impl_ty.def_id.expect_local(),
+ &outlives_environment,
+ );
+
+ let constraints = infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types();
+ for (key, value) in constraints {
+ infcx
+ .report_mismatched_types(
+ &ObligationCause::misc(
+ value.hidden_type.span,
+ tcx.hir().local_def_id_to_hir_id(impl_ty.def_id.expect_local()),
+ ),
+ tcx.mk_opaque(key.def_id, key.substs),
+ value.hidden_type.ty,
+ TypeError::Mismatch,
+ )
+ .emit();
+ }
Ok(())
})