Skip to content

Commit b5d816d

Browse files
committed
remove unused field from VariantDef::new and convert debug to instrument
1 parent cede902 commit b5d816d

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

compiler/rustc_hir_analysis/src/collect.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,6 @@ fn lower_variant<'tcx>(
10751075
def.ctor().map(|(kind, _, def_id)| (kind, def_id.to_def_id())),
10761076
discr,
10771077
fields,
1078-
adt_kind,
10791078
parent_did.to_def_id(),
10801079
recovered,
10811080
adt_kind == AdtKind::Struct && tcx.has_attr(parent_did, sym::non_exhaustive)

compiler/rustc_metadata/src/rmeta/decoder.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,6 @@ impl<'a> CrateMetadataRef<'a> {
11181118
value: self.get_default_field(did.index),
11191119
})
11201120
.collect(),
1121-
adt_kind,
11221121
parent_did,
11231122
None,
11241123
data.is_non_exhaustive,

compiler/rustc_middle/src/ty/mod.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1183,23 +1183,17 @@ impl VariantDef {
11831183
///
11841184
/// If someone speeds up attribute loading to not be a performance concern, they can
11851185
/// remove this hack and use the constructor `DefId` everywhere.
1186+
#[instrument(level = "debug", skip(recover_tainted, is_field_list_non_exhaustive))]
11861187
pub fn new(
11871188
name: Symbol,
11881189
variant_did: Option<DefId>,
11891190
ctor: Option<(CtorKind, DefId)>,
11901191
discr: VariantDiscr,
11911192
fields: IndexVec<FieldIdx, FieldDef>,
1192-
adt_kind: AdtKind,
11931193
parent_did: DefId,
11941194
recover_tainted: Option<ErrorGuaranteed>,
11951195
is_field_list_non_exhaustive: bool,
11961196
) -> Self {
1197-
debug!(
1198-
"VariantDef::new(name = {:?}, variant_did = {:?}, ctor = {:?}, discr = {:?},
1199-
fields = {:?}, adt_kind = {:?}, parent_did = {:?})",
1200-
name, variant_did, ctor, discr, fields, adt_kind, parent_did,
1201-
);
1202-
12031197
let mut flags = VariantFlags::NO_VARIANT_FLAGS;
12041198
if is_field_list_non_exhaustive {
12051199
flags |= VariantFlags::IS_FIELD_LIST_NON_EXHAUSTIVE;

0 commit comments

Comments
 (0)