Skip to content

Commit 4e87031

Browse files
authored
Rollup merge of #142804 - zachs18:rename-layouts-to-layoutdata-in-comments, r=saethlin
Rename `LayoutS` to `LayoutData` in comments `LayoutS` was renamed to `LayoutData`, but some comments in the compiler were not changed. This updates comments in the compiler (and one section of commented-out code in rust-analyzer) to refer to `LayoutData` instead of `LayoutS`. cc <#132252>, `@workingjubilee`
2 parents 6a49a35 + a7ff98e commit 4e87031

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

compiler/rustc_abi/src/layout.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
432432
align = align.min(AbiAlign::new(pack));
433433
}
434434
// The unadjusted ABI alignment does not include repr(align), but does include repr(pack).
435-
// See documentation on `LayoutS::unadjusted_abi_align`.
435+
// See documentation on `LayoutData::unadjusted_abi_align`.
436436
let unadjusted_abi_align = align.abi;
437437
if let Some(repr_align) = repr.align {
438438
align = align.max(AbiAlign::new(repr_align));
@@ -602,10 +602,10 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
602602
dont_niche_optimize_enum: bool,
603603
) -> LayoutCalculatorResult<FieldIdx, VariantIdx, F> {
604604
// Until we've decided whether to use the tagged or
605-
// niche filling LayoutS, we don't want to intern the
605+
// niche filling LayoutData, we don't want to intern the
606606
// variant layouts, so we can't store them in the
607-
// overall LayoutS. Store the overall LayoutS
608-
// and the variant LayoutSs here until then.
607+
// overall LayoutData. Store the overall LayoutData
608+
// and the variant LayoutDatas here until then.
609609
struct TmpLayout<FieldIdx: Idx, VariantIdx: Idx> {
610610
layout: LayoutData<FieldIdx, VariantIdx>,
611611
variants: IndexVec<VariantIdx, LayoutData<FieldIdx, VariantIdx>>,
@@ -1214,7 +1214,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
12141214

12151215
match kind {
12161216
StructKind::AlwaysSized | StructKind::MaybeUnsized => {
1217-
// Currently `LayoutS` only exposes a single niche so sorting is usually
1217+
// Currently `LayoutData` only exposes a single niche so sorting is usually
12181218
// sufficient to get one niche into the preferred position. If it ever
12191219
// supported multiple niches then a more advanced pick-and-pack approach could
12201220
// provide better results. But even for the single-niche cache it's not
@@ -1333,7 +1333,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
13331333
}
13341334

13351335
// The unadjusted ABI alignment does not include repr(align), but does include repr(pack).
1336-
// See documentation on `LayoutS::unadjusted_abi_align`.
1336+
// See documentation on `LayoutData::unadjusted_abi_align`.
13371337
let unadjusted_abi_align = align.abi;
13381338
if let Some(repr_align) = repr.align {
13391339
align = align.max(AbiAlign::new(repr_align));

compiler/rustc_abi/src/layout/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub struct Layout<'a>(pub Interned<'a, LayoutData<FieldIdx, VariantIdx>>);
7171

7272
impl<'a> fmt::Debug for Layout<'a> {
7373
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
74-
// See comment on `<LayoutS as Debug>::fmt` above.
74+
// See comment on `<LayoutData as Debug>::fmt` above.
7575
self.0.0.fmt(f)
7676
}
7777
}

compiler/rustc_abi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ where
17851785
{
17861786
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17871787
// This is how `Layout` used to print before it become
1788-
// `Interned<LayoutS>`. We print it like this to avoid having to update
1788+
// `Interned<LayoutData>`. We print it like this to avoid having to update
17891789
// expected output in a lot of tests.
17901790
let LayoutData {
17911791
size,

src/tools/rust-analyzer/crates/hir-ty/src/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ pub fn layout_of_ty_query(
268268

269269
// let pointee = tcx.normalize_erasing_regions(param_env, pointee);
270270
// if pointee.is_sized(tcx.at(DUMMY_SP), param_env) {
271-
// return Ok(tcx.mk_layout(LayoutS::scalar(cx, data_ptr)));
271+
// return Ok(tcx.mk_layout(LayoutData::scalar(cx, data_ptr)));
272272
// }
273273

274274
let mut unsized_part = struct_tail_erasing_lifetimes(db, pointee.clone());

0 commit comments

Comments
 (0)