@@ -1356,17 +1356,17 @@ impl DiagCtxtInner {
1356
1356
fn emit_diagnostic ( & mut self , mut diagnostic : DiagInner ) -> Option < ErrorGuaranteed > {
1357
1357
assert ! ( diagnostic. level. can_be_top_or_sub( ) . 0 ) ;
1358
1358
1359
- if let Some ( expectation_id ) = diagnostic. level . get_expectation_id ( ) {
1359
+ if let Expect ( expect_id ) | ForceWarning ( Some ( expect_id ) ) = diagnostic. level {
1360
1360
// The `LintExpectationId` can be stable or unstable depending on when it was created.
1361
1361
// Diagnostics created before the definition of `HirId`s are unstable and can not yet
1362
1362
// be stored. Instead, they are buffered until the `LintExpectationId` is replaced by
1363
1363
// a stable one by the `LintLevelsBuilder`.
1364
- if let LintExpectationId :: Unstable { .. } = expectation_id {
1364
+ if let LintExpectationId :: Unstable { .. } = expect_id {
1365
1365
self . unstable_expect_diagnostics . push ( diagnostic) ;
1366
1366
return None ;
1367
1367
}
1368
1368
self . suppressed_expected_diag = true ;
1369
- self . fulfilled_expectations . insert ( expectation_id . normalize ( ) ) ;
1369
+ self . fulfilled_expectations . insert ( expect_id . normalize ( ) ) ;
1370
1370
}
1371
1371
1372
1372
if diagnostic. has_future_breakage ( ) {
@@ -1794,13 +1794,6 @@ impl Level {
1794
1794
matches ! ( * self , FailureNote )
1795
1795
}
1796
1796
1797
- pub fn get_expectation_id ( & self ) -> Option < LintExpectationId > {
1798
- match self {
1799
- Expect ( id) | ForceWarning ( Some ( id) ) => Some ( * id) ,
1800
- _ => None ,
1801
- }
1802
- }
1803
-
1804
1797
// Can this level be used in a top-level diagnostic message and/or a
1805
1798
// subdiagnostic message?
1806
1799
fn can_be_top_or_sub ( & self ) -> ( bool , bool ) {
0 commit comments