diff options
| author | Joshua Nelson <jnelson@cloudflare.com> | 2022-07-06 07:44:47 -0500 | 
|---|---|---|
| committer | Joshua Nelson <jnelson@cloudflare.com> | 2022-07-13 17:47:06 -0500 | 
| commit | 3c9765cff18a3c4ba2962ea59d4c3f6966f9700c (patch) | |
| tree | 803c007988b9d19bafd59699de01bf64d030f452 /compiler/rustc_interface | |
| parent | c80dde43f992f3eb419899a34551b84c6301f8e8 (diff) | |
| download | rust-3c9765cff18a3c4ba2962ea59d4c3f6966f9700c.tar.gz rust-3c9765cff18a3c4ba2962ea59d4c3f6966f9700c.zip | |
Rename `debugging_opts` to `unstable_opts`
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
Diffstat (limited to 'compiler/rustc_interface')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 26 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/queries.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/tests.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/util.rs | 8 | 
5 files changed, 27 insertions, 27 deletions
| diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index e7563933c88..6c7ddb4531e 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -300,7 +300,7 @@ pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R ); } - let temps_dir = sess.opts.debugging_opts.temps_dir.as_ref().map(|o| PathBuf::from(&o)); + let temps_dir = sess.opts.unstable_opts.temps_dir.as_ref().map(|o| PathBuf::from(&o)); let compiler = Compiler { sess, @@ -333,7 +333,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se tracing::trace!("run_compiler"); util::run_in_thread_pool_with_globals( config.opts.edition, - config.opts.debugging_opts.threads, + config.opts.unstable_opts.threads, || create_compiler_and_run(config, f), ) } diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index b7d1d6edfaa..97b8139f9da 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -58,16 +58,16 @@ pub fn parse<'a>(sess: &'a Session, input: &Input) -> PResult<'a, ast::Crate> { } })?; - if sess.opts.debugging_opts.input_stats { + if sess.opts.unstable_opts.input_stats { eprintln!("Lines of code: {}", sess.source_map().count_lines()); eprintln!("Pre-expansion node count: {}", count_nodes(&krate)); } - if let Some(ref s) = sess.opts.debugging_opts.show_span { + if let Some(ref s) = sess.opts.unstable_opts.show_span { rustc_ast_passes::show_span::run(sess.diagnostic(), s, &krate); } - if sess.opts.debugging_opts.hir_stats { + if sess.opts.unstable_opts.hir_stats { hir_stats::print_ast_stats(&krate, "PRE EXPANSION AST STATS"); } @@ -181,7 +181,7 @@ pub fn register_plugins<'a>( rustc_builtin_macros::cmdline_attrs::inject( krate, &sess.parse_sess, - &sess.opts.debugging_opts.crate_attr, + &sess.opts.unstable_opts.crate_attr, ) }); @@ -213,7 +213,7 @@ pub fn register_plugins<'a>( } let mut lint_store = rustc_lint::new_lint_store( - sess.opts.debugging_opts.no_interleave_lints, + sess.opts.unstable_opts.no_interleave_lints, sess.unstable_options(), ); register_lints(sess, &mut lint_store); @@ -327,10 +327,10 @@ pub fn configure_and_expand( let cfg = rustc_expand::expand::ExpansionConfig { features: Some(features), recursion_limit, - trace_mac: sess.opts.debugging_opts.trace_macros, + trace_mac: sess.opts.unstable_opts.trace_macros, should_test: sess.opts.test, - span_debug: sess.opts.debugging_opts.span_debug, - proc_macro_backtrace: sess.opts.debugging_opts.proc_macro_backtrace, + span_debug: sess.opts.unstable_opts.span_debug, + proc_macro_backtrace: sess.opts.unstable_opts.proc_macro_backtrace, ..rustc_expand::expand::ExpansionConfig::default(crate_name.to_string()) }; @@ -413,11 +413,11 @@ pub fn configure_and_expand( // Done with macro expansion! - if sess.opts.debugging_opts.input_stats { + if sess.opts.unstable_opts.input_stats { eprintln!("Post-expansion node count: {}", count_nodes(&krate)); } - if sess.opts.debugging_opts.hir_stats { + if sess.opts.unstable_opts.hir_stats { hir_stats::print_ast_stats(&krate, "POST EXPANSION AST STATS"); } @@ -500,7 +500,7 @@ fn generated_output_paths( out_filenames.push(p); } } - OutputType::DepInfo if sess.opts.debugging_opts.dep_info_omit_d_target => { + OutputType::DepInfo if sess.opts.unstable_opts.dep_info_omit_d_target => { // Don't add the dep-info output when omitting it from dep-info targets } _ => { @@ -598,7 +598,7 @@ fn write_out_deps( files.extend(extra_tracked_files); if sess.binary_dep_depinfo() { - if let Some(ref backend) = sess.opts.debugging_opts.codegen_backend { + if let Some(ref backend) = sess.opts.unstable_opts.codegen_backend { if backend.contains('.') { // If the backend name contain a `.`, it is the path to an external dynamic // library. If not, it is not a path. @@ -928,7 +928,7 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { sess.time("MIR_effect_checking", || { for def_id in tcx.hir().body_owners() { tcx.ensure().thir_check_unsafety(def_id); - if !tcx.sess.opts.debugging_opts.thir_unsafeck { + if !tcx.sess.opts.unstable_opts.thir_unsafeck { rustc_mir_transform::check_unsafety::check_unsafety(tcx, def_id); } tcx.ensure().has_ffi_unwind_calls(def_id); diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 8ffb1ad0539..73402ae0842 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -357,7 +357,7 @@ impl Linker { return Ok(()); } - if sess.opts.debugging_opts.no_link { + if sess.opts.unstable_opts.no_link { let encoded = CodegenResults::serialize_rlink(&codegen_results); let rlink_file = self.prepare_outputs.with_extension(config::RLINK_EXT); std::fs::write(&rlink_file, encoded).map_err(|err| { diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index 55827ff583a..9c0b534798e 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -629,14 +629,14 @@ fn test_top_level_options_tracked_no_crate() { } #[test] -fn test_debugging_options_tracking_hash() { +fn test_unstable_options_tracking_hash() { let reference = Options::default(); let mut opts = Options::default(); macro_rules! untracked { ($name: ident, $non_default_value: expr) => { - assert_ne!(opts.debugging_opts.$name, $non_default_value); - opts.debugging_opts.$name = $non_default_value; + assert_ne!(opts.unstable_opts.$name, $non_default_value); + opts.unstable_opts.$name = $non_default_value; assert_same_hash(&reference, &opts); }; } @@ -705,8 +705,8 @@ fn test_debugging_options_tracking_hash() { macro_rules! tracked { ($name: ident, $non_default_value: expr) => { opts = reference.clone(); - assert_ne!(opts.debugging_opts.$name, $non_default_value); - opts.debugging_opts.$name = $non_default_value; + assert_ne!(opts.unstable_opts.$name, $non_default_value); + opts.unstable_opts.$name = $non_default_value; assert_different_hash(&reference, &opts); }; } @@ -804,8 +804,8 @@ fn test_debugging_options_tracking_hash() { macro_rules! tracked_no_crate_hash { ($name: ident, $non_default_value: expr) => { opts = reference.clone(); - assert_ne!(opts.debugging_opts.$name, $non_default_value); - opts.debugging_opts.$name = $non_default_value; + assert_ne!(opts.unstable_opts.$name, $non_default_value); + opts.unstable_opts.$name = $non_default_value; assert_non_crate_hash_different(&reference, &opts); }; } diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index f4b51b5a442..01173bff126 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -79,7 +79,7 @@ pub fn create_session( } else { get_codegen_backend( &sopts.maybe_sysroot, - sopts.debugging_opts.codegen_backend.as_ref().map(|name| &name[..]), + sopts.unstable_opts.codegen_backend.as_ref().map(|name| &name[..]), ) }; @@ -89,9 +89,9 @@ pub fn create_session( let bundle = match rustc_errors::fluent_bundle( sopts.maybe_sysroot.clone(), sysroot_candidates(), - sopts.debugging_opts.translate_lang.clone(), - sopts.debugging_opts.translate_additional_ftl.as_deref(), - sopts.debugging_opts.translate_directionality_markers, + sopts.unstable_opts.translate_lang.clone(), + sopts.unstable_opts.translate_additional_ftl.as_deref(), + sopts.unstable_opts.translate_directionality_markers, ) { Ok(bundle) => bundle, Err(e) => { | 
