Emit unfullfilled_lint_expectation using a HirId for performance (RFC-2383)

This commit is contained in:
xFrednet 2021-11-25 17:45:11 +01:00
parent a14456f91f
commit 3414ad9551
No known key found for this signature in database
GPG key ID: FCDCBF29AF64D601
3 changed files with 29 additions and 69 deletions

View file

@ -204,20 +204,11 @@ pub struct LintExpectation {
pub reason: Option<Symbol>,
/// The [`Span`] of the attribute that this expectation originated from.
pub emission_span: Span,
/// The [`Level`] that this lint diagnostic should be emitted if unfulfilled.
pub emission_level: Level,
/// The [`LintLevelSource`] information needed for [`struct_lint_level`].
pub emission_level_source: LintLevelSource,
}
impl LintExpectation {
pub fn new(
reason: Option<Symbol>,
attr_span: Span,
emission_level: Level,
emission_level_source: LintLevelSource,
) -> Self {
Self { reason, emission_span: attr_span, emission_level, emission_level_source }
pub fn new(reason: Option<Symbol>, attr_span: Span) -> Self {
Self { reason, emission_span: attr_span }
}
}