From ea4708c444509449b86c50b7b1b23f9ff5af4e97 Mon Sep 17 00:00:00 2001 From: Nick Spain Date: Fri, 1 Jan 2021 13:50:50 +1100 Subject: Mark HasSource::source_old as deprecated but allow at all call sites --- crates/hir/src/code_model.rs | 2 ++ crates/hir/src/has_source.rs | 1 + 2 files changed, 3 insertions(+) (limited to 'crates/hir/src') 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 { if self.is_proc_macro() { return None; } + #[allow(deprecated)] self.source_old(db).value.name().map(|it| it.as_name()) } @@ -1378,6 +1379,7 @@ impl Impl { } pub fn is_builtin_derive(self, db: &dyn HirDatabase) -> Option> { + #[allow(deprecated)] let src = self.source_old(db); let item = src.file_id.is_builtin_derive(db.upcast())?; 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::{ pub trait HasSource { type Ast; + #[deprecated = "migrating to source() method that returns an Option"] fn source_old(self, db: &dyn HirDatabase) -> InFile; fn source(self, db: &dyn HirDatabase) -> Option>; } -- cgit v1.2.3