diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-09 12:28:45 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-01-11 07:56:17 +1100 |
| commit | 0e388f21928219472d34a121cc33fcc4cf3e2c77 (patch) | |
| tree | 9b45d67f1bcefe33f30c7f249e3c4ede378058d9 /src/tools/miri | |
| parent | 06cf8819690c586fe3bf0b710e6859202095ac15 (diff) | |
| download | rust-0e388f21928219472d34a121cc33fcc4cf3e2c77.tar.gz rust-0e388f21928219472d34a121cc33fcc4cf3e2c77.zip | |
Change how `force-warn` lint diagnostics are recorded.
`is_force_warn` is only possible for diagnostics with `Level::Warning`, but it is currently stored in `Diagnostic::code`, which every diagnostic has. This commit: - removes the boolean `DiagnosticId::Lint::is_force_warn` field; - adds a `ForceWarning` variant to `Level`. Benefits: - The common `Level::Warning` case now has no arguments, replacing lots of `Warning(None)` occurrences. - `rustc_session::lint::Level` and `rustc_errors::Level` are more similar, both having `ForceWarning` and `Warning`.
Diffstat (limited to 'src/tools/miri')
| -rw-r--r-- | src/tools/miri/src/diagnostics.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/miri/src/diagnostics.rs b/src/tools/miri/src/diagnostics.rs index 819d2018a15..bf3284df596 100644 --- a/src/tools/miri/src/diagnostics.rs +++ b/src/tools/miri/src/diagnostics.rs @@ -455,7 +455,7 @@ pub fn report_msg<'tcx>( let sess = machine.tcx.sess; let level = match diag_level { DiagLevel::Error => Level::Error, - DiagLevel::Warning => Level::Warning(None), + DiagLevel::Warning => Level::Warning, DiagLevel::Note => Level::Note, }; let mut err = DiagnosticBuilder::<()>::new(sess.dcx(), level, title); |
