Support lint expectations for --force-warn
lints (RFC 2383)
This commit is contained in:
parent
ec55c61305
commit
8527a3d369
19 changed files with 317 additions and 71 deletions
|
@ -208,7 +208,7 @@ impl Diagnostic {
|
|||
| Level::Error { .. }
|
||||
| Level::FailureNote => true,
|
||||
|
||||
Level::Warning
|
||||
Level::Warning(_)
|
||||
| Level::Note
|
||||
| Level::OnceNote
|
||||
| Level::Help
|
||||
|
@ -221,7 +221,9 @@ impl Diagnostic {
|
|||
&mut self,
|
||||
unstable_to_stable: &FxHashMap<LintExpectationId, LintExpectationId>,
|
||||
) {
|
||||
if let Level::Expect(expectation_id) = &mut self.level {
|
||||
if let Level::Expect(expectation_id) | Level::Warning(Some(expectation_id)) =
|
||||
&mut self.level
|
||||
{
|
||||
if expectation_id.is_stable() {
|
||||
return;
|
||||
}
|
||||
|
@ -445,7 +447,7 @@ impl Diagnostic {
|
|||
|
||||
/// Add a warning attached to this diagnostic.
|
||||
pub fn warn(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
|
||||
self.sub(Level::Warning, msg, MultiSpan::new(), None);
|
||||
self.sub(Level::Warning(None), msg, MultiSpan::new(), None);
|
||||
self
|
||||
}
|
||||
|
||||
|
@ -456,7 +458,7 @@ impl Diagnostic {
|
|||
sp: S,
|
||||
msg: impl Into<SubdiagnosticMessage>,
|
||||
) -> &mut Self {
|
||||
self.sub(Level::Warning, msg, sp.into(), None);
|
||||
self.sub(Level::Warning(None), msg, sp.into(), None);
|
||||
self
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue