Skip to content

Commit 9d2e0b3

Browse files
committed
Auto merge of #29303 - petrochenkov:unistrimp, r=eddyb
And use `VariantData` instead of `P<VariantData>` in `Item_` and `Variant_` Improvements suggested by @eddyb in rust-lang/rust#28816 (comment) and rust-lang/rust#28816 (comment) plugin-[breaking-change] r? @eddyb
2 parents 57136df + f5b681e commit 9d2e0b3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

clean/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,7 @@ impl Clean<VariantStruct> for ::rustc_front::hir::VariantData {
18091809
fn clean(&self, cx: &DocContext) -> VariantStruct {
18101810
VariantStruct {
18111811
struct_type: doctree::struct_type_from_def(self),
1812-
fields: self.fields().map(|x| x.clean(cx)).collect(),
1812+
fields: self.fields().iter().map(|x| x.clean(cx)).collect(),
18131813
fields_stripped: false,
18141814
}
18151815
}
@@ -1923,7 +1923,7 @@ fn struct_def_to_variant_kind(struct_def: &hir::VariantData, cx: &DocContext) ->
19231923
} else if struct_def.is_unit() {
19241924
CLikeVariant
19251925
} else {
1926-
TupleVariant(struct_def.fields().map(|x| x.node.ty.clean(cx)).collect())
1926+
TupleVariant(struct_def.fields().iter().map(|x| x.node.ty.clean(cx)).collect())
19271927
}
19281928
}
19291929

doctree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub struct Enum {
119119
pub struct Variant {
120120
pub name: Name,
121121
pub attrs: Vec<ast::Attribute>,
122-
pub def: P<hir::VariantData>,
122+
pub def: hir::VariantData,
123123
pub stab: Option<attr::Stability>,
124124
pub whence: Span,
125125
}
@@ -236,7 +236,7 @@ pub struct Import {
236236
pub fn struct_type_from_def(sd: &hir::VariantData) -> StructType {
237237
if !sd.is_struct() {
238238
// We are in a tuple-struct
239-
match sd.fields().count() {
239+
match sd.fields().len() {
240240
0 => Unit,
241241
1 => Newtype,
242242
_ => Tuple

visit_ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
9797
stab: self.stability(item.id),
9898
attrs: item.attrs.clone(),
9999
generics: generics.clone(),
100-
fields: sd.fields().cloned().collect(),
100+
fields: sd.fields().iter().cloned().collect(),
101101
whence: item.span
102102
}
103103
}
@@ -298,7 +298,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
298298
hir::ItemEnum(ref ed, ref gen) =>
299299
om.enums.push(self.visit_enum_def(item, name, ed, gen)),
300300
hir::ItemStruct(ref sd, ref gen) =>
301-
om.structs.push(self.visit_variant_data(item, name, &**sd, gen)),
301+
om.structs.push(self.visit_variant_data(item, name, sd, gen)),
302302
hir::ItemFn(ref fd, ref unsafety, constness, ref abi, ref gen, _) =>
303303
om.fns.push(self.visit_fn(item, name, &**fd, unsafety,
304304
constness, abi, gen)),

0 commit comments

Comments
 (0)