Rollup merge of #119145 - aDotInTheVoid:variantdata-struct-struct, r=compiler-errors
Give `VariantData::Struct` named fields, to clairfy `recovered`. Implements https://github.com/rust-lang/rust/pull/119121#discussion_r1431467066. Supersedes #119121 This way, it's clear what the bool fields means, instead of having to find where it's generated. Changes both ast and hir. r? `@compiler-errors`
This commit is contained in:
commit
d0d814ff48
21 changed files with 51 additions and 40 deletions
|
@ -814,7 +814,7 @@ fn convert_variant(
|
|||
})
|
||||
.collect();
|
||||
let recovered = match def {
|
||||
hir::VariantData::Struct(_, r) => *r,
|
||||
hir::VariantData::Struct { recovered, .. } => *recovered,
|
||||
_ => false,
|
||||
};
|
||||
ty::VariantDef::new(
|
||||
|
|
|
@ -481,7 +481,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
|
|||
},
|
||||
|
||||
Node::Ctor(def) | Node::Variant(Variant { data: def, .. }) => match def {
|
||||
VariantData::Unit(..) | VariantData::Struct(..) => {
|
||||
VariantData::Unit(..) | VariantData::Struct { .. } => {
|
||||
tcx.type_of(tcx.hir().get_parent_item(hir_id)).instantiate_identity()
|
||||
}
|
||||
VariantData::Tuple(..) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue