mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Don't add call parens when an fn type is expected
This commit is contained in:
parent
45832b990c
commit
76d6f54471
2 changed files with 63 additions and 0 deletions
|
@ -1136,6 +1136,13 @@ impl Type {
|
|||
matches!(&self.ty.value, Ty::Apply(ApplicationTy { ctor: TypeCtor::Closure { .. }, .. }))
|
||||
}
|
||||
|
||||
pub fn is_fn(&self) -> bool {
|
||||
matches!(&self.ty.value,
|
||||
Ty::Apply(ApplicationTy { ctor: TypeCtor::FnDef(..), .. }) |
|
||||
Ty::Apply(ApplicationTy { ctor: TypeCtor::FnPtr { .. }, .. })
|
||||
)
|
||||
}
|
||||
|
||||
pub fn contains_unknown(&self) -> bool {
|
||||
return go(&self.ty.value);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue