about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Diebold <flodiebold@gmail.com>2021-04-11 11:42:54 +0200
committerFlorian Diebold <flodiebold@gmail.com>2021-04-11 12:07:58 +0200
commit97d6e36dbe56a08d9767760d0935e9d7bb78e621 (patch)
treefdbbf290cbd610e20e5fa565e2d423a0135c8d24
parent5b40342d2d5bc19445e6abccef6931bdd3a03c3b (diff)
downloadrust-97d6e36dbe56a08d9767760d0935e9d7bb78e621.tar.gz
rust-97d6e36dbe56a08d9767760d0935e9d7bb78e621.zip
Remove assertion in impl collection
This condition should always be true for *valid* code, but of course
there might be invalid code or things that we can't currently resolve.

Fixes #8464.
-rw-r--r--crates/hir_ty/src/method_resolution.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
index 6178b36c8ab..3693e328451 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -13,7 +13,6 @@ use hir_def::{
 };
 use hir_expand::name::Name;
 use rustc_hash::{FxHashMap, FxHashSet};
-use stdx::always;
 
 use crate::{
     autoderef,
@@ -22,8 +21,8 @@ use crate::{
     primitive::{self, FloatTy, IntTy, UintTy},
     static_lifetime,
     utils::all_super_traits,
-    AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, ForeignDefId, HirDisplay, InEnvironment,
-    Interner, Scalar, Substitution, TraitEnvironment, TraitRefExt, Ty, TyBuilder, TyExt, TyKind,
+    AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, ForeignDefId, InEnvironment, Interner,
+    Scalar, Substitution, TraitEnvironment, TraitRefExt, Ty, TyBuilder, TyExt, TyKind,
 };
 
 /// This is used as a key for indexing impls.
@@ -259,10 +258,10 @@ impl InherentImpls {
 
                 let self_ty = db.impl_self_ty(impl_id);
                 let fp = TyFingerprint::for_inherent_impl(self_ty.skip_binders());
-                always!(fp.is_some(), "no fingerprint for {}", self_ty.skip_binders().display(db));
                 if let Some(fp) = fp {
                     map.entry(fp).or_default().push(impl_id);
                 }
+                // `fp` should only be `None` in error cases (either erroneous code or incomplete name resolution)
             }
         }