mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
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.
This commit is contained in:
parent
5b40342d2d
commit
97d6e36dbe
1 changed files with 3 additions and 4 deletions
|
@ -13,7 +13,6 @@ use hir_def::{
|
||||||
};
|
};
|
||||||
use hir_expand::name::Name;
|
use hir_expand::name::Name;
|
||||||
use rustc_hash::{FxHashMap, FxHashSet};
|
use rustc_hash::{FxHashMap, FxHashSet};
|
||||||
use stdx::always;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
autoderef,
|
autoderef,
|
||||||
|
@ -22,8 +21,8 @@ use crate::{
|
||||||
primitive::{self, FloatTy, IntTy, UintTy},
|
primitive::{self, FloatTy, IntTy, UintTy},
|
||||||
static_lifetime,
|
static_lifetime,
|
||||||
utils::all_super_traits,
|
utils::all_super_traits,
|
||||||
AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, ForeignDefId, HirDisplay, InEnvironment,
|
AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, ForeignDefId, InEnvironment, Interner,
|
||||||
Interner, Scalar, Substitution, TraitEnvironment, TraitRefExt, Ty, TyBuilder, TyExt, TyKind,
|
Scalar, Substitution, TraitEnvironment, TraitRefExt, Ty, TyBuilder, TyExt, TyKind,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// This is used as a key for indexing impls.
|
/// 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 self_ty = db.impl_self_ty(impl_id);
|
||||||
let fp = TyFingerprint::for_inherent_impl(self_ty.skip_binders());
|
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 {
|
if let Some(fp) = fp {
|
||||||
map.entry(fp).or_default().push(impl_id);
|
map.entry(fp).or_default().push(impl_id);
|
||||||
}
|
}
|
||||||
|
// `fp` should only be `None` in error cases (either erroneous code or incomplete name resolution)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue