Reduced the size of LintExpectationId by 12 bytes (RFC-2383)

This commit is contained in:
xFrednet 2021-11-24 23:21:10 +01:00
parent 43dc430f52
commit a14456f91f
No known key found for this signature in database
GPG key ID: FCDCBF29AF64D601
2 changed files with 12 additions and 7 deletions

View file

@ -312,7 +312,7 @@ impl<'s> LintLevelsBuilder<'s> {
for (lint_index, li) in metas.iter_mut().enumerate() {
let level = match level {
Level::Expect(mut id) => {
id.set_lint_index(Some(lint_index));
id.set_lint_index(Some(lint_index as u16));
Level::Expect(id)
}
level => level,
@ -601,7 +601,8 @@ impl<'s> LintLevelsBuilder<'s> {
hir_id: HirId,
attr_index: usize,
) -> LintExpectationId {
let stable_id = LintExpectationId::Stable { hir_id, attr_index, lint_index: None };
let stable_id =
LintExpectationId::Stable { hir_id, attr_index: attr_index as u16, lint_index: None };
self.expectation_id_map.insert(unstable_id, stable_id);