diff options
Diffstat (limited to 'crates/ra_ide_api/src/display/navigation_target.rs')
-rw-r--r-- | crates/ra_ide_api/src/display/navigation_target.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs index ae729614f..e19c071b0 100644 --- a/crates/ra_ide_api/src/display/navigation_target.rs +++ b/crates/ra_ide_api/src/display/navigation_target.rs | |||
@@ -165,8 +165,11 @@ impl NavigationTarget { | |||
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
168 | pub(crate) fn from_def(db: &RootDatabase, module_def: hir::ModuleDef) -> NavigationTarget { | 168 | pub(crate) fn from_def( |
169 | match module_def { | 169 | db: &RootDatabase, |
170 | module_def: hir::ModuleDef, | ||
171 | ) -> Option<NavigationTarget> { | ||
172 | let nav = match module_def { | ||
170 | hir::ModuleDef::Module(module) => NavigationTarget::from_module(db, module), | 173 | hir::ModuleDef::Module(module) => NavigationTarget::from_module(db, module), |
171 | hir::ModuleDef::Function(func) => NavigationTarget::from_function(db, func), | 174 | hir::ModuleDef::Function(func) => NavigationTarget::from_function(db, func), |
172 | hir::ModuleDef::Struct(s) => { | 175 | hir::ModuleDef::Struct(s) => { |
@@ -201,7 +204,11 @@ impl NavigationTarget { | |||
201 | let (file_id, node) = e.source(db); | 204 | let (file_id, node) = e.source(db); |
202 | NavigationTarget::from_named(file_id.original_file(db), &*node) | 205 | NavigationTarget::from_named(file_id.original_file(db), &*node) |
203 | } | 206 | } |
204 | } | 207 | hir::ModuleDef::BuiltinType(..) => { |
208 | return None; | ||
209 | } | ||
210 | }; | ||
211 | Some(nav) | ||
205 | } | 212 | } |
206 | 213 | ||
207 | pub(crate) fn from_impl_block( | 214 | pub(crate) fn from_impl_block( |