From 9554794d22840b5077aa4605fa49a587d3e018b6 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Sat, 27 Dec 2014 18:19:27 +0900 Subject: [PATCH] Add unstable_options method --- src/librustc/session/mod.rs | 3 +++ src/librustc_driver/lib.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 37bdd1673e9ca..c120ac53b7811 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -202,6 +202,9 @@ impl Session { pub fn show_span(&self) -> bool { self.debugging_opt(config::SHOW_SPAN) } + pub fn unstable_options(&self) -> bool { + self.debugging_opt(config::UNSTABLE_OPTIONS) + } pub fn sysroot<'a>(&'a self) -> &'a Path { match self.opts.maybe_sysroot { Some (ref sysroot) => sysroot, diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index e2791aff14e49..5cd87a1e4c080 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -143,7 +143,7 @@ fn run_compiler(args: &[String]) { pretty::parse_pretty(&sess, a.as_slice(), false) }); let pretty = if pretty.is_none() && - sess.debugging_opt(config::UNSTABLE_OPTIONS) { + sess.unstable_options() { matches.opt_str("xpretty").map(|a| { // extended with unstable pretty-print variants pretty::parse_pretty(&sess, a.as_slice(), true)