-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ItemTree
's ItemVisibilities
has no identity, so deduplicate
#19980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b684ba8
to
5996add
Compare
crates/hir-def/src/item_tree.rs
Outdated
} | ||
} | ||
} | ||
|
||
#[derive(Default, Debug, Eq, PartialEq)] | ||
struct ItemVisibilities { | ||
arena: Arena<RawVisibility>, | ||
// `IndexSet`` is *big*, but we seldom have `in path` visibilities, so be lazy about it | ||
set: Option<Box<IndexSet<RawVisibility>>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use FxIndexSet
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to add it to clippy's disallowed-types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can't we use IndexSet
just during construction, then point them all to the same visibility in the Arena?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right (why did my clippy not lint that 🤔)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to add it to clippy's disallowed-types.
Right that only lits the std types
088c65e
to
319193f
Compare
319193f
to
13494f4
Compare
Likely not noticable, as barely anyone uses
pub(in path)
visibilities