From c8ace3a295aa63ff7f210f11840e7fc9de65264c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 7 Jan 2021 13:05:51 +0300 Subject: Remove some stale deprecations --- crates/assists/src/handlers/fix_visibility.rs | 1 - crates/ide/src/diagnostics/fixes.rs | 3 --- crates/ide/src/hover.rs | 2 -- crates/ide_db/src/search.rs | 1 - crates/rust-analyzer/src/handlers.rs | 10 +++++----- 5 files changed, 5 insertions(+), 12 deletions(-) (limited to 'crates') diff --git a/crates/assists/src/handlers/fix_visibility.rs b/crates/assists/src/handlers/fix_visibility.rs index de1e8f0bf..c10b3b8f5 100644 --- a/crates/assists/src/handlers/fix_visibility.rs +++ b/crates/assists/src/handlers/fix_visibility.rs @@ -97,7 +97,6 @@ fn add_vis_to_referenced_record_field(acc: &mut Assists, ctx: &AssistContext) -> let parent_name = parent.name(ctx.db()); let target_module = parent.module(ctx.db()); - #[allow(deprecated)] let in_file_source = record_field_def.source(ctx.db())?; let (offset, current_visibility, target) = match in_file_source.value { hir::FieldSource::Named(it) => { diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs index ec0f840e9..71ec4df92 100644 --- a/crates/ide/src/diagnostics/fixes.rs +++ b/crates/ide/src/diagnostics/fixes.rs @@ -156,7 +156,6 @@ fn missing_record_expr_field_fix( let record_fields = match VariantDef::from(def_id) { VariantDef::Struct(s) => { module = s.module(sema.db); - #[allow(deprecated)] let source = s.source(sema.db)?; def_file_id = source.file_id; let fields = source.value.field_list()?; @@ -164,14 +163,12 @@ fn missing_record_expr_field_fix( } VariantDef::Union(u) => { module = u.module(sema.db); - #[allow(deprecated)] let source = u.source(sema.db)?; def_file_id = source.file_id; source.value.record_field_list()? } VariantDef::Variant(e) => { module = e.module(sema.db); - #[allow(deprecated)] let source = e.source(sema.db)?; def_file_id = source.file_id; let fields = source.value.field_list()?; diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 72c9c66fe..a12a2475e 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -320,7 +320,6 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option { from_def_source_labeled(db, it, Some(label), mod_path) } Definition::Field(def) => { - #[allow(deprecated)] let src = def.source(db)?.value; if let FieldSource::Named(it) = src { from_def_source_labeled(db, def, it.short_label(), mod_path) @@ -368,7 +367,6 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option { D: HasSource + HasAttrs + Copy, A: ShortLabel, { - #[allow(deprecated)] let short_label = def.source(db)?.value.short_label(); from_def_source_labeled(db, def, short_label, mod_path) } diff --git a/crates/ide_db/src/search.rs b/crates/ide_db/src/search.rs index 436c59d2c..37b06027c 100644 --- a/crates/ide_db/src/search.rs +++ b/crates/ide_db/src/search.rs @@ -137,7 +137,6 @@ impl Definition { } if let Definition::LifetimeParam(param) = self { - #[allow(deprecated)] let range = match param.parent(db) { hir::GenericDef::Function(it) => { it.source(db).and_then(|src| Some(src.value.syntax().text_range())) diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index a7bf0ec6a..29cc9051e 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -18,8 +18,8 @@ use lsp_types::{ CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, CodeActionKind, CodeLens, Command, CompletionItem, Diagnostic, DiagnosticTag, - DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams, - HoverContents, Location, NumberOrString, Position, PrepareRenameResponse, Range, RenameParams, + DocumentFormattingParams, DocumentHighlight, FoldingRange, FoldingRangeParams, HoverContents, + Location, NumberOrString, Position, PrepareRenameResponse, Range, RenameParams, SemanticTokensDeltaParams, SemanticTokensFullDeltaResult, SemanticTokensParams, SemanticTokensRangeParams, SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, SymbolTag, TextDocumentIdentifier, TextDocumentPositionParams, Url, WorkspaceEdit, @@ -280,7 +280,7 @@ pub(crate) fn handle_document_symbol( let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?; let line_index = snap.analysis.file_line_index(file_id)?; - let mut parents: Vec<(DocumentSymbol, Option)> = Vec::new(); + let mut parents: Vec<(lsp_types::DocumentSymbol, Option)> = Vec::new(); for symbol in snap.analysis.file_structure(file_id)? { let mut tags = Vec::new(); @@ -289,7 +289,7 @@ pub(crate) fn handle_document_symbol( }; #[allow(deprecated)] - let doc_symbol = DocumentSymbol { + let doc_symbol = lsp_types::DocumentSymbol { name: symbol.label, detail: symbol.detail, kind: to_proto::symbol_kind(symbol.kind), @@ -333,7 +333,7 @@ pub(crate) fn handle_document_symbol( return Ok(Some(res)); fn flatten_document_symbol( - symbol: &DocumentSymbol, + symbol: &lsp_types::DocumentSymbol, container_name: Option, url: &Url, res: &mut Vec, -- cgit v1.2.3