mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Show deprecated completions for deprecated traits
This commit is contained in:
parent
cc663a7b0c
commit
ca65488276
8 changed files with 69 additions and 28 deletions
|
@ -272,15 +272,6 @@ impl ModuleDef {
|
|||
|
||||
hir_ty::diagnostics::validate_module_item(db, module.id.krate, id, sink)
|
||||
}
|
||||
|
||||
pub fn as_assoc_item(self, db: &dyn HirDatabase) -> Option<AssocItem> {
|
||||
match self {
|
||||
ModuleDef::Function(f) => f.as_assoc_item(db),
|
||||
ModuleDef::Const(c) => c.as_assoc_item(db),
|
||||
ModuleDef::TypeAlias(t) => t.as_assoc_item(db),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Module {
|
||||
|
@ -1060,6 +1051,16 @@ impl AsAssocItem for TypeAlias {
|
|||
as_assoc_item(db, AssocItem::TypeAlias, self.id)
|
||||
}
|
||||
}
|
||||
impl AsAssocItem for ModuleDef {
|
||||
fn as_assoc_item(self, db: &dyn HirDatabase) -> Option<AssocItem> {
|
||||
match self {
|
||||
ModuleDef::Function(it) => it.as_assoc_item(db),
|
||||
ModuleDef::Const(it) => it.as_assoc_item(db),
|
||||
ModuleDef::TypeAlias(it) => it.as_assoc_item(db),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
fn as_assoc_item<ID, DEF, CTOR, AST>(db: &dyn HirDatabase, ctor: CTOR, id: ID) -> Option<AssocItem>
|
||||
where
|
||||
ID: Lookup<Data = AssocItemLoc<AST>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue