File tree 3 files changed +9
-5
lines changed
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -947,8 +947,8 @@ impl Handler {
947
947
. get_expectation_id ( )
948
948
. expect ( "all diagnostics inside `unstable_expect_diagnostics` must have a `LintExpectationId`" ) ;
949
949
950
- // The unstable to stable map only maps the unstable it to a stable id
951
- // the lint index is manually transferred here.
950
+ // The unstable to stable map only maps the unstable `AttrId` to a stable `HirId` with an attribute index.
951
+ // The lint index inside the attribute is manually transferred here.
952
952
let lint_index = unstable_id. get_lint_index ( ) ;
953
953
unstable_id. set_lint_index ( None ) ;
954
954
let mut stable_id = * unstable_to_stable
@@ -966,6 +966,10 @@ impl Handler {
966
966
/// This methods steals all [`LintExpectationId`]s that are stored inside
967
967
/// [`HandlerInner`] and indicate that the linked expectation has been fulfilled.
968
968
pub fn steal_fulfilled_expectation_ids ( & self ) -> FxHashSet < LintExpectationId > {
969
+ assert ! (
970
+ self . inner. borrow( ) . unstable_expect_diagnostics. is_empty( ) ,
971
+ "`HandlerInner::unstable_expect_diagnostics` should be empty at this point" ,
972
+ ) ;
969
973
std:: mem:: take ( & mut self . inner . borrow_mut ( ) . fulfilled_expectations )
970
974
}
971
975
}
Original file line number Diff line number Diff line change @@ -142,12 +142,12 @@ impl<HCX: rustc_hir::HashStableContext> ToStableHashKey<HCX> for LintExpectation
142
142
pub enum Level {
143
143
/// The `allow` level will not issue any message.
144
144
Allow ,
145
- /// The `expect` level will suppress the lint message but intern produce a message
145
+ /// The `expect` level will suppress the lint message but in turn produce a message
146
146
/// if the lint wasn't issued in the expected scope. `Expect` should not be used as
147
147
/// an initial level for a lint.
148
148
///
149
149
/// Note that this still means that the lint is enabled in this position and should
150
- /// be emitted, this will intern fulfill the expectation and suppress the lint.
150
+ /// be emitted, this will in turn fulfill the expectation and suppress the lint.
151
151
///
152
152
/// See RFC 2383.
153
153
///
Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ pub fn struct_lint_level<'s, 'd>(
387
387
388
388
// Lint diagnostics that are covered by the expect level will not be emitted outside
389
389
// the compiler. It is therefore not necessary to add any information for the user.
390
- // This will therefore directly call the decorate function which will intern emit
390
+ // This will therefore directly call the decorate function which will in turn emit
391
391
// the `Diagnostic`.
392
392
if let Level :: Expect ( _) = level {
393
393
let name = lint. name_lower ( ) ;
You can’t perform that action at this time.
0 commit comments