Skip to content

Commit e7411a2

Browse files
committed
Add specific help for *how* to fix an incremental lock error.
1 parent 834ec68 commit e7411a2

File tree

1 file changed

+13
-0
lines changed
  • compiler/rustc_incremental/src/persist

1 file changed

+13
-0
lines changed

compiler/rustc_incremental/src/persist/fs.rs

+13
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,19 @@ fn lock_directory(
521521
or disable incremental compilation",
522522
session_dir.display()
523523
));
524+
if std::env::var_os("CARGO").is_some() {
525+
err.help(
526+
"incremental compilation can be disabled by setting the \
527+
environment variable CARGO_INCREMENTAL=0 (see \
528+
https://doc.rust-lang.org/cargo/reference/profiles.html#incremental)",
529+
);
530+
err.help(
531+
"the entire build directory can be changed to a different \
532+
filesystem by setting the environment variable CARGO_TARGET_DIR \
533+
to a different path (see \
534+
https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir)",
535+
);
536+
}
524537
}
525538
err.emit();
526539
Err(ErrorReported)

0 commit comments

Comments
 (0)