Skip to content

Commit f319c42

Browse files
committed
---
yaml --- r: 167243 b: refs/heads/try c: 4f7e5ed h: refs/heads/master i: 167241: e0e86fe 167239: 31d2405 v: v3
1 parent d066ae1 commit f319c42

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 023dfb0c898d851dee6ace2f8339b73b5287136b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 023dfb0c898d851dee6ace2f8339b73b5287136b
5-
refs/heads/try: 975a57ce431456a2877af455d6316c1531192dcf
5+
refs/heads/try: 4f7e5ed6601186b26a9e9f142cc07e18cd318d59
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc/session/config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ debugging_opts! {
278278
PARSE_ONLY,
279279
NO_TRANS,
280280
NO_ANALYSIS,
281-
UNSTABLE_OPTIONS
281+
UNSTABLE_OPTIONS,
282+
PRINT_ENUM_SIZES
282283
]
283284
0
284285
}
@@ -331,7 +332,9 @@ pub fn debugging_opts_map() -> Vec<(&'static str, &'static str, u64)> {
331332
("no-analysis", "Parse and expand the source, but run no analysis and",
332333
NO_TRANS),
333334
("unstable-options", "Adds unstable command line options to rustc interface",
334-
UNSTABLE_OPTIONS)]
335+
UNSTABLE_OPTIONS),
336+
("print-enum-sizes", "Print the size of enums and their variants", PRINT_ENUM_SIZES),
337+
]
335338
}
336339

337340
#[deriving(Clone)]

branches/try/src/librustc/session/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ impl Session {
202202
pub fn show_span(&self) -> bool {
203203
self.debugging_opt(config::SHOW_SPAN)
204204
}
205+
pub fn print_enum_sizes(&self) -> bool {
206+
self.debugging_opt(config::PRINT_ENUM_SIZES)
207+
}
205208
pub fn sysroot<'a>(&'a self) -> &'a Path {
206209
match self.opts.maybe_sysroot {
207210
Some (ref sysroot) => sysroot,
@@ -304,4 +307,3 @@ pub fn early_warn(msg: &str) {
304307
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto, None);
305308
emitter.emit(None, msg, None, diagnostic::Warning);
306309
}
307-

branches/try/src/librustc_trans/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ fn trans_enum_variant_or_tuple_like_struct<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx
21252125
fn enum_variant_size_lint(ccx: &CrateContext, enum_def: &ast::EnumDef, sp: Span, id: ast::NodeId) {
21262126
let mut sizes = Vec::new(); // does no allocation if no pushes, thankfully
21272127

2128-
let print_info = log_enabled!(::log::INFO);
2128+
let print_info = ccx.sess().print_enum_sizes();
21292129

21302130
let levels = ccx.tcx().node_lint_levels.borrow();
21312131
let lint_id = lint::LintId::of(lint::builtin::VARIANT_SIZE_DIFFERENCES);

0 commit comments

Comments
 (0)