11093: fix: Do not complete `Drop::drop`, complete `std::mem::drop` instead r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5005
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-12-22 01:48:31 +00:00 committed by GitHub
commit 578269e613
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 127 additions and 42 deletions

View file

@ -5,6 +5,7 @@ use hir::{Local, Name, ScopeDef, Semantics, SemanticsScope, Type, TypeInfo};
use ide_db::{
active_parameter::ActiveParameter,
base_db::{FilePosition, SourceDatabase},
helpers::FamousDefs,
RootDatabase,
};
use syntax::{
@ -150,6 +151,10 @@ impl<'a> CompletionContext<'a> {
self.previous_token.as_ref().map_or(false, |tok| tok.kind() == kind)
}
pub(crate) fn famous_defs(&self) -> FamousDefs {
FamousDefs(&self.sema, self.krate)
}
pub(crate) fn dot_receiver(&self) -> Option<&ast::Expr> {
match &self.completion_location {
Some(