From e2cc55207619f987fd5cc274628b8e49e15ec856 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 8 Dec 2019 12:51:25 +0100 Subject: Remove dead code --- crates/ra_hir/src/code_model.rs | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 3d956afa7..7ac1bf461 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -507,30 +507,6 @@ impl Function { db.function_data(self.id).params.clone() } - /// The containing impl block, if this is a method. - pub fn impl_block(self, db: &impl DefDatabase) -> Option { - match self.container(db) { - Some(Container::ImplBlock(it)) => Some(it), - _ => None, - } - } - - /// The containing trait, if this is a trait method definition. - pub fn parent_trait(self, db: &impl DefDatabase) -> Option { - match self.container(db) { - Some(Container::Trait(it)) => Some(it), - _ => None, - } - } - - pub fn container(self, db: &impl DefDatabase) -> Option { - match self.id.lookup(db).container { - ContainerId::TraitId(it) => Some(Container::Trait(it.into())), - ContainerId::ImplId(it) => Some(Container::ImplBlock(it.into())), - ContainerId::ModuleId(_) => None, - } - } - pub fn diagnostics(self, db: &impl HirDatabase, sink: &mut DiagnosticSink) { let infer = db.infer(self.id.into()); infer.add_diagnostics(db, self.id, sink); @@ -709,15 +685,6 @@ impl AssocItem { AssocItem::TypeAlias(t) => t.module(db), } } - - pub fn container(self, db: &impl DefDatabase) -> Container { - match self { - AssocItem::Function(f) => f.container(db), - AssocItem::Const(c) => c.container(db), - AssocItem::TypeAlias(t) => t.container(db), - } - .expect("AssocItem without container") - } } #[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)] -- cgit v1.2.3