Handle #[expect(unfulfilled_lint_expectations)] with a lint message

This commit is contained in:
xFrednet 2022-03-06 14:18:28 +01:00
parent 165b5583e5
commit d39d60971b
No known key found for this signature in database
GPG key ID: FCDCBF29AF64D601
6 changed files with 119 additions and 14 deletions

View file

@ -204,11 +204,19 @@ pub struct LintExpectation {
pub reason: Option<Symbol>,
/// The [`Span`] of the attribute that this expectation originated from.
pub emission_span: Span,
/// Lint messages for the `unfulfilled_lint_expectations` lint will be
/// adjusted to include an additional note. Therefore, we have to track if
/// the expectation is for the lint.
pub is_unfulfilled_lint_expectations: bool,
}
impl LintExpectation {
pub fn new(reason: Option<Symbol>, attr_span: Span) -> Self {
Self { reason, emission_span: attr_span }
pub fn new(
reason: Option<Symbol>,
emission_span: Span,
is_unfulfilled_lint_expectations: bool,
) -> Self {
Self { reason, emission_span, is_unfulfilled_lint_expectations }
}
}