Skip to content

Commit 165b558

Browse files
committed
Fix typos in LintExpectationId docs
1 parent 47f3f66 commit 165b558

File tree

1 file changed

+5
-3
lines changed
  • compiler/rustc_lint_defs/src

1 file changed

+5
-3
lines changed

compiler/rustc_lint_defs/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub enum Applicability {
5454
/// Expected `Diagnostic`s get the lint level `Expect` which stores the `LintExpectationId`
5555
/// to match it with the actual expectation later on.
5656
///
57-
/// The `LintExpectationId` has to be has stable between compilations, as diagnostic
57+
/// The `LintExpectationId` has to be stable between compilations, as diagnostic
5858
/// instances might be loaded from cache. Lint messages can be emitted during an
5959
/// `EarlyLintPass` operating on the AST and during a `LateLintPass` traversing the
6060
/// HIR tree. The AST doesn't have enough information to create a stable id. The
@@ -71,7 +71,7 @@ pub enum Applicability {
7171
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash, Encodable, Decodable)]
7272
pub enum LintExpectationId {
7373
/// Used for lints emitted during the `EarlyLintPass`. This id is not
74-
/// has stable and should not be cached.
74+
/// hash stable and should not be cached.
7575
Unstable { attr_id: AttrId, lint_index: Option<u16> },
7676
/// The [`HirId`] that the lint expectation is attached to. This id is
7777
/// stable and can be cached. The additional index ensures that nodes with
@@ -113,7 +113,9 @@ impl<HCX: rustc_hir::HashStableContext> HashStable<HCX> for LintExpectationId {
113113
lint_index.hash_stable(hcx, hasher);
114114
}
115115
_ => {
116-
unreachable!("HashStable should only be called for a filled `LintExpectationId`")
116+
unreachable!(
117+
"HashStable should only be called for filled and stable `LintExpectationId`"
118+
)
117119
}
118120
}
119121
}

0 commit comments

Comments
 (0)