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:
parent
c80dde43f9
commit
3c9765cff1
125 changed files with 396 additions and 394 deletions
|
@ -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),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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| {
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue