mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Mark HasSource::source_old as deprecated but allow at all call sites
This commit is contained in:
parent
2de2b1eca3
commit
ea4708c444
15 changed files with 35 additions and 4 deletions
|
@ -27,6 +27,7 @@ struct ConstRender<'a> {
|
|||
|
||||
impl<'a> ConstRender<'a> {
|
||||
fn new(ctx: RenderContext<'a>, const_: hir::Const) -> ConstRender<'a> {
|
||||
#[allow(deprecated)]
|
||||
let ast_node = const_.source_old(ctx.db()).value;
|
||||
ConstRender { ctx, const_, ast_node }
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ impl<'a> FunctionRender<'a> {
|
|||
fn_: hir::Function,
|
||||
) -> FunctionRender<'a> {
|
||||
let name = local_name.unwrap_or_else(|| fn_.name(ctx.db()).to_string());
|
||||
#[allow(deprecated)]
|
||||
let ast_node = fn_.source_old(ctx.db()).value;
|
||||
|
||||
FunctionRender { ctx, name, func: fn_, ast_node }
|
||||
|
|
|
@ -96,6 +96,7 @@ impl<'a> MacroRender<'a> {
|
|||
}
|
||||
|
||||
fn detail(&self) -> String {
|
||||
#[allow(deprecated)]
|
||||
let ast_node = self.macro_.source_old(self.ctx.db()).value;
|
||||
macro_label(&ast_node)
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ struct TypeAliasRender<'a> {
|
|||
|
||||
impl<'a> TypeAliasRender<'a> {
|
||||
fn new(ctx: RenderContext<'a>, type_alias: hir::TypeAlias) -> TypeAliasRender<'a> {
|
||||
#[allow(deprecated)]
|
||||
let ast_node = type_alias.source_old(ctx.db()).value;
|
||||
TypeAliasRender { ctx, type_alias, ast_node }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue