1
Fork 0

Rollup merge of #137529 - klensy:unused3, r=lcnr

remove few unused args
This commit is contained in:
León Orell Valerian Liehr 2025-02-26 04:15:04 +01:00 committed by GitHub
commit 292c003ce7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 9 additions and 24 deletions

View file

@ -648,7 +648,7 @@ impl<'a, 'tcx> ResultsVisitor<'a, 'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<
| StatementKind::StorageLive(..) => {} | StatementKind::StorageLive(..) => {}
// This does not affect borrowck // This does not affect borrowck
StatementKind::BackwardIncompatibleDropHint { place, reason: BackwardIncompatibleDropReason::Edition2024 } => { StatementKind::BackwardIncompatibleDropHint { place, reason: BackwardIncompatibleDropReason::Edition2024 } => {
self.check_backward_incompatible_drop(location, (**place, span), state); self.check_backward_incompatible_drop(location, **place, state);
} }
StatementKind::StorageDead(local) => { StatementKind::StorageDead(local) => {
self.access_place( self.access_place(
@ -1174,7 +1174,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
fn check_backward_incompatible_drop( fn check_backward_incompatible_drop(
&mut self, &mut self,
location: Location, location: Location,
(place, place_span): (Place<'tcx>, Span), place: Place<'tcx>,
state: &BorrowckDomain, state: &BorrowckDomain,
) { ) {
let tcx = self.infcx.tcx; let tcx = self.infcx.tcx;

View file

@ -1074,7 +1074,6 @@ fn lower_variant<'tcx>(
def.ctor().map(|(kind, _, def_id)| (kind, def_id.to_def_id())), def.ctor().map(|(kind, _, def_id)| (kind, def_id.to_def_id())),
discr, discr,
fields, fields,
adt_kind,
parent_did.to_def_id(), parent_did.to_def_id(),
recovered, recovered,
adt_kind == AdtKind::Struct && tcx.has_attr(parent_did, sym::non_exhaustive) adt_kind == AdtKind::Struct && tcx.has_attr(parent_did, sym::non_exhaustive)

View file

@ -1116,7 +1116,6 @@ impl<'a> CrateMetadataRef<'a> {
value: self.get_default_field(did.index), value: self.get_default_field(did.index),
}) })
.collect(), .collect(),
adt_kind,
parent_did, parent_did,
None, None,
data.is_non_exhaustive, data.is_non_exhaustive,

View file

@ -1184,23 +1184,17 @@ impl VariantDef {
/// ///
/// If someone speeds up attribute loading to not be a performance concern, they can /// If someone speeds up attribute loading to not be a performance concern, they can
/// remove this hack and use the constructor `DefId` everywhere. /// remove this hack and use the constructor `DefId` everywhere.
#[instrument(level = "debug")]
pub fn new( pub fn new(
name: Symbol, name: Symbol,
variant_did: Option<DefId>, variant_did: Option<DefId>,
ctor: Option<(CtorKind, DefId)>, ctor: Option<(CtorKind, DefId)>,
discr: VariantDiscr, discr: VariantDiscr,
fields: IndexVec<FieldIdx, FieldDef>, fields: IndexVec<FieldIdx, FieldDef>,
adt_kind: AdtKind,
parent_did: DefId, parent_did: DefId,
recover_tainted: Option<ErrorGuaranteed>, recover_tainted: Option<ErrorGuaranteed>,
is_field_list_non_exhaustive: bool, is_field_list_non_exhaustive: bool,
) -> Self { ) -> Self {
debug!(
"VariantDef::new(name = {:?}, variant_did = {:?}, ctor = {:?}, discr = {:?},
fields = {:?}, adt_kind = {:?}, parent_did = {:?})",
name, variant_did, ctor, discr, fields, adt_kind, parent_did,
);
let mut flags = VariantFlags::NO_VARIANT_FLAGS; let mut flags = VariantFlags::NO_VARIANT_FLAGS;
if is_field_list_non_exhaustive { if is_field_list_non_exhaustive {
flags |= VariantFlags::IS_FIELD_LIST_NON_EXHAUSTIVE; flags |= VariantFlags::IS_FIELD_LIST_NON_EXHAUSTIVE;

View file

@ -751,7 +751,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
/// This does not walk the MIR of the constant as that is not needed for codegen, all we need is /// This does not walk the MIR of the constant as that is not needed for codegen, all we need is
/// to ensure that the constant evaluates successfully and walk the result. /// to ensure that the constant evaluates successfully and walk the result.
#[instrument(skip(self), level = "debug")] #[instrument(skip(self), level = "debug")]
fn visit_const_operand(&mut self, constant: &mir::ConstOperand<'tcx>, location: Location) { fn visit_const_operand(&mut self, constant: &mir::ConstOperand<'tcx>, _location: Location) {
// No `super_constant` as we don't care about `visit_ty`/`visit_ty_const`. // No `super_constant` as we don't care about `visit_ty`/`visit_ty_const`.
let Some(val) = self.eval_constant(constant) else { return }; let Some(val) = self.eval_constant(constant) else { return };
collect_const_value(self.tcx, val, self.used_items); collect_const_value(self.tcx, val, self.used_items);

View file

@ -2252,7 +2252,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
#[instrument(level = "debug", skip(self, parent_scope))] #[instrument(level = "debug", skip(self, parent_scope))]
pub(crate) fn make_path_suggestion( pub(crate) fn make_path_suggestion(
&mut self, &mut self,
span: Span,
mut path: Vec<Segment>, mut path: Vec<Segment>,
parent_scope: &ParentScope<'ra>, parent_scope: &ParentScope<'ra>,
) -> Option<(Vec<Segment>, Option<String>)> { ) -> Option<(Vec<Segment>, Option<String>)> {
@ -2480,7 +2479,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
// or `use a::{b, c, d}};` // or `use a::{b, c, d}};`
// ^^^^^^^^^^^ // ^^^^^^^^^^^
let (has_nested, after_crate_name) = let (has_nested, after_crate_name) =
find_span_immediately_after_crate_name(self.tcx.sess, module_name, import.use_span); find_span_immediately_after_crate_name(self.tcx.sess, import.use_span);
debug!(has_nested, ?after_crate_name); debug!(has_nested, ?after_crate_name);
let source_map = self.tcx.sess.source_map(); let source_map = self.tcx.sess.source_map();
@ -2687,11 +2686,7 @@ fn extend_span_to_previous_binding(sess: &Session, binding_span: Span) -> Option
/// // ^^^^^^^^^^^^^^^ -- true /// // ^^^^^^^^^^^^^^^ -- true
/// ``` /// ```
#[instrument(level = "debug", skip(sess))] #[instrument(level = "debug", skip(sess))]
fn find_span_immediately_after_crate_name( fn find_span_immediately_after_crate_name(sess: &Session, use_span: Span) -> (bool, Span) {
sess: &Session,
module_name: Symbol,
use_span: Span,
) -> (bool, Span) {
let source_map = sess.source_map(); let source_map = sess.source_map();
// Using `use issue_59764::foo::{baz, makro};` as an example throughout.. // Using `use issue_59764::foo::{baz, makro};` as an example throughout..

View file

@ -955,11 +955,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
} else { } else {
None None
}; };
let err = match self.make_path_suggestion( let err = match self
span, .make_path_suggestion(import.module_path.clone(), &import.parent_scope)
import.module_path.clone(), {
&import.parent_scope,
) {
Some((suggestion, note)) => UnresolvedImportError { Some((suggestion, note)) => UnresolvedImportError {
span, span,
label: None, label: None,