Set LintExpectationId
in level and collect fulfilled ones (RFC-2383)
* Collect lint expectations and set expectation ID in level (RFC-2383) * Collect IDs of fulfilled lint expectations from diagnostics (RFC 2383)
This commit is contained in:
parent
f467a58b7b
commit
2ca9037b61
7 changed files with 102 additions and 19 deletions
|
@ -133,10 +133,10 @@ impl Level {
|
|||
}
|
||||
|
||||
/// Converts a symbol to a level.
|
||||
pub fn from_symbol(x: Symbol) -> Option<Level> {
|
||||
pub fn from_symbol(x: Symbol, possible_lint_expect_id: u32) -> Option<Level> {
|
||||
match x {
|
||||
sym::allow => Some(Level::Allow),
|
||||
sym::expect => Some(Level::Expect(LintExpectationId::from(0u32))),
|
||||
sym::expect => Some(Level::Expect(LintExpectationId::from(possible_lint_expect_id))),
|
||||
sym::warn => Some(Level::Warn),
|
||||
sym::deny => Some(Level::Deny),
|
||||
sym::forbid => Some(Level::Forbid),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue