Skip to content

Commit c2ed087

Browse files
committed
remove unused function argument
1 parent a5c6a48 commit c2ed087

File tree

4 files changed

+5
-37
lines changed

4 files changed

+5
-37
lines changed

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
315315
body_id: Option<hir::BodyId>,
316316
failure_span: Span,
317317
arg: GenericArg<'tcx>,
318-
// FIXME(#94483): Either use this or remove it.
319-
_impl_candidates: Vec<ty::TraitRef<'tcx>>,
320318
error_code: TypeAnnotationNeeded,
321319
should_label_span: bool,
322320
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {

compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,7 +1980,6 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
19801980
body_id,
19811981
span,
19821982
trait_ref.self_ty().skip_binder().into(),
1983-
vec![],
19841983
ErrorCode::E0282,
19851984
false,
19861985
)
@@ -2005,19 +2004,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
20052004
let subst = data.trait_ref.substs.iter().find(|s| s.has_infer_types_or_consts());
20062005

20072006
let mut err = if let Some(subst) = subst {
2008-
let impl_candidates = self
2009-
.find_similar_impl_candidates(trait_ref)
2010-
.into_iter()
2011-
.map(|candidate| candidate.trait_ref)
2012-
.collect();
2013-
self.emit_inference_failure_err(
2014-
body_id,
2015-
span,
2016-
subst,
2017-
impl_candidates,
2018-
ErrorCode::E0283,
2019-
true,
2020-
)
2007+
self.emit_inference_failure_err(body_id, span, subst, ErrorCode::E0283, true)
20212008
} else {
20222009
struct_span_err!(
20232010
self.tcx.sess,
@@ -2117,7 +2104,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
21172104
return;
21182105
}
21192106

2120-
self.emit_inference_failure_err(body_id, span, arg, vec![], ErrorCode::E0282, false)
2107+
self.emit_inference_failure_err(body_id, span, arg, ErrorCode::E0282, false)
21212108
}
21222109

21232110
ty::PredicateKind::Subtype(data) => {
@@ -2131,14 +2118,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
21312118
let SubtypePredicate { a_is_expected: _, a, b } = data;
21322119
// both must be type variables, or the other would've been instantiated
21332120
assert!(a.is_ty_var() && b.is_ty_var());
2134-
self.emit_inference_failure_err(
2135-
body_id,
2136-
span,
2137-
a.into(),
2138-
vec![],
2139-
ErrorCode::E0282,
2140-
true,
2141-
)
2121+
self.emit_inference_failure_err(body_id, span, a.into(), ErrorCode::E0282, true)
21422122
}
21432123
ty::PredicateKind::Projection(data) => {
21442124
if predicate.references_error() || self.is_tainted_by_errors() {
@@ -2155,7 +2135,6 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
21552135
body_id,
21562136
span,
21572137
subst,
2158-
vec![],
21592138
ErrorCode::E0284,
21602139
true,
21612140
);

compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,15 +1538,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15381538
ty
15391539
} else {
15401540
if !self.is_tainted_by_errors() {
1541-
self.emit_inference_failure_err(
1542-
(**self).body_id,
1543-
sp,
1544-
ty.into(),
1545-
vec![],
1546-
E0282,
1547-
true,
1548-
)
1549-
.emit();
1541+
self.emit_inference_failure_err((**self).body_id, sp, ty.into(), E0282, true)
1542+
.emit();
15501543
}
15511544
let err = self.tcx.ty_error();
15521545
self.demand_suptype(sp, err, ty);

compiler/rustc_typeck/src/check/writeback.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> {
692692
Some(self.body.id()),
693693
self.span.to_span(self.tcx),
694694
t.into(),
695-
vec![],
696695
E0282,
697696
false,
698697
)
@@ -707,7 +706,6 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> {
707706
Some(self.body.id()),
708707
self.span.to_span(self.tcx),
709708
c.into(),
710-
vec![],
711709
E0282,
712710
false,
713711
)

0 commit comments

Comments
 (0)