Rollup merge of #40696 - cramertj:remove-unused-adt-def-code, r=petro… · rust-lang/rust@9307418 (original) (raw)
`@@ -558,7 +558,6 @@ impl<'a, 'tcx> CrateMetadata {
`
558
558
`EntryKind::Union(_, _) => ty::AdtKind::Union,
`
559
559
` _ => bug!("get_adt_def called on a non-ADT {:?}", did),
`
560
560
`};
`
561
``
`-
let mut ctor_index = None;
`
562
561
`let variants = if let ty::AdtKind::Enum = kind {
`
563
562
` item.children
`
564
563
`.decode(self)
`
`@@ -570,8 +569,7 @@ impl<'a, 'tcx> CrateMetadata {
`
570
569
`})
`
571
570
`.collect()
`
572
571
`} else {
`
573
``
`-
let (variant, struct_ctor) = self.get_variant(&item, item_id, tcx);
`
574
``
`-
ctor_index = struct_ctor;
`
``
572
`+
let (variant, _struct_ctor) = self.get_variant(&item, item_id, tcx);
`
575
573
`vec![variant]
`
576
574
`};
`
577
575
`let (kind, repr) = match item.kind {
`
`@@ -581,13 +579,7 @@ impl<'a, 'tcx> CrateMetadata {
`
581
579
` _ => bug!("get_adt_def called on a non-ADT {:?}", did),
`
582
580
`};
`
583
581
``
584
``
`-
let adt = tcx.alloc_adt_def(did, kind, variants, repr);
`
585
``
`-
if let Some(ctor_index) = ctor_index {
`
586
``
`-
// Make adt definition available through constructor id as well.
`
587
``
`-
tcx.maps.adt_def.borrow_mut().insert(self.local_def_id(ctor_index), adt);
`
588
``
`-
}
`
589
``
-
590
``
`-
adt
`
``
582
`+
tcx.alloc_adt_def(did, kind, variants, repr)
`
591
583
`}
`
592
584
``
593
585
`pub fn get_predicates(&self,
`