From 72e8690c0495d9ba48e27e66f824c6bdcdb1664c Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 24 Oct 2023 16:19:28 +1100 Subject: Remove unused `never_type` feature. --- compiler/rustc_incremental/src/lib.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'compiler/rustc_incremental/src/lib.rs') diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs index bdae07a3946..1e8bb2c4045 100644 --- a/compiler/rustc_incremental/src/lib.rs +++ b/compiler/rustc_incremental/src/lib.rs @@ -5,7 +5,6 @@ #![cfg_attr(not(bootstrap), doc(rust_logo))] #![cfg_attr(not(bootstrap), feature(rustdoc_internals))] #![cfg_attr(not(bootstrap), allow(internal_features))] -#![feature(never_type)] #![recursion_limit = "256"] #![deny(rustc::untranslatable_diagnostic)] #![deny(rustc::diagnostic_outside_of_impl)] -- cgit 1.4.1-3-g733a5 From ca29c272e7ab8535e1870a967a6d990c85227585 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 24 Oct 2023 16:34:03 +1100 Subject: Reduce exposure of three functions used only within `rustc_incremental`. --- compiler/rustc_incremental/src/lib.rs | 3 --- compiler/rustc_incremental/src/persist/fs.rs | 4 ++-- compiler/rustc_incremental/src/persist/mod.rs | 3 --- compiler/rustc_incremental/src/persist/work_product.rs | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) (limited to 'compiler/rustc_incremental/src/lib.rs') diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs index 1e8bb2c4045..e1c5e6e8d36 100644 --- a/compiler/rustc_incremental/src/lib.rs +++ b/compiler/rustc_incremental/src/lib.rs @@ -20,13 +20,10 @@ mod persist; use assert_dep_graph::assert_dep_graph; pub use persist::copy_cgu_workproduct_to_incr_comp_cache_dir; -pub use persist::delete_workproduct_files; pub use persist::finalize_session_directory; -pub use persist::garbage_collect_session_directories; pub use persist::in_incr_comp_dir; pub use persist::in_incr_comp_dir_sess; pub use persist::load_query_result_cache; -pub use persist::prepare_session_directory; pub use persist::save_dep_graph; pub use persist::save_work_product_index; pub use persist::setup_dep_graph; diff --git a/compiler/rustc_incremental/src/persist/fs.rs b/compiler/rustc_incremental/src/persist/fs.rs index db8ea2bfe48..ecae79cbd21 100644 --- a/compiler/rustc_incremental/src/persist/fs.rs +++ b/compiler/rustc_incremental/src/persist/fs.rs @@ -202,7 +202,7 @@ pub fn in_incr_comp_dir(incr_comp_session_dir: &Path, file_name: &str) -> PathBu /// The garbage collection will take care of it. /// /// [`rustc_interface::queries::dep_graph`]: ../../rustc_interface/struct.Queries.html#structfield.dep_graph -pub fn prepare_session_directory( +pub(crate) fn prepare_session_directory( sess: &Session, crate_name: Symbol, stable_crate_id: StableCrateId, @@ -621,7 +621,7 @@ fn is_old_enough_to_be_collected(timestamp: SystemTime) -> bool { } /// Runs garbage collection for the current session. -pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> { +pub(crate) fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> { debug!("garbage_collect_session_directories() - begin"); let session_directory = sess.incr_comp_session_dir(); diff --git a/compiler/rustc_incremental/src/persist/mod.rs b/compiler/rustc_incremental/src/persist/mod.rs index fdecaca5a2d..94c05f4a2c8 100644 --- a/compiler/rustc_incremental/src/persist/mod.rs +++ b/compiler/rustc_incremental/src/persist/mod.rs @@ -11,14 +11,11 @@ mod save; mod work_product; pub use fs::finalize_session_directory; -pub use fs::garbage_collect_session_directories; pub use fs::in_incr_comp_dir; pub use fs::in_incr_comp_dir_sess; -pub use fs::prepare_session_directory; pub use load::load_query_result_cache; pub use load::setup_dep_graph; pub use load::LoadResult; pub use save::save_dep_graph; pub use save::save_work_product_index; pub use work_product::copy_cgu_workproduct_to_incr_comp_cache_dir; -pub use work_product::delete_workproduct_files; diff --git a/compiler/rustc_incremental/src/persist/work_product.rs b/compiler/rustc_incremental/src/persist/work_product.rs index bce5ca1e16b..6be35a4a8dc 100644 --- a/compiler/rustc_incremental/src/persist/work_product.rs +++ b/compiler/rustc_incremental/src/persist/work_product.rs @@ -45,7 +45,7 @@ pub fn copy_cgu_workproduct_to_incr_comp_cache_dir( } /// Removes files for a given work product. -pub fn delete_workproduct_files(sess: &Session, work_product: &WorkProduct) { +pub(crate) fn delete_workproduct_files(sess: &Session, work_product: &WorkProduct) { for (_, path) in work_product.saved_files.items().into_sorted_stable_ord() { let path = in_incr_comp_dir_sess(sess, path); if let Err(err) = std_fs::remove_file(&path) { -- cgit 1.4.1-3-g733a5 From 8da1b3315343bb9b77c17e6f8533fbc59af67315 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 24 Oct 2023 16:37:30 +1100 Subject: Move a `use` to a more sensible spot. I.e. in the source file where it's used. --- compiler/rustc_incremental/src/lib.rs | 1 - compiler/rustc_incremental/src/persist/save.rs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_incremental/src/lib.rs') diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs index e1c5e6e8d36..dde138973b9 100644 --- a/compiler/rustc_incremental/src/lib.rs +++ b/compiler/rustc_incremental/src/lib.rs @@ -18,7 +18,6 @@ mod assert_dep_graph; mod errors; mod persist; -use assert_dep_graph::assert_dep_graph; pub use persist::copy_cgu_workproduct_to_incr_comp_cache_dir; pub use persist::finalize_session_directory; pub use persist::in_incr_comp_dir; diff --git a/compiler/rustc_incremental/src/persist/save.rs b/compiler/rustc_incremental/src/persist/save.rs index 210da751d95..fa21320be26 100644 --- a/compiler/rustc_incremental/src/persist/save.rs +++ b/compiler/rustc_incremental/src/persist/save.rs @@ -1,3 +1,4 @@ +use crate::assert_dep_graph::assert_dep_graph; use crate::errors; use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::sync::join; @@ -39,7 +40,7 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) { let dep_graph_path = dep_graph_path(sess); let staging_dep_graph_path = staging_dep_graph_path(sess); - sess.time("assert_dep_graph", || crate::assert_dep_graph(tcx)); + sess.time("assert_dep_graph", || assert_dep_graph(tcx)); sess.time("check_dirty_clean", || dirty_clean::check_dirty_clean_annotations(tcx)); if sess.opts.unstable_opts.incremental_info { -- cgit 1.4.1-3-g733a5