pub fn no_landing_pads(&self) -> bool {
self.debugging_opt(config::NO_LANDING_PADS)
}
- 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 print_enum_sizes(&self) -> bool {
+ self.debugging_opt(config::PRINT_ENUM_SIZES)
+ }
pub fn sysroot<'a>(&'a self) -> &'a Path {
match self.opts.maybe_sysroot {
Some (ref sysroot) => sysroot,
});
if sess.opts.debugging_opts & config::AST_JSON_NOEXPAND != 0 {
- let mut stdout = io::BufferedWriter::new(io::stdout());
- let mut json = json::PrettyEncoder::new(&mut stdout);
- // unwrapping so IoError isn't ignored
- krate.encode(&mut json).unwrap();
+ println!("{}", json::as_json(&krate));
}
- if sess.show_span() {
- syntax::show_span::run(sess.diagnostic(), &krate);
+ if let Some(ref s) = sess.opts.show_span {
+ syntax::show_span::run(sess.diagnostic(), s.as_slice(), &krate);
}
krate