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_middle/src | |
| 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_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/lint.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/middle/limits.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/middle/stability.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/generic_graph.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/generic_graphviz.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/graphviz.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/mono.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/mir/pretty.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/instance.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/layout.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/pretty.rs | 8 | 
14 files changed, 27 insertions, 27 deletions
| diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index 3e99ba5742a..d3e10fce8a0 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -1149,7 +1149,7 @@ pub(super) fn crate_hash(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Svh { hir_body_hash.hash_stable(&mut hcx, &mut stable_hasher); upstream_crates.hash_stable(&mut hcx, &mut stable_hasher); source_file_names.hash_stable(&mut hcx, &mut stable_hasher); - if tcx.sess.opts.debugging_opts.incremental_relative_spans { + if tcx.sess.opts.unstable_opts.incremental_relative_spans { let definitions = tcx.definitions_untracked(); let mut owner_spans: Vec<_> = krate .owners diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index 4b156de410d..2f45222de47 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -300,7 +300,7 @@ pub fn struct_lint_level<'s, 'd>( let has_future_breakage = future_incompatible.map_or( // Default allow lints trigger too often for testing. - sess.opts.debugging_opts.future_incompat_test && lint.default_level != Level::Allow, + sess.opts.unstable_opts.future_incompat_test && lint.default_level != Level::Allow, |incompat| { matches!(incompat.reason, FutureIncompatibilityReason::FutureReleaseErrorReportNow) }, diff --git a/compiler/rustc_middle/src/middle/limits.rs b/compiler/rustc_middle/src/middle/limits.rs index 20dcb670cd6..acced0492ef 100644 --- a/compiler/rustc_middle/src/middle/limits.rs +++ b/compiler/rustc_middle/src/middle/limits.rs @@ -25,7 +25,7 @@ pub fn provide(providers: &mut ty::query::Providers) { tcx.hir().krate_attrs(), tcx.sess, sym::move_size_limit, - tcx.sess.opts.debugging_opts.move_size_limit.unwrap_or(0), + tcx.sess.opts.unstable_opts.move_size_limit.unwrap_or(0), ), type_length_limit: get_limit( tcx.hir().krate_attrs(), diff --git a/compiler/rustc_middle/src/middle/stability.rs b/compiler/rustc_middle/src/middle/stability.rs index 802b7852bac..2de8d318090 100644 --- a/compiler/rustc_middle/src/middle/stability.rs +++ b/compiler/rustc_middle/src/middle/stability.rs @@ -443,7 +443,7 @@ impl<'tcx> TyCtxt<'tcx> { // compiling a compiler crate), then let this missing feature // annotation slide. if feature == sym::rustc_private && issue == NonZeroU32::new(27812) { - if self.sess.opts.debugging_opts.force_unstable_if_unmarked { + if self.sess.opts.unstable_opts.force_unstable_if_unmarked { return EvalResult::Allow; } } diff --git a/compiler/rustc_middle/src/mir/generic_graph.rs b/compiler/rustc_middle/src/mir/generic_graph.rs index a4d78911b27..f3621cd99d3 100644 --- a/compiler/rustc_middle/src/mir/generic_graph.rs +++ b/compiler/rustc_middle/src/mir/generic_graph.rs @@ -8,7 +8,7 @@ pub fn mir_fn_to_generic_graph<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'_>) -> Grap let def_id = body.source.def_id(); let def_name = graphviz_safe_def_name(def_id); let graph_name = format!("Mir_{}", def_name); - let dark_mode = tcx.sess.opts.debugging_opts.graphviz_dark_mode; + let dark_mode = tcx.sess.opts.unstable_opts.graphviz_dark_mode; // Nodes let nodes: Vec<Node> = body diff --git a/compiler/rustc_middle/src/mir/generic_graphviz.rs b/compiler/rustc_middle/src/mir/generic_graphviz.rs index c907680bda1..11ac45943ac 100644 --- a/compiler/rustc_middle/src/mir/generic_graphviz.rs +++ b/compiler/rustc_middle/src/mir/generic_graphviz.rs @@ -56,11 +56,11 @@ impl< writeln!(w, "{} {}{} {{", kind, cluster, self.graphviz_name)?; // Global graph properties - let font = format!(r#"fontname="{}""#, tcx.sess.opts.debugging_opts.graphviz_font); + let font = format!(r#"fontname="{}""#, tcx.sess.opts.unstable_opts.graphviz_font); let mut graph_attrs = vec![&font[..]]; let mut content_attrs = vec![&font[..]]; - let dark_mode = tcx.sess.opts.debugging_opts.graphviz_dark_mode; + let dark_mode = tcx.sess.opts.unstable_opts.graphviz_dark_mode; if dark_mode { graph_attrs.push(r#"bgcolor="black""#); graph_attrs.push(r#"fontcolor="white""#); diff --git a/compiler/rustc_middle/src/mir/graphviz.rs b/compiler/rustc_middle/src/mir/graphviz.rs index 92c7a358c0a..5de56dad07a 100644 --- a/compiler/rustc_middle/src/mir/graphviz.rs +++ b/compiler/rustc_middle/src/mir/graphviz.rs @@ -57,11 +57,11 @@ where W: Write, { // Global graph properties - let font = format!(r#"fontname="{}""#, tcx.sess.opts.debugging_opts.graphviz_font); + let font = format!(r#"fontname="{}""#, tcx.sess.opts.unstable_opts.graphviz_font); let mut graph_attrs = vec![&font[..]]; let mut content_attrs = vec![&font[..]]; - let dark_mode = tcx.sess.opts.debugging_opts.graphviz_dark_mode; + let dark_mode = tcx.sess.opts.unstable_opts.graphviz_dark_mode; if dark_mode { graph_attrs.push(r#"bgcolor="black""#); graph_attrs.push(r#"fontcolor="white""#); diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index 333a88ba520..f61cb7e8c47 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -1884,7 +1884,7 @@ impl<'tcx> Debug for Rvalue<'tcx> { // When printing regions, add trailing space if necessary. let print_region = ty::tls::with(|tcx| { - tcx.sess.verbose() || tcx.sess.opts.debugging_opts.identify_regions + tcx.sess.verbose() || tcx.sess.opts.unstable_opts.identify_regions }); let region = if print_region { let mut region = region.to_string(); @@ -1954,7 +1954,7 @@ impl<'tcx> Debug for Rvalue<'tcx> { AggregateKind::Closure(def_id, substs) => ty::tls::with(|tcx| { if let Some(def_id) = def_id.as_local() { - let name = if tcx.sess.opts.debugging_opts.span_free_formats { + let name = if tcx.sess.opts.unstable_opts.span_free_formats { let substs = tcx.lift(substs).unwrap(); format!( "[closure@{}]", diff --git a/compiler/rustc_middle/src/mir/mono.rs b/compiler/rustc_middle/src/mir/mono.rs index 021f2782736..8b51c5b3da5 100644 --- a/compiler/rustc_middle/src/mir/mono.rs +++ b/compiler/rustc_middle/src/mir/mono.rs @@ -90,7 +90,7 @@ impl<'tcx> MonoItem<'tcx> { let generate_cgu_internal_copies = tcx .sess .opts - .debugging_opts + .unstable_opts .inline_in_all_cgus .unwrap_or_else(|| tcx.sess.opts.optimize != OptLevel::No) && !tcx.sess.link_dead_code(); @@ -459,7 +459,7 @@ impl<'tcx> CodegenUnitNameBuilder<'tcx> { { let cgu_name = self.build_cgu_name_no_mangle(cnum, components, special_suffix); - if self.tcx.sess.opts.debugging_opts.human_readable_cgu_names { + if self.tcx.sess.opts.unstable_opts.human_readable_cgu_names { cgu_name } else { Symbol::intern(&CodegenUnit::mangle_name(cgu_name.as_str())) diff --git a/compiler/rustc_middle/src/mir/pretty.rs b/compiler/rustc_middle/src/mir/pretty.rs index e2fa37ee7be..970043d427f 100644 --- a/compiler/rustc_middle/src/mir/pretty.rs +++ b/compiler/rustc_middle/src/mir/pretty.rs @@ -90,7 +90,7 @@ pub fn dump_mir<'tcx, F>( } pub fn dump_enabled<'tcx>(tcx: TyCtxt<'tcx>, pass_name: &str, def_id: DefId) -> bool { - let Some(ref filters) = tcx.sess.opts.debugging_opts.dump_mir else { + let Some(ref filters) = tcx.sess.opts.unstable_opts.dump_mir else { return false; }; // see notes on #41697 below @@ -141,7 +141,7 @@ fn dump_matched_mir_node<'tcx, F>( extra_data(PassWhere::AfterCFG, &mut file)?; }; - if tcx.sess.opts.debugging_opts.dump_mir_graphviz { + if tcx.sess.opts.unstable_opts.dump_mir_graphviz { let _: io::Result<()> = try { let mut file = create_dump_file(tcx, "dot", pass_num, pass_name, disambiguator, body.source)?; @@ -149,7 +149,7 @@ fn dump_matched_mir_node<'tcx, F>( }; } - if let Some(spanview) = tcx.sess.opts.debugging_opts.dump_mir_spanview { + if let Some(spanview) = tcx.sess.opts.unstable_opts.dump_mir_spanview { let _: io::Result<()> = try { let file_basename = dump_file_basename(tcx, pass_num, pass_name, disambiguator, body.source); @@ -175,7 +175,7 @@ fn dump_file_basename<'tcx>( None => String::new(), }; - let pass_num = if tcx.sess.opts.debugging_opts.dump_mir_exclude_pass_number { + let pass_num = if tcx.sess.opts.unstable_opts.dump_mir_exclude_pass_number { String::new() } else { match pass_num { @@ -214,7 +214,7 @@ fn dump_file_basename<'tcx>( /// graphviz data or other things. fn dump_path(tcx: TyCtxt<'_>, basename: &str, extension: &str) -> PathBuf { let mut file_path = PathBuf::new(); - file_path.push(Path::new(&tcx.sess.opts.debugging_opts.dump_mir_dir)); + file_path.push(Path::new(&tcx.sess.opts.unstable_opts.dump_mir_dir)); let file_name = format!("{}.{}", basename, extension,); diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs index 391abdbe84c..4f9bbc135ec 100644 --- a/compiler/rustc_middle/src/ty/instance.rs +++ b/compiler/rustc_middle/src/ty/instance.rs @@ -605,7 +605,7 @@ impl<'tcx> Instance<'tcx> { /// identity parameters if they are determined to be unused in `instance.def`. pub fn polymorphize(self, tcx: TyCtxt<'tcx>) -> Self { debug!("polymorphize: running polymorphization analysis"); - if !tcx.sess.opts.debugging_opts.polymorphize { + if !tcx.sess.opts.unstable_opts.polymorphize { return self; } diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 1ed41db099c..71c93d05792 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -1914,7 +1914,7 @@ impl<'tcx> LayoutCx<'tcx, TyCtxt<'tcx>> { fn record_layout_for_printing(&self, layout: TyAndLayout<'tcx>) { // If we are running with `-Zprint-type-sizes`, maybe record layouts // for dumping later. - if self.tcx.sess.opts.debugging_opts.print_type_sizes { + if self.tcx.sess.opts.unstable_opts.print_type_sizes { self.record_layout_for_printing_outlined(layout) } } @@ -2916,7 +2916,7 @@ pub fn fn_can_unwind<'tcx>(tcx: TyCtxt<'tcx>, fn_def_id: Option<DefId>, abi: Spe // // This is not part of `codegen_fn_attrs` as it can differ between crates // and therefore cannot be computed in core. - if tcx.sess.opts.debugging_opts.panic_in_drop == PanicStrategy::Abort { + if tcx.sess.opts.unstable_opts.panic_in_drop == PanicStrategy::Abort { if Some(did) == tcx.lang_items().drop_in_place_fn() { return false; } diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index c2c7b3df844..22a1fd34e27 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1761,7 +1761,7 @@ impl ReprOptions { // If the user defined a custom seed for layout randomization, xor the item's // path hash with the user defined seed, this will allowing determinism while // still allowing users to further randomize layout generation for e.g. fuzzing - if let Some(user_seed) = tcx.sess.opts.debugging_opts.layout_seed { + if let Some(user_seed) = tcx.sess.opts.unstable_opts.layout_seed { field_shuffle_seed ^= user_seed; } @@ -1794,7 +1794,7 @@ impl ReprOptions { // If `-Z randomize-layout` was enabled for the type definition then we can // consider performing layout randomization - if tcx.sess.opts.debugging_opts.randomize_layout { + if tcx.sess.opts.unstable_opts.randomize_layout { flags.insert(ReprFlags::RANDOMIZE_LAYOUT); } diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index f721a175c98..81c4d2ae346 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -297,7 +297,7 @@ pub trait PrettyPrinter<'tcx>: mut self, def_id: DefId, ) -> Result<(Self::Path, bool), Self::Error> { - if !self.tcx().sess.opts.debugging_opts.trim_diagnostic_paths + if !self.tcx().sess.opts.unstable_opts.trim_diagnostic_paths || matches!(self.tcx().sess.opts.trimmed_def_paths, TrimmedDefPaths::Never) || NO_TRIMMED_PATH.with(|flag| flag.get()) || SHOULD_PREFIX_WITH_CRATE.with(|flag| flag.get()) @@ -712,7 +712,7 @@ pub trait PrettyPrinter<'tcx>: p!(write("closure")); // FIXME(eddyb) should use `def_span`. if let Some(did) = did.as_local() { - if self.tcx().sess.opts.debugging_opts.span_free_formats { + if self.tcx().sess.opts.unstable_opts.span_free_formats { p!("@", print_def_path(did.to_def_id(), substs)); } else { let span = self.tcx().def_span(did); @@ -1919,7 +1919,7 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> { return true; } - let identify_regions = self.tcx.sess.opts.debugging_opts.identify_regions; + let identify_regions = self.tcx.sess.opts.unstable_opts.identify_regions; match *region { ty::ReEarlyBound(ref data) => { @@ -1992,7 +1992,7 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { return Ok(self); } - let identify_regions = self.tcx.sess.opts.debugging_opts.identify_regions; + let identify_regions = self.tcx.sess.opts.unstable_opts.identify_regions; // These printouts are concise. They do not contain all the information // the user might want to diagnose an error, but there is basically no way | 
