@@ -1303,17 +1303,17 @@ impl DiagCtxtInner {
13031303 fn emit_diagnostic ( & mut self , mut diagnostic : Diagnostic ) -> Option < ErrorGuaranteed > {
13041304 assert ! ( diagnostic. level. can_be_top_or_sub( ) . 0 ) ;
13051305
1306- if let Some ( expectation_id ) = diagnostic. level . get_expectation_id ( ) {
1306+ if let Expect ( expect_id ) | ForceWarning ( Some ( expect_id ) ) = diagnostic. level {
13071307 // The `LintExpectationId` can be stable or unstable depending on when it was created.
13081308 // Diagnostics created before the definition of `HirId`s are unstable and can not yet
13091309 // be stored. Instead, they are buffered until the `LintExpectationId` is replaced by
13101310 // a stable one by the `LintLevelsBuilder`.
1311- if let LintExpectationId :: Unstable { .. } = expectation_id {
1311+ if let LintExpectationId :: Unstable { .. } = expect_id {
13121312 self . unstable_expect_diagnostics . push ( diagnostic) ;
13131313 return None ;
13141314 }
13151315 self . suppressed_expected_diag = true ;
1316- self . fulfilled_expectations . insert ( expectation_id . normalize ( ) ) ;
1316+ self . fulfilled_expectations . insert ( expect_id . normalize ( ) ) ;
13171317 }
13181318
13191319 if diagnostic. has_future_breakage ( ) {
@@ -1728,13 +1728,6 @@ impl Level {
17281728 matches ! ( * self , FailureNote )
17291729 }
17301730
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-
17381731 // Can this level be used in a top-level diagnostic message and/or a
17391732 // subdiagnostic message?
17401733 fn can_be_top_or_sub ( & self ) -> ( bool , bool ) {
0 commit comments