@@ -1300,17 +1300,17 @@ impl DiagCtxtInner {
13001300 fn emit_diagnostic ( & mut self , mut diagnostic : Diagnostic ) -> Option < ErrorGuaranteed > {
13011301 assert ! ( diagnostic. level. can_be_top_or_sub( ) . 0 ) ;
13021302
1303- if let Some ( expectation_id ) = diagnostic. level . get_expectation_id ( ) {
1303+ if let Expect ( expect_id ) | ForceWarning ( Some ( expect_id ) ) = diagnostic. level {
13041304 // The `LintExpectationId` can be stable or unstable depending on when it was created.
13051305 // Diagnostics created before the definition of `HirId`s are unstable and can not yet
13061306 // be stored. Instead, they are buffered until the `LintExpectationId` is replaced by
13071307 // a stable one by the `LintLevelsBuilder`.
1308- if let LintExpectationId :: Unstable { .. } = expectation_id {
1308+ if let LintExpectationId :: Unstable { .. } = expect_id {
13091309 self . unstable_expect_diagnostics . push ( diagnostic) ;
13101310 return None ;
13111311 }
13121312 self . suppressed_expected_diag = true ;
1313- self . fulfilled_expectations . insert ( expectation_id . normalize ( ) ) ;
1313+ self . fulfilled_expectations . insert ( expect_id . normalize ( ) ) ;
13141314 }
13151315
13161316 if diagnostic. has_future_breakage ( ) {
@@ -1689,13 +1689,6 @@ impl Level {
16891689 matches ! ( * self , FailureNote )
16901690 }
16911691
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-
16991692 // Can this level be used in a top-level diagnostic message and/or a
17001693 // subdiagnostic message?
17011694 fn can_be_top_or_sub ( & self ) -> ( bool , bool ) {
0 commit comments