diff options
| author | bors <bors@rust-lang.org> | 2017-12-27 15:41:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-12-27 15:41:51 +0000 |
| commit | bfbb1f5ce1e6a85a03219767cfc5c9bab3f7bf9e (patch) | |
| tree | b72634f6bee5eb0e51d428fe53ecd1c28c11b907 /src/librustc/session/code_stats.rs | |
| parent | 63efff5a71269ae22b8769e2e6f9aaa2f940f823 (diff) | |
| parent | 09f94bea4aca7696b58dd7e6668ca27d71908984 (diff) | |
| download | rust-bfbb1f5ce1e6a85a03219767cfc5c9bab3f7bf9e.tar.gz rust-bfbb1f5ce1e6a85a03219767cfc5c9bab3f7bf9e.zip | |
Auto merge of #46479 - bkchr:termination_trait, r=arielb1
Implements RFC 1937: `?` in `main` This is the first part of the RFC 1937 that supports new `Termination` trait in the rust `main` function. Thanks @nikomatsakis, @arielb1 and all other people in the gitter channel for all your help! The support for doctest and `#[test]` is still missing, bu as @nikomatsakis said, smaller pull requests are better :)
Diffstat (limited to 'src/librustc/session/code_stats.rs')
| -rw-r--r-- | src/librustc/session/code_stats.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/librustc/session/code_stats.rs b/src/librustc/session/code_stats.rs index 118b84113a0..64f405e0f24 100644 --- a/src/librustc/session/code_stats.rs +++ b/src/librustc/session/code_stats.rs @@ -155,11 +155,19 @@ impl CodeStats { // Include field alignment in output only if it caused padding injection if min_offset != offset { - let pad = offset - min_offset; - println!("print-type-size {}padding: {} bytes", - indent, pad); - println!("print-type-size {}field `.{}`: {} bytes, alignment: {} bytes", - indent, name, size, align); + if offset > min_offset { + let pad = offset - min_offset; + println!("print-type-size {}padding: {} bytes", + indent, pad); + println!("print-type-size {}field `.{}`: {} bytes, \ + alignment: {} bytes", + indent, name, size, align); + } else { + println!("print-type-size {}field `.{}`: {} bytes, \ + offset: {} bytes, \ + alignment: {} bytes", + indent, name, size, offset, align); + } } else { println!("print-type-size {}field `.{}`: {} bytes", indent, name, size); |
