@@ -1300,17 +1300,17 @@ impl DiagCtxtInner {
1300
1300
fn emit_diagnostic ( & mut self , mut diagnostic : Diagnostic ) -> Option < ErrorGuaranteed > {
1301
1301
assert ! ( diagnostic. level. can_be_top_or_sub( ) . 0 ) ;
1302
1302
1303
- if let Some ( expectation_id ) = diagnostic. level . get_expectation_id ( ) {
1303
+ if let Expect ( expect_id ) | ForceWarning ( Some ( expect_id ) ) = diagnostic. level {
1304
1304
// The `LintExpectationId` can be stable or unstable depending on when it was created.
1305
1305
// Diagnostics created before the definition of `HirId`s are unstable and can not yet
1306
1306
// be stored. Instead, they are buffered until the `LintExpectationId` is replaced by
1307
1307
// a stable one by the `LintLevelsBuilder`.
1308
- if let LintExpectationId :: Unstable { .. } = expectation_id {
1308
+ if let LintExpectationId :: Unstable { .. } = expect_id {
1309
1309
self . unstable_expect_diagnostics . push ( diagnostic) ;
1310
1310
return None ;
1311
1311
}
1312
1312
self . suppressed_expected_diag = true ;
1313
- self . fulfilled_expectations . insert ( expectation_id . normalize ( ) ) ;
1313
+ self . fulfilled_expectations . insert ( expect_id . normalize ( ) ) ;
1314
1314
}
1315
1315
1316
1316
if diagnostic. has_future_breakage ( ) {
@@ -1689,13 +1689,6 @@ impl Level {
1689
1689
matches ! ( * self , FailureNote )
1690
1690
}
1691
1691
1692
- pub fn get_expectation_id ( & self ) -> Option < LintExpectationId > {
1693
- match self {
1694
- Expect ( id) | ForceWarning ( Some ( id) ) => Some ( * id) ,
1695
- _ => None ,
1696
- }
1697
- }
1698
-
1699
1692
// Can this level be used in a top-level diagnostic message and/or a
1700
1693
// subdiagnostic message?
1701
1694
fn can_be_top_or_sub ( & self ) -> ( bool , bool ) {
0 commit comments