remove unused function argument

This commit is contained in:
lcnr 2022-07-01 13:36:49 +02:00
parent a5c6a48aee
commit c2ed08715b
4 changed files with 5 additions and 37 deletions

View File

@ -315,8 +315,6 @@ pub fn emit_inference_failure_err(
body_id: Option<hir::BodyId>,
failure_span: Span,
arg: GenericArg<'tcx>,
// FIXME(#94483): Either use this or remove it.
_impl_candidates: Vec<ty::TraitRef<'tcx>>,
error_code: TypeAnnotationNeeded,
should_label_span: bool,
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {

View File

@ -1980,7 +1980,6 @@ fn maybe_report_ambiguity(
body_id,
span,
trait_ref.self_ty().skip_binder().into(),
vec![],
ErrorCode::E0282,
false,
)
@ -2005,19 +2004,7 @@ fn maybe_report_ambiguity(
let subst = data.trait_ref.substs.iter().find(|s| s.has_infer_types_or_consts());
let mut err = if let Some(subst) = subst {
let impl_candidates = self
.find_similar_impl_candidates(trait_ref)
.into_iter()
.map(|candidate| candidate.trait_ref)
.collect();
self.emit_inference_failure_err(
body_id,
span,
subst,
impl_candidates,
ErrorCode::E0283,
true,
)
self.emit_inference_failure_err(body_id, span, subst, ErrorCode::E0283, true)
} else {
struct_span_err!(
self.tcx.sess,
@ -2117,7 +2104,7 @@ fn maybe_report_ambiguity(
return;
}
self.emit_inference_failure_err(body_id, span, arg, vec![], ErrorCode::E0282, false)
self.emit_inference_failure_err(body_id, span, arg, ErrorCode::E0282, false)
}
ty::PredicateKind::Subtype(data) => {
@ -2131,14 +2118,7 @@ fn maybe_report_ambiguity(
let SubtypePredicate { a_is_expected: _, a, b } = data;
// both must be type variables, or the other would've been instantiated
assert!(a.is_ty_var() && b.is_ty_var());
self.emit_inference_failure_err(
body_id,
span,
a.into(),
vec![],
ErrorCode::E0282,
true,
)
self.emit_inference_failure_err(body_id, span, a.into(), ErrorCode::E0282, true)
}
ty::PredicateKind::Projection(data) => {
if predicate.references_error() || self.is_tainted_by_errors() {
@ -2155,7 +2135,6 @@ fn maybe_report_ambiguity(
body_id,
span,
subst,
vec![],
ErrorCode::E0284,
true,
);

View File

@ -1538,15 +1538,8 @@ pub fn structurally_resolved_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
ty
} else {
if !self.is_tainted_by_errors() {
self.emit_inference_failure_err(
(**self).body_id,
sp,
ty.into(),
vec![],
E0282,
true,
)
.emit();
self.emit_inference_failure_err((**self).body_id, sp, ty.into(), E0282, true)
.emit();
}
let err = self.tcx.ty_error();
self.demand_suptype(sp, err, ty);

View File

@ -692,7 +692,6 @@ fn report_type_error(&self, t: Ty<'tcx>) {
Some(self.body.id()),
self.span.to_span(self.tcx),
t.into(),
vec![],
E0282,
false,
)
@ -707,7 +706,6 @@ fn report_const_error(&self, c: ty::Const<'tcx>) {
Some(self.body.id()),
self.span.to_span(self.tcx),
c.into(),
vec![],
E0282,
false,
)