summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_incremental
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /compiler/rustc_incremental
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_incremental')
-rw-r--r--compiler/rustc_incremental/messages.ftl (renamed from compiler/rustc_incremental/locales/en-US.ftl)2
-rw-r--r--compiler/rustc_incremental/src/lib.rs2
-rw-r--r--compiler/rustc_incremental/src/persist/dirty_clean.rs2
-rw-r--r--compiler/rustc_incremental/src/persist/fs.rs12
4 files changed, 10 insertions, 8 deletions
diff --git a/compiler/rustc_incremental/locales/en-US.ftl b/compiler/rustc_incremental/messages.ftl
index 4852ee0d9..b760620e3 100644
--- a/compiler/rustc_incremental/locales/en-US.ftl
+++ b/compiler/rustc_incremental/messages.ftl
@@ -24,7 +24,7 @@ incremental_field_associated_value_expected = associated value expected for `{$n
incremental_no_field = no field `{$name}`
incremental_assertion_auto =
- `except` specified DepNodes that can not be affected for \"{$name}\": \"{$e}\"
+ `except` specified DepNodes that can not be affected for "{$name}": "{$e}"
incremental_undefined_clean_dirty_assertions_item =
clean/dirty auto-assertions not yet defined for Node::Item.node={$kind}
diff --git a/compiler/rustc_incremental/src/lib.rs b/compiler/rustc_incremental/src/lib.rs
index 511e466c2..df958e4a6 100644
--- a/compiler/rustc_incremental/src/lib.rs
+++ b/compiler/rustc_incremental/src/lib.rs
@@ -35,4 +35,4 @@ pub use persist::{build_dep_graph, load_dep_graph, DepGraphFuture};
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
use rustc_macros::fluent_messages;
-fluent_messages! { "../locales/en-US.ftl" }
+fluent_messages! { "../messages.ftl" }
diff --git a/compiler/rustc_incremental/src/persist/dirty_clean.rs b/compiler/rustc_incremental/src/persist/dirty_clean.rs
index b839416c9..1d88dfd20 100644
--- a/compiler/rustc_incremental/src/persist/dirty_clean.rs
+++ b/compiler/rustc_incremental/src/persist/dirty_clean.rs
@@ -371,7 +371,7 @@ impl<'tcx> DirtyCleanVisitor<'tcx> {
fn check_item(&mut self, item_id: LocalDefId) {
let item_span = self.tcx.def_span(item_id.to_def_id());
let def_path_hash = self.tcx.def_path_hash(item_id.to_def_id());
- for attr in self.tcx.get_attrs(item_id.to_def_id(), sym::rustc_clean) {
+ for attr in self.tcx.get_attrs(item_id, sym::rustc_clean) {
let Some(assertion) = self.assertion_maybe(item_id, attr) else {
continue;
};
diff --git a/compiler/rustc_incremental/src/persist/fs.rs b/compiler/rustc_incremental/src/persist/fs.rs
index 73d7e3bec..d6f83838a 100644
--- a/compiler/rustc_incremental/src/persist/fs.rs
+++ b/compiler/rustc_incremental/src/persist/fs.rs
@@ -108,7 +108,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::svh::Svh;
use rustc_data_structures::{base_n, flock};
use rustc_errors::ErrorGuaranteed;
-use rustc_fs_util::{link_or_copy, LinkOrCopy};
+use rustc_fs_util::{link_or_copy, try_canonicalize, LinkOrCopy};
use rustc_session::{Session, StableCrateId};
use rustc_span::Symbol;
@@ -223,7 +223,7 @@ pub fn prepare_session_directory(
// because, on windows, long paths can cause problems;
// canonicalization inserts this weird prefix that makes windows
// tolerate long paths.
- let crate_dir = match crate_dir.canonicalize() {
+ let crate_dir = match try_canonicalize(&crate_dir) {
Ok(v) => v,
Err(err) => {
return Err(sess.emit_err(errors::CanonicalizePath { path: crate_dir, err }));
@@ -297,10 +297,12 @@ pub fn prepare_session_directory(
/// renaming it to `s-{timestamp}-{svh}` and releasing the file lock.
/// If there have been compilation errors, however, this function will just
/// delete the presumably invalid session directory.
-pub fn finalize_session_directory(sess: &Session, svh: Svh) {
+pub fn finalize_session_directory(sess: &Session, svh: Option<Svh>) {
if sess.opts.incremental.is_none() {
return;
}
+ // The svh is always produced when incr. comp. is enabled.
+ let svh = svh.unwrap();
let _timer = sess.timer("incr_comp_finalize_session_directory");
@@ -865,7 +867,7 @@ fn all_except_most_recent(
/// before passing it to std::fs::remove_dir_all(). This will convert the path
/// into the '\\?\' format, which supports much longer paths.
fn safe_remove_dir_all(p: &Path) -> io::Result<()> {
- let canonicalized = match std_fs::canonicalize(p) {
+ let canonicalized = match try_canonicalize(p) {
Ok(canonicalized) => canonicalized,
Err(err) if err.kind() == io::ErrorKind::NotFound => return Ok(()),
Err(err) => return Err(err),
@@ -875,7 +877,7 @@ fn safe_remove_dir_all(p: &Path) -> io::Result<()> {
}
fn safe_remove_file(p: &Path) -> io::Result<()> {
- let canonicalized = match std_fs::canonicalize(p) {
+ let canonicalized = match try_canonicalize(p) {
Ok(canonicalized) => canonicalized,
Err(err) if err.kind() == io::ErrorKind::NotFound => return Ok(()),
Err(err) => return Err(err),