Remove some fields from ObligationCauseCode
This commit is contained in:
@@ -6,7 +6,6 @@ use rustc_errors::{struct_span_err, DiagnosticBuilder};
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_span::symbol::Symbol;
|
||||
use rustc_span::{MultiSpan, Span};
|
||||
use std::fmt;
|
||||
use std::iter;
|
||||
@@ -15,8 +14,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
pub fn report_extra_impl_obligation(
|
||||
&self,
|
||||
error_span: Span,
|
||||
item_name: Symbol,
|
||||
_impl_item_def_id: DefId,
|
||||
impl_item_def_id: DefId,
|
||||
trait_item_def_id: DefId,
|
||||
requirement: &dyn fmt::Display,
|
||||
) -> DiagnosticBuilder<'tcx> {
|
||||
@@ -27,6 +25,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
|
||||
if let Some(trait_item_span) = self.tcx.hir().span_if_local(trait_item_def_id) {
|
||||
let span = self.tcx.sess.source_map().guess_head_span(trait_item_span);
|
||||
let item_name = self.tcx.item_name(impl_item_def_id);
|
||||
err.span_label(span, format!("definition of `{}` from trait", item_name));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user