aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-11 11:08:30 +0100
committerGitHub <[email protected]>2021-04-11 11:08:30 +0100
commit7be06139b632ee615fc18af04dd67947e2c794b2 (patch)
treefdbbf290cbd610e20e5fa565e2d423a0135c8d24 /crates
parent5b40342d2d5bc19445e6abccef6931bdd3a03c3b (diff)
parent97d6e36dbe56a08d9767760d0935e9d7bb78e621 (diff)
Merge #8469
8469: Remove assertion in impl collection r=flodiebold a=flodiebold 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. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates')
-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 6178b36c8..3693e3284 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -13,7 +13,6 @@ use hir_def::{
13}; 13};
14use hir_expand::name::Name; 14use hir_expand::name::Name;
15use rustc_hash::{FxHashMap, FxHashSet}; 15use rustc_hash::{FxHashMap, FxHashSet};
16use stdx::always;
17 16
18use crate::{ 17use crate::{
19 autoderef, 18 autoderef,
@@ -22,8 +21,8 @@ use crate::{
22 primitive::{self, FloatTy, IntTy, UintTy}, 21 primitive::{self, FloatTy, IntTy, UintTy},
23 static_lifetime, 22 static_lifetime,
24 utils::all_super_traits, 23 utils::all_super_traits,
25 AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, ForeignDefId, HirDisplay, InEnvironment, 24 AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, ForeignDefId, InEnvironment, Interner,
26 Interner, Scalar, Substitution, TraitEnvironment, TraitRefExt, Ty, TyBuilder, TyExt, TyKind, 25 Scalar, Substitution, TraitEnvironment, TraitRefExt, Ty, TyBuilder, TyExt, TyKind,
27}; 26};
28 27
29/// This is used as a key for indexing impls. 28/// This is used as a key for indexing impls.
@@ -259,10 +258,10 @@ impl InherentImpls {
259 258
260 let self_ty = db.impl_self_ty(impl_id); 259 let self_ty = db.impl_self_ty(impl_id);
261 let fp = TyFingerprint::for_inherent_impl(self_ty.skip_binders()); 260 let fp = TyFingerprint::for_inherent_impl(self_ty.skip_binders());
262 always!(fp.is_some(), "no fingerprint for {}", self_ty.skip_binders().display(db));
263 if let Some(fp) = fp { 261 if let Some(fp) = fp {
264 map.entry(fp).or_default().push(impl_id); 262 map.entry(fp).or_default().push(impl_id);
265 } 263 }
264 // `fp` should only be `None` in error cases (either erroneous code or incomplete name resolution)
266 } 265 }
267 } 266 }
268 267