@@ -1303,17 +1303,17 @@ impl DiagCtxtInner {
1303
1303
fn emit_diagnostic ( & mut self , mut diagnostic : Diagnostic ) -> Option < ErrorGuaranteed > {
1304
1304
assert ! ( diagnostic. level. can_be_top_or_sub( ) . 0 ) ;
1305
1305
1306
- if let Some ( expectation_id ) = diagnostic. level . get_expectation_id ( ) {
1306
+ if let Expect ( expect_id ) | ForceWarning ( Some ( expect_id ) ) = diagnostic. level {
1307
1307
// The `LintExpectationId` can be stable or unstable depending on when it was created.
1308
1308
// Diagnostics created before the definition of `HirId`s are unstable and can not yet
1309
1309
// be stored. Instead, they are buffered until the `LintExpectationId` is replaced by
1310
1310
// a stable one by the `LintLevelsBuilder`.
1311
- if let LintExpectationId :: Unstable { .. } = expectation_id {
1311
+ if let LintExpectationId :: Unstable { .. } = expect_id {
1312
1312
self . unstable_expect_diagnostics . push ( diagnostic) ;
1313
1313
return None ;
1314
1314
}
1315
1315
self . suppressed_expected_diag = true ;
1316
- self . fulfilled_expectations . insert ( expectation_id . normalize ( ) ) ;
1316
+ self . fulfilled_expectations . insert ( expect_id . normalize ( ) ) ;
1317
1317
}
1318
1318
1319
1319
if diagnostic. has_future_breakage ( ) {
@@ -1728,13 +1728,6 @@ impl Level {
1728
1728
matches ! ( * self , FailureNote )
1729
1729
}
1730
1730
1731
- pub fn get_expectation_id ( & self ) -> Option < LintExpectationId > {
1732
- match self {
1733
- Expect ( id) | ForceWarning ( Some ( id) ) => Some ( * id) ,
1734
- _ => None ,
1735
- }
1736
- }
1737
-
1738
1731
// Can this level be used in a top-level diagnostic message and/or a
1739
1732
// subdiagnostic message?
1740
1733
fn can_be_top_or_sub ( & self ) -> ( bool , bool ) {
0 commit comments