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
fix: ADT hover considering only type or const len not lifetimes #16967
Conversation
My bad, amended without changes accidentally. |
Thanks! @bors r+ |
The test does its job (crash without the fix), it's fine. |
☀️ Test successful - checks-actions |
@@ -1418,7 +1418,8 @@ impl Adt { | |||
} | |||
|
|||
pub fn layout(self, db: &dyn HirDatabase) -> Result<Layout, LayoutError> { | |||
if db.generic_params(self.into()).iter().count() != 0 { | |||
let generic_params = &db.generic_params(self.into()); | |||
if generic_params.iter().next().is_some() || generic_params.iter_lt().next().is_some() { |
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.
Having a GenericParam::is_empty
method would probably be useful here (or given there is more than just params in it, a GenericParam::has_params
)
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 I open a PR with the proposed change of this and the proposed change in another PR?
Feel like a opening a lot of small PRs 😅.
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.
Putting both into one is fine
I feel like test doesn't do much. Please suggest if I should improve it?
Fixes #16963