1
Fork 0

Use bool in favor of Option<()> for diagnostics

This commit is contained in:
Michael Goulet 2024-08-21 00:57:58 -04:00
parent 4d5b3b1962
commit 25ff9b6bcb
48 changed files with 106 additions and 121 deletions

View file

@ -160,7 +160,7 @@ pub struct TypeLengthLimit {
pub span: Span,
pub shrunk: String,
#[note(middle_written_to_path)]
pub was_written: Option<()>,
pub was_written: bool,
pub path: PathBuf,
pub type_length: usize,
}

View file

@ -581,9 +581,9 @@ impl<'tcx> Instance<'tcx> {
let mut path = PathBuf::new();
let was_written = if let Some(path2) = written_to_path {
path = path2;
Some(())
true
} else {
None
false
};
tcx.dcx().emit_fatal(error::TypeLengthLimit {
// We don't use `def_span(def_id)` so that diagnostics point