Skip to content

Commit fac9cf8

Browse files
committed
code_stats.record_type_size
1 parent ff7855a commit fac9cf8

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/librustc/session/code_stats.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_target::abi::{Align, Size};
1+
use rustc_target::abi::{MemoryPosition, Size};
22
use rustc_data_structures::fx::{FxHashSet};
33
use std::cmp::{self, Ordering};
44
use rustc_data_structures::sync::Lock;
@@ -54,8 +54,7 @@ impl CodeStats {
5454
pub fn record_type_size<S: ToString>(&self,
5555
kind: DataTypeKind,
5656
type_desc: S,
57-
align: Align,
58-
overall_size: Size,
57+
mem_pos: MemoryPosition,
5958
packed: bool,
6059
opt_discr_size: Option<Size>,
6160
mut variants: Vec<VariantInfo>) {
@@ -68,8 +67,8 @@ impl CodeStats {
6867
let info = TypeSizeInfo {
6968
kind,
7069
type_description: type_desc.to_string(),
71-
align: align.bytes(),
72-
overall_size: overall_size.bytes(),
70+
align: mem_pos.align.bytes(),
71+
overall_size: mem_pos.size.bytes(),
7372
packed: packed,
7473
opt_discr_size: opt_discr_size.map(|s| s.bytes()),
7574
variants,

src/librustc/ty/layout.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,8 +1612,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> {
16121612
let type_desc = format!("{:?}", layout.ty);
16131613
self.tcx.sess.code_stats.record_type_size(kind,
16141614
type_desc,
1615-
layout.pref_pos.align.abi,
1616-
layout.pref_pos.size,
1615+
layout.pref_pos.mem_pos(),
16171616
packed,
16181617
opt_discr_size,
16191618
variants);

0 commit comments

Comments
 (0)