mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 21:25:25 +00:00
Merge pull request #19973 from Veykril/push-ppltxvqvqmkk
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Hide dyn inlay hints for incomplete `impl`s
This commit is contained in:
commit
f7b7db8b8c
1 changed files with 9 additions and 3 deletions
|
|
@ -22,9 +22,14 @@ pub(super) fn hints(
|
|||
let parent = paren.as_ref().and_then(|it| it.parent()).unwrap_or(parent);
|
||||
if ast::TypeBound::can_cast(parent.kind())
|
||||
|| ast::TypeAnchor::can_cast(parent.kind())
|
||||
|| ast::Impl::cast(parent)
|
||||
.and_then(|it| it.trait_())
|
||||
.is_some_and(|it| it.syntax() == path.syntax())
|
||||
|| ast::Impl::cast(parent).is_some_and(|it| {
|
||||
it.trait_().map_or(
|
||||
// only show it for impl type if the impl is not incomplete, otherwise we
|
||||
// are likely typing a trait impl
|
||||
it.assoc_item_list().is_none_or(|it| it.l_curly_token().is_none()),
|
||||
|trait_| trait_.syntax() == path.syntax(),
|
||||
)
|
||||
})
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
|
@ -85,6 +90,7 @@ impl T {}
|
|||
// ^ dyn
|
||||
impl T for (T) {}
|
||||
// ^^^ dyn
|
||||
impl T
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue