diff options
author | Nick Spain <[email protected]> | 2021-01-01 02:50:50 +0000 |
---|---|---|
committer | Nick Spain <[email protected]> | 2021-01-02 10:53:51 +0000 |
commit | ea4708c444509449b86c50b7b1b23f9ff5af4e97 (patch) | |
tree | 2c5c5c17589f0457ba9e63b4370eb9c6951b1d87 /crates/hir/src | |
parent | 2de2b1eca3c3a3a74c0374f4de0b0c3ff25e66a9 (diff) |
Mark HasSource::source_old as deprecated but allow at all call sites
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 | } |