Skip to content

Commit 4850b9f

Browse files
committed
remove a bunch of dead parameters in fn
1 parent 42752cb commit 4850b9f

File tree

18 files changed

+33
-74
lines changed

18 files changed

+33
-74
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3020,7 +3020,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
30203020
/// assignment to `x.f`).
30213021
pub(crate) fn report_illegal_reassignment(
30223022
&mut self,
3023-
_location: Location,
30243023
(place, span): (Place<'tcx>, Span),
30253024
assigned_span: Span,
30263025
err_place: Place<'tcx>,

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
10361036
self,
10371037
self.infcx.tcx,
10381038
self.body,
1039-
location,
10401039
(sd, place_span.0),
10411040
&borrow_set,
10421041
|borrow_index| borrows_in_scope.contains(borrow_index),
@@ -2174,7 +2173,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
21742173
// report the error as an illegal reassignment
21752174
let init = &self.move_data.inits[init_index];
21762175
let assigned_span = init.span(self.body);
2177-
self.report_illegal_reassignment(location, (place, span), assigned_span, place);
2176+
self.report_illegal_reassignment((place, span), assigned_span, place);
21782177
} else {
21792178
self.report_mutability_error(place, span, the_place_err, error_access, location)
21802179
}

compiler/rustc_borrowck/src/path_utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub(super) fn each_borrow_involving_path<'tcx, F, I, S>(
2727
s: &mut S,
2828
tcx: TyCtxt<'tcx>,
2929
body: &Body<'tcx>,
30-
_location: Location,
3130
access_place: (AccessDepth, Place<'tcx>),
3231
borrow_set: &BorrowSet<'tcx>,
3332
is_candidate: I,

compiler/rustc_borrowck/src/polonius/loan_invalidations.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ impl<'cx, 'tcx> LoanInvalidationsGenerator<'cx, 'tcx> {
340340
self,
341341
self.tcx,
342342
self.body,
343-
location,
344343
(sd, place),
345344
self.borrow_set,
346345
|_| true,

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
662662
polonius_output: Option<Rc<PoloniusOutput>>,
663663
) -> (Option<ClosureRegionRequirements<'tcx>>, RegionErrors<'tcx>) {
664664
let mir_def_id = body.source.def_id();
665-
self.propagate_constraints(body);
665+
self.propagate_constraints();
666666

667667
let mut errors_buffer = RegionErrors::new(infcx.tcx);
668668

@@ -716,8 +716,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
716716
/// for each region variable until all the constraints are
717717
/// satisfied. Note that some values may grow **too** large to be
718718
/// feasible, but we check this later.
719-
#[instrument(skip(self, _body), level = "debug")]
720-
fn propagate_constraints(&mut self, _body: &Body<'tcx>) {
719+
#[instrument(skip(self), level = "debug")]
720+
fn propagate_constraints(&mut self) {
721721
debug!("constraints={:#?}", {
722722
let mut constraints: Vec<_> = self.outlives_constraints().collect();
723723
constraints.sort_by_key(|c| (c.sup, c.sub));

compiler/rustc_codegen_gcc/src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
333333
}
334334
}
335335

336-
pub fn overflow_call(&self, func: Function<'gcc>, args: &[RValue<'gcc>], _funclet: Option<&Funclet>) -> RValue<'gcc> {
336+
pub fn overflow_call(&self, func: Function<'gcc>, args: &[RValue<'gcc>]) -> RValue<'gcc> {
337337
// gccjit requires to use the result of functions, even when it's not used.
338338
// That's why we assign the result to a local.
339339
let return_type = self.context.new_type::<bool>();

compiler/rustc_codegen_gcc/src/intrinsic/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
934934
_ => unreachable!(),
935935
};
936936
let overflow_func = self.context.get_builtin_function(func_name);
937-
self.overflow_call(overflow_func, &[lhs, rhs, res.get_address(None)], None)
937+
self.overflow_call(overflow_func, &[lhs, rhs, res.get_address(None)])
938938
}
939939
else {
940940
let func_name =
@@ -996,7 +996,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
996996
_ => unreachable!(),
997997
};
998998
let overflow_func = self.context.get_builtin_function(func_name);
999-
self.overflow_call(overflow_func, &[lhs, rhs, res.get_address(None)], None)
999+
self.overflow_call(overflow_func, &[lhs, rhs, res.get_address(None)])
10001000
}
10011001
else {
10021002
let func_name =

compiler/rustc_const_eval/src/transform/check_consts/resolver.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ where
9696
});
9797
}
9898

99-
fn address_of_allows_mutation(&self, _mt: mir::Mutability, _place: mir::Place<'tcx>) -> bool {
99+
fn address_of_allows_mutation(&self) -> bool {
100100
// Exact set of permissions granted by AddressOf is undecided. Conservatively assume that
101101
// it might allow mutation until resolution of #56604.
102102
true
@@ -171,10 +171,8 @@ where
171171
self.super_rvalue(rvalue, location);
172172

173173
match rvalue {
174-
mir::Rvalue::AddressOf(mt, borrowed_place) => {
175-
if !borrowed_place.is_indirect()
176-
&& self.address_of_allows_mutation(*mt, *borrowed_place)
177-
{
174+
mir::Rvalue::AddressOf(_mt, borrowed_place) => {
175+
if !borrowed_place.is_indirect() && self.address_of_allows_mutation() {
178176
let place_ty = borrowed_place.ty(self.ccx.body, self.ccx.tcx).ty;
179177
if Q::in_any_value_of_ty(self.ccx, place_ty) {
180178
self.state.qualif.insert(borrowed_place.local);

compiler/rustc_hir_analysis/src/check/region.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use rustc_index::Idx;
1616
use rustc_middle::middle::region::*;
1717
use rustc_middle::ty::TyCtxt;
1818
use rustc_span::source_map;
19-
use rustc_span::Span;
2019

2120
use super::errs::{maybe_expr_static_mut, maybe_stmt_static_mut};
2221

@@ -72,11 +71,7 @@ struct RegionResolutionVisitor<'tcx> {
7271
}
7372

7473
/// Records the lifetime of a local variable as `cx.var_parent`
75-
fn record_var_lifetime(
76-
visitor: &mut RegionResolutionVisitor<'_>,
77-
var_id: hir::ItemLocalId,
78-
_sp: Span,
79-
) {
74+
fn record_var_lifetime(visitor: &mut RegionResolutionVisitor<'_>, var_id: hir::ItemLocalId) {
8075
match visitor.cx.var_parent {
8176
None => {
8277
// this can happen in extern fn declarations like
@@ -210,7 +205,7 @@ fn resolve_pat<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, pat: &'tcx hir
210205

211206
// If this is a binding then record the lifetime of that binding.
212207
if let PatKind::Binding(..) = pat.kind {
213-
record_var_lifetime(visitor, pat.hir_id.local_id, pat.span);
208+
record_var_lifetime(visitor, pat.hir_id.local_id);
214209
}
215210

216211
debug!("resolve_pat - pre-increment {} pat = {:?}", visitor.expr_and_pat_count, pat);

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,7 @@ fn check_predicates<'tcx>(
425425

426426
let mut res = Ok(());
427427
for (clause, span) in impl1_predicates {
428-
if !impl2_predicates
429-
.iter()
430-
.any(|pred2| trait_predicates_eq(tcx, clause.as_predicate(), *pred2, span))
428+
if !impl2_predicates.iter().any(|pred2| trait_predicates_eq(clause.as_predicate(), *pred2))
431429
{
432430
res = res.and(check_specialization_on(tcx, clause, span))
433431
}
@@ -459,10 +457,8 @@ fn check_predicates<'tcx>(
459457
///
460458
/// So we make that check in this function and try to raise a helpful error message.
461459
fn trait_predicates_eq<'tcx>(
462-
_tcx: TyCtxt<'tcx>,
463460
predicate1: ty::Predicate<'tcx>,
464461
predicate2: ty::Predicate<'tcx>,
465-
_span: Span,
466462
) -> bool {
467463
// FIXME(effects)
468464
predicate1 == predicate2

0 commit comments

Comments
 (0)