mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Auto merge of #118789 - jyn514:dry-run, r=onur-ozkan
fix --dry-run when the change-id warning is printed previously: ``` Building bootstrap Compiling bootstrap v0.0.0 (/home/jyn/src/rust2/src/bootstrap) Finished dev [unoptimized] target(s) in 4.23s thread 'main' panicked at src/bin/main.rs:147:17: fs::write(warned_id_path, latest_change_id.to_string()) failed with No such file or directory (os error 2) ```
This commit is contained in:
commit
529047cfc3
@ -174,7 +174,7 @@ fn check_version(config: &Config) -> Option<String> {
|
||||
"update `config.toml` to use `change-id = {latest_change_id}` instead"
|
||||
));
|
||||
|
||||
if io::stdout().is_terminal() {
|
||||
if io::stdout().is_terminal() && !config.dry_run() {
|
||||
t!(fs::write(warned_id_path, latest_change_id.to_string()));
|
||||
}
|
||||
}
|
||||
|
@ -1969,7 +1969,7 @@ impl Config {
|
||||
config
|
||||
}
|
||||
|
||||
pub(crate) fn dry_run(&self) -> bool {
|
||||
pub fn dry_run(&self) -> bool {
|
||||
match self.dry_run {
|
||||
DryRun::Disabled => false,
|
||||
DryRun::SelfCheck | DryRun::UserSelected => true,
|
||||
|
Loading…
Reference in New Issue
Block a user