1
Fork 0

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.
This commit is contained in:
Joshua Nelson 2022-07-06 07:44:47 -05:00
parent c80dde43f9
commit 3c9765cff1
125 changed files with 396 additions and 394 deletions

View file

@ -456,7 +456,7 @@ impl<'a> CrateLoader<'a> {
proc_macro_locator.is_proc_macro = true;
// Load the proc macro crate for the target
let (locator, target_result) = if self.sess.opts.debugging_opts.dual_proc_macros {
let (locator, target_result) = if self.sess.opts.unstable_opts.dual_proc_macros {
proc_macro_locator.reset();
let result = match self.load(&mut proc_macro_locator)? {
Some(LoadResult::Previous(cnum)) => {
@ -485,7 +485,7 @@ impl<'a> CrateLoader<'a> {
return Ok(None);
};
Ok(Some(if self.sess.opts.debugging_opts.dual_proc_macros {
Ok(Some(if self.sess.opts.unstable_opts.dual_proc_macros {
let host_result = match host_result {
LoadResult::Previous(..) => {
panic!("host and target proc macros must be loaded in lock-step")
@ -762,9 +762,9 @@ impl<'a> CrateLoader<'a> {
}
fn inject_profiler_runtime(&mut self, krate: &ast::Crate) {
if self.sess.opts.debugging_opts.no_profiler_runtime
if self.sess.opts.unstable_opts.no_profiler_runtime
|| !(self.sess.instrument_coverage()
|| self.sess.opts.debugging_opts.profile
|| self.sess.opts.unstable_opts.profile
|| self.sess.opts.cg.profile_generate.enabled())
{
return;
@ -772,7 +772,7 @@ impl<'a> CrateLoader<'a> {
info!("loading profiler");
let name = Symbol::intern(&self.sess.opts.debugging_opts.profiler_runtime);
let name = Symbol::intern(&self.sess.opts.unstable_opts.profiler_runtime);
if name == sym::profiler_builtins && self.sess.contains_name(&krate.attrs, sym::no_core) {
self.sess.err(
"`profiler_builtins` crate (required by compiler options) \

View file

@ -419,7 +419,7 @@ fn verify_ok(tcx: TyCtxt<'_>, list: &[Linkage]) {
}
let found_drop_strategy = tcx.panic_in_drop_strategy(cnum);
if tcx.sess.opts.debugging_opts.panic_in_drop != found_drop_strategy {
if tcx.sess.opts.unstable_opts.panic_in_drop != found_drop_strategy {
sess.err(&format!(
"the crate `{}` is compiled with the \
panic-in-drop strategy `{}` which is \
@ -427,7 +427,7 @@ fn verify_ok(tcx: TyCtxt<'_>, list: &[Linkage]) {
strategy of `{}`",
tcx.crate_name(cnum),
found_drop_strategy.desc(),
tcx.sess.opts.debugging_opts.panic_in_drop.desc()
tcx.sess.opts.unstable_opts.panic_in_drop.desc()
));
}
}

View file

@ -1179,7 +1179,7 @@ impl CrateError {
err.help("consider building the standard library from source with `cargo build -Zbuild-std`");
}
} else if crate_name
== Symbol::intern(&sess.opts.debugging_opts.profiler_runtime)
== Symbol::intern(&sess.opts.unstable_opts.profiler_runtime)
{
err.note("the compiler may have been built without the profiler runtime");
} else if crate_name.as_str().starts_with("rustc_") {

View file

@ -1475,14 +1475,14 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
// the `rust-src` component in `Src::run` in `src/bootstrap/dist.rs`.
let virtual_rust_source_base_dir = [
option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from),
sess.opts.debugging_opts.simulate_remapped_rust_src_base.clone(),
sess.opts.unstable_opts.simulate_remapped_rust_src_base.clone(),
]
.into_iter()
.filter(|_| {
// Only spend time on further checks if we have what to translate *to*.
sess.opts.real_rust_source_base_dir.is_some()
// Some tests need the translation to be always skipped.
&& sess.opts.debugging_opts.translate_remapped_path_to_local_path
&& sess.opts.unstable_opts.translate_remapped_path_to_local_path
})
.flatten()
.filter(|virtual_dir| {
@ -1584,7 +1584,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
// `try_to_translate_virtual_to_real` don't have to worry about how the
// compiler is bootstrapped.
if let Some(virtual_dir) =
&sess.opts.debugging_opts.simulate_remapped_rust_src_base
&sess.opts.unstable_opts.simulate_remapped_rust_src_base
{
if let Some(real_dir) = &sess.opts.real_rust_source_base_dir {
if let rustc_span::FileName::Real(ref mut old_name) = name {

View file

@ -665,7 +665,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
hash: tcx.crate_hash(LOCAL_CRATE),
stable_crate_id: tcx.def_path_hash(LOCAL_CRATE.as_def_id()).stable_crate_id(),
required_panic_strategy: tcx.required_panic_strategy(LOCAL_CRATE),
panic_in_drop_strategy: tcx.sess.opts.debugging_opts.panic_in_drop,
panic_in_drop_strategy: tcx.sess.opts.unstable_opts.panic_in_drop,
edition: tcx.sess.edition(),
has_global_allocator: tcx.has_global_allocator(LOCAL_CRATE),
has_panic_handler: tcx.has_panic_handler(LOCAL_CRATE),
@ -862,7 +862,7 @@ fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool) {
// Constructors
DefKind::Ctor(_, _) => {
let mir_opt_base = tcx.sess.opts.output_types.should_codegen()
|| tcx.sess.opts.debugging_opts.always_encode_mir;
|| tcx.sess.opts.unstable_opts.always_encode_mir;
(true, mir_opt_base)
}
// Constants
@ -880,7 +880,7 @@ fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool) {
// The function has a `const` modifier or is in a `#[const_trait]`.
let is_const_fn = tcx.is_const_fn_raw(def_id.to_def_id())
|| tcx.is_const_default_method(def_id.to_def_id());
let always_encode_mir = tcx.sess.opts.debugging_opts.always_encode_mir;
let always_encode_mir = tcx.sess.opts.unstable_opts.always_encode_mir;
(is_const_fn, needs_inline || always_encode_mir)
}
// Closures can't be const fn.
@ -889,7 +889,7 @@ fn should_encode_mir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> (bool, bool) {
let needs_inline = (generics.requires_monomorphization(tcx)
|| tcx.codegen_fn_attrs(def_id).requests_inline())
&& tcx.sess.opts.output_types.should_codegen();
let always_encode_mir = tcx.sess.opts.debugging_opts.always_encode_mir;
let always_encode_mir = tcx.sess.opts.unstable_opts.always_encode_mir;
(false, needs_inline || always_encode_mir)
}
// Generators require optimized MIR to compute layout.
@ -1360,7 +1360,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
// The query lookup can take a measurable amount of time in crates with many items. Check if
// the stability attributes are even enabled before using their queries.
if self.feat.staged_api || self.tcx.sess.opts.debugging_opts.force_unstable_if_unmarked {
if self.feat.staged_api || self.tcx.sess.opts.unstable_opts.force_unstable_if_unmarked {
if let Some(stab) = self.tcx.lookup_stability(def_id) {
record!(self.tables.lookup_stability[def_id] <- stab)
}
@ -1372,7 +1372,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
// The query lookup can take a measurable amount of time in crates with many items. Check if
// the stability attributes are even enabled before using their queries.
if self.feat.staged_api || self.tcx.sess.opts.debugging_opts.force_unstable_if_unmarked {
if self.feat.staged_api || self.tcx.sess.opts.unstable_opts.force_unstable_if_unmarked {
if let Some(stab) = self.tcx.lookup_const_stability(def_id) {
record!(self.tables.lookup_const_stability[def_id] <- stab)
}