Use bool in favor of Option<()> for diagnostics
This commit is contained in:
parent
4d5b3b1962
commit
25ff9b6bcb
48 changed files with 106 additions and 121 deletions
|
@ -189,10 +189,10 @@ pub struct CreateLock<'a> {
|
|||
pub lock_err: std::io::Error,
|
||||
pub session_dir: &'a Path,
|
||||
#[note(incremental_lock_unsupported)]
|
||||
pub is_unsupported_lock: Option<()>,
|
||||
pub is_unsupported_lock: bool,
|
||||
#[help(incremental_cargo_help_1)]
|
||||
#[help(incremental_cargo_help_2)]
|
||||
pub is_cargo: Option<()>,
|
||||
pub is_cargo: bool,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
|
|
|
@ -486,12 +486,12 @@ fn lock_directory(
|
|||
// the lock should be exclusive
|
||||
Ok(lock) => Ok((lock, lock_file_path)),
|
||||
Err(lock_err) => {
|
||||
let is_unsupported_lock = flock::Lock::error_unsupported(&lock_err).then_some(());
|
||||
let is_unsupported_lock = flock::Lock::error_unsupported(&lock_err);
|
||||
Err(sess.dcx().emit_err(errors::CreateLock {
|
||||
lock_err,
|
||||
session_dir,
|
||||
is_unsupported_lock,
|
||||
is_cargo: rustc_session::utils::was_invoked_from_cargo().then_some(()),
|
||||
is_cargo: rustc_session::utils::was_invoked_from_cargo(),
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue