Skip to content

Commit c909e04

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

File tree

26 files changed

+61
-136
lines changed

26 files changed

+61
-136
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
185185
Cow::Owned(casted_args)
186186
}
187187

188-
fn check_ptr_call<'b>(&mut self, _typ: &str, func_ptr: RValue<'gcc>, args: &'b [RValue<'gcc>]) -> Cow<'b, [RValue<'gcc>]> {
188+
fn check_ptr_call<'b>(&mut self, func_ptr: RValue<'gcc>, args: &'b [RValue<'gcc>]) -> Cow<'b, [RValue<'gcc>]> {
189189
let mut all_args_match = true;
190190
let mut param_types = vec![];
191191
let gcc_func = func_ptr.get_type().dyncast_function_ptr_type().expect("function ptr");
@@ -256,7 +256,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
256256
self.block.get_function()
257257
}
258258

259-
fn function_call(&mut self, func: RValue<'gcc>, args: &[RValue<'gcc>], _funclet: Option<&Funclet>) -> RValue<'gcc> {
259+
fn function_call(&mut self, func: RValue<'gcc>, args: &[RValue<'gcc>]) -> RValue<'gcc> {
260260
// TODO(antoyo): remove when the API supports a different type for functions.
261261
let func: Function<'gcc> = self.cx.rvalue_as_function(func);
262262
let args = self.check_call("call", func, args);
@@ -299,7 +299,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
299299
llvm::adjust_intrinsic_arguments(&self, gcc_func, args.into(), &func_name, original_function_name)
300300
};
301301
let args_adjusted = args.len() != previous_arg_count;
302-
let args = self.check_ptr_call("call", func_ptr, &*args);
302+
let args = self.check_ptr_call(func_ptr, &*args);
303303

304304
// gccjit requires to use the result of functions, even when it's not used.
305305
// That's why we assign the result to a local or call add_eval().
@@ -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>();
@@ -1386,7 +1386,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
13861386
// FIXME(antoyo): remove when having a proper API.
13871387
let gcc_func = unsafe { std::mem::transmute(func) };
13881388
let call = if self.functions.borrow().values().any(|value| *value == gcc_func) {
1389-
self.function_call(func, args, funclet)
1389+
self.function_call(func, args)
13901390
}
13911391
else {
13921392
// If it's a not function that was defined, it's a function pointer.

compiler/rustc_codegen_gcc/src/int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
337337
// TODO(antoyo): is it correct to use rhs type instead of the parameter typ?
338338
.new_local(None, rhs.get_type(), "binopResult")
339339
.get_address(None);
340-
let overflow = self.overflow_call(intrinsic, &[lhs, rhs, res], None);
340+
let overflow = self.overflow_call(intrinsic, &[lhs, rhs, res]);
341341
(res.dereference(None).to_rvalue(), overflow)
342342
}
343343

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_codegen_ssa/src/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2542,7 +2542,7 @@ fn add_native_libs_from_crate(
25422542
}
25432543
NativeLibKind::Framework { as_needed } => {
25442544
if link_dynamic {
2545-
cmd.link_framework_by_name(name, verbatim, as_needed.unwrap_or(true))
2545+
cmd.link_framework_by_name(name, as_needed.unwrap_or(true))
25462546
}
25472547
}
25482548
NativeLibKind::RawDylib => {

compiler/rustc_codegen_ssa/src/back/linker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub trait Linker {
168168
fn cmd(&mut self) -> &mut Command;
169169
fn set_output_kind(&mut self, output_kind: LinkOutputKind, out_filename: &Path);
170170
fn link_dylib_by_name(&mut self, name: &str, verbatim: bool, as_needed: bool);
171-
fn link_framework_by_name(&mut self, _name: &str, _verbatim: bool, _as_needed: bool) {
171+
fn link_framework_by_name(&mut self, _name: &str, _as_needed: bool) {
172172
bug!("framework linked with unsupported linker")
173173
}
174174
fn link_staticlib_by_name(
@@ -470,7 +470,7 @@ impl<'a> Linker for GccLinker<'a> {
470470
}
471471
}
472472

473-
fn link_framework_by_name(&mut self, name: &str, _verbatim: bool, as_needed: bool) {
473+
fn link_framework_by_name(&mut self, name: &str, as_needed: bool) {
474474
self.hint_dynamic();
475475
if !as_needed {
476476
// FIXME(81490): ld64 as of macOS 11 supports the -needed_framework

0 commit comments

Comments
 (0)