Skip to content

Commit 0379b85

Browse files
committed
rustdoc and size assertions
1 parent 8ee0954 commit 0379b85

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

compiler/rustc_hir/src/hir.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3968,14 +3968,14 @@ mod size_asserts {
39683968
// tidy-alphabetical-start
39693969
static_assert_size!(Block<'_>, 48);
39703970
static_assert_size!(Body<'_>, 32);
3971-
static_assert_size!(Expr<'_>, 64);
3972-
static_assert_size!(ExprKind<'_>, 48);
3971+
static_assert_size!(Expr<'_>, 56);
3972+
static_assert_size!(ExprKind<'_>, 40);
39733973
static_assert_size!(FnDecl<'_>, 40);
39743974
static_assert_size!(ForeignItem<'_>, 72);
39753975
static_assert_size!(ForeignItemKind<'_>, 40);
39763976
static_assert_size!(GenericArg<'_>, 32);
39773977
static_assert_size!(GenericBound<'_>, 48);
3978-
static_assert_size!(Generics<'_>, 56);
3978+
static_assert_size!(Generics<'_>, 40);
39793979
static_assert_size!(Impl<'_>, 80);
39803980
static_assert_size!(ImplItem<'_>, 80);
39813981
static_assert_size!(ImplItemKind<'_>, 32);
@@ -3984,7 +3984,7 @@ mod size_asserts {
39843984
static_assert_size!(Local<'_>, 64);
39853985
static_assert_size!(Param<'_>, 32);
39863986
static_assert_size!(Pat<'_>, 72);
3987-
static_assert_size!(Path<'_>, 40);
3987+
static_assert_size!(Path<'_>, 32);
39883988
static_assert_size!(PathSegment<'_>, 48);
39893989
static_assert_size!(PatKind<'_>, 48);
39903990
static_assert_size!(QPath<'_>, 24);

src/librustdoc/clean/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use rustc_ast::token::{Token, TokenKind};
1515
use rustc_ast::tokenstream::{TokenStream, TokenTree};
1616
use rustc_attr as attr;
1717
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet, IndexEntry};
18+
use rustc_data_structures::thin_slice::ThinSlice;
1819
use rustc_hir as hir;
1920
use rustc_hir::def::{CtorKind, DefKind, Res};
2021
use rustc_hir::def_id::{DefId, DefIdMap, DefIdSet, LocalDefId, LOCAL_CRATE};
@@ -1508,7 +1509,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
15081509
// Otherwise, this is an inherent associated type.
15091510
_ => return clean_middle_ty(ty::Binder::dummy(ty), cx, None),
15101511
};
1511-
let trait_ = clean_path(&hir::Path { span, res, segments: &[] }, cx);
1512+
let trait_ = clean_path(&hir::Path { span, res, segments: ThinSlice::empty() }, cx);
15121513
register_res(cx, trait_.res);
15131514
let self_def_id = res.opt_def_id();
15141515
let self_type = clean_ty(qself, cx);
@@ -2083,7 +2084,7 @@ fn get_path_parent_def_id(
20832084
def_id: DefId,
20842085
path: &hir::UsePath<'_>,
20852086
) -> Option<DefId> {
2086-
if let [.., parent_segment, _] = &path.segments {
2087+
if let [.., parent_segment, _] = &path.segments.as_slice() {
20872088
match parent_segment.res {
20882089
hir::def::Res::Def(_, parent_def_id) => Some(parent_def_id),
20892090
_ if parent_segment.ident.name == kw::Crate => {

0 commit comments

Comments
 (0)