diff options
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/code_model.rs | 2 | ||||
-rw-r--r-- | crates/hir/src/has_source.rs | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 5020aa196..285905e96 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -989,6 +989,7 @@ impl MacroDef { | |||
989 | if self.is_proc_macro() { | 989 | if self.is_proc_macro() { |
990 | return None; | 990 | return None; |
991 | } | 991 | } |
992 | #[allow(deprecated)] | ||
992 | self.source_old(db).value.name().map(|it| it.as_name()) | 993 | self.source_old(db).value.name().map(|it| it.as_name()) |
993 | } | 994 | } |
994 | 995 | ||
@@ -1378,6 +1379,7 @@ impl Impl { | |||
1378 | } | 1379 | } |
1379 | 1380 | ||
1380 | pub fn is_builtin_derive(self, db: &dyn HirDatabase) -> Option<InFile<ast::Attr>> { | 1381 | pub fn is_builtin_derive(self, db: &dyn HirDatabase) -> Option<InFile<ast::Attr>> { |
1382 | #[allow(deprecated)] | ||
1381 | let src = self.source_old(db); | 1383 | let src = self.source_old(db); |
1382 | let item = src.file_id.is_builtin_derive(db.upcast())?; | 1384 | let item = src.file_id.is_builtin_derive(db.upcast())?; |
1383 | let hygenic = hir_expand::hygiene::Hygiene::new(db.upcast(), item.file_id); | 1385 | let hygenic = hir_expand::hygiene::Hygiene::new(db.upcast(), item.file_id); |
diff --git a/crates/hir/src/has_source.rs b/crates/hir/src/has_source.rs index 84fbeca75..8a7306def 100644 --- a/crates/hir/src/has_source.rs +++ b/crates/hir/src/has_source.rs | |||
@@ -16,6 +16,7 @@ use crate::{ | |||
16 | 16 | ||
17 | pub trait HasSource { | 17 | pub trait HasSource { |
18 | type Ast; | 18 | type Ast; |
19 | #[deprecated = "migrating to source() method that returns an Option"] | ||
19 | fn source_old(self, db: &dyn HirDatabase) -> InFile<Self::Ast>; | 20 | fn source_old(self, db: &dyn HirDatabase) -> InFile<Self::Ast>; |
20 | fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>; | 21 | fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>; |
21 | } | 22 | } |