From 29acd398004555695bbf29eb054b12381e955cbf Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 1 Jan 2021 20:45:49 +0100 Subject: Don't emit arg count diagnostics for method calls with unknown receiver Fixes #7098. --- crates/hir_ty/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/hir_ty/src/lib.rs') diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 357bd92f9..e00c7e176 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs @@ -791,6 +791,10 @@ impl Ty { matches!(self, Ty::Apply(ApplicationTy { ctor: TypeCtor::Never, .. })) } + pub fn is_unknown(&self) -> bool { + matches!(self, Ty::Unknown) + } + /// If this is a `dyn Trait` type, this returns the `Trait` part. pub fn dyn_trait_ref(&self) -> Option<&TraitRef> { match self { -- cgit v1.2.3