diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-07 10:54:44 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-07 10:54:44 +0000 |
commit | 171c3c08fe245938fb25321394233de5fe2abc7c (patch) | |
tree | cb6ca14556d79df1caa088011d5389ac8b80db28 /crates | |
parent | 1347b7fa4cdc2064ac1cb4a686f10890b9235893 (diff) | |
parent | c8ace3a295aa63ff7f210f11840e7fc9de65264c (diff) |
Merge #7190
7190: Remove some stale deprecations r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/assists/src/handlers/fix_visibility.rs | 1 | ||||
-rw-r--r-- | crates/ide/src/diagnostics/fixes.rs | 3 | ||||
-rw-r--r-- | crates/ide/src/hover.rs | 2 | ||||
-rw-r--r-- | crates/ide_db/src/search.rs | 1 | ||||
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 10 |
5 files changed, 5 insertions, 12 deletions
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) -> | |||
97 | let parent_name = parent.name(ctx.db()); | 97 | let parent_name = parent.name(ctx.db()); |
98 | let target_module = parent.module(ctx.db()); | 98 | let target_module = parent.module(ctx.db()); |
99 | 99 | ||
100 | #[allow(deprecated)] | ||
101 | let in_file_source = record_field_def.source(ctx.db())?; | 100 | let in_file_source = record_field_def.source(ctx.db())?; |
102 | let (offset, current_visibility, target) = match in_file_source.value { | 101 | let (offset, current_visibility, target) = match in_file_source.value { |
103 | hir::FieldSource::Named(it) => { | 102 | 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( | |||
156 | let record_fields = match VariantDef::from(def_id) { | 156 | let record_fields = match VariantDef::from(def_id) { |
157 | VariantDef::Struct(s) => { | 157 | VariantDef::Struct(s) => { |
158 | module = s.module(sema.db); | 158 | module = s.module(sema.db); |
159 | #[allow(deprecated)] | ||
160 | let source = s.source(sema.db)?; | 159 | let source = s.source(sema.db)?; |
161 | def_file_id = source.file_id; | 160 | def_file_id = source.file_id; |
162 | let fields = source.value.field_list()?; | 161 | let fields = source.value.field_list()?; |
@@ -164,14 +163,12 @@ fn missing_record_expr_field_fix( | |||
164 | } | 163 | } |
165 | VariantDef::Union(u) => { | 164 | VariantDef::Union(u) => { |
166 | module = u.module(sema.db); | 165 | module = u.module(sema.db); |
167 | #[allow(deprecated)] | ||
168 | let source = u.source(sema.db)?; | 166 | let source = u.source(sema.db)?; |
169 | def_file_id = source.file_id; | 167 | def_file_id = source.file_id; |
170 | source.value.record_field_list()? | 168 | source.value.record_field_list()? |
171 | } | 169 | } |
172 | VariantDef::Variant(e) => { | 170 | VariantDef::Variant(e) => { |
173 | module = e.module(sema.db); | 171 | module = e.module(sema.db); |
174 | #[allow(deprecated)] | ||
175 | let source = e.source(sema.db)?; | 172 | let source = e.source(sema.db)?; |
176 | def_file_id = source.file_id; | 173 | def_file_id = source.file_id; |
177 | let fields = source.value.field_list()?; | 174 | 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<Markup> { | |||
320 | from_def_source_labeled(db, it, Some(label), mod_path) | 320 | from_def_source_labeled(db, it, Some(label), mod_path) |
321 | } | 321 | } |
322 | Definition::Field(def) => { | 322 | Definition::Field(def) => { |
323 | #[allow(deprecated)] | ||
324 | let src = def.source(db)?.value; | 323 | let src = def.source(db)?.value; |
325 | if let FieldSource::Named(it) = src { | 324 | if let FieldSource::Named(it) = src { |
326 | from_def_source_labeled(db, def, it.short_label(), mod_path) | 325 | from_def_source_labeled(db, def, it.short_label(), mod_path) |
@@ -368,7 +367,6 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> { | |||
368 | D: HasSource<Ast = A> + HasAttrs + Copy, | 367 | D: HasSource<Ast = A> + HasAttrs + Copy, |
369 | A: ShortLabel, | 368 | A: ShortLabel, |
370 | { | 369 | { |
371 | #[allow(deprecated)] | ||
372 | let short_label = def.source(db)?.value.short_label(); | 370 | let short_label = def.source(db)?.value.short_label(); |
373 | from_def_source_labeled(db, def, short_label, mod_path) | 371 | from_def_source_labeled(db, def, short_label, mod_path) |
374 | } | 372 | } |
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 { | |||
137 | } | 137 | } |
138 | 138 | ||
139 | if let Definition::LifetimeParam(param) = self { | 139 | if let Definition::LifetimeParam(param) = self { |
140 | #[allow(deprecated)] | ||
141 | let range = match param.parent(db) { | 140 | let range = match param.parent(db) { |
142 | hir::GenericDef::Function(it) => { | 141 | hir::GenericDef::Function(it) => { |
143 | it.source(db).and_then(|src| Some(src.value.syntax().text_range())) | 142 | 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::{ | |||
18 | CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, | 18 | CallHierarchyIncomingCall, CallHierarchyIncomingCallsParams, CallHierarchyItem, |
19 | CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, | 19 | CallHierarchyOutgoingCall, CallHierarchyOutgoingCallsParams, CallHierarchyPrepareParams, |
20 | CodeActionKind, CodeLens, Command, CompletionItem, Diagnostic, DiagnosticTag, | 20 | CodeActionKind, CodeLens, Command, CompletionItem, Diagnostic, DiagnosticTag, |
21 | DocumentFormattingParams, DocumentHighlight, DocumentSymbol, FoldingRange, FoldingRangeParams, | 21 | DocumentFormattingParams, DocumentHighlight, FoldingRange, FoldingRangeParams, HoverContents, |
22 | HoverContents, Location, NumberOrString, Position, PrepareRenameResponse, Range, RenameParams, | 22 | Location, NumberOrString, Position, PrepareRenameResponse, Range, RenameParams, |
23 | SemanticTokensDeltaParams, SemanticTokensFullDeltaResult, SemanticTokensParams, | 23 | SemanticTokensDeltaParams, SemanticTokensFullDeltaResult, SemanticTokensParams, |
24 | SemanticTokensRangeParams, SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, | 24 | SemanticTokensRangeParams, SemanticTokensRangeResult, SemanticTokensResult, SymbolInformation, |
25 | SymbolTag, TextDocumentIdentifier, TextDocumentPositionParams, Url, WorkspaceEdit, | 25 | SymbolTag, TextDocumentIdentifier, TextDocumentPositionParams, Url, WorkspaceEdit, |
@@ -280,7 +280,7 @@ pub(crate) fn handle_document_symbol( | |||
280 | let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?; | 280 | let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?; |
281 | let line_index = snap.analysis.file_line_index(file_id)?; | 281 | let line_index = snap.analysis.file_line_index(file_id)?; |
282 | 282 | ||
283 | let mut parents: Vec<(DocumentSymbol, Option<usize>)> = Vec::new(); | 283 | let mut parents: Vec<(lsp_types::DocumentSymbol, Option<usize>)> = Vec::new(); |
284 | 284 | ||
285 | for symbol in snap.analysis.file_structure(file_id)? { | 285 | for symbol in snap.analysis.file_structure(file_id)? { |
286 | let mut tags = Vec::new(); | 286 | let mut tags = Vec::new(); |
@@ -289,7 +289,7 @@ pub(crate) fn handle_document_symbol( | |||
289 | }; | 289 | }; |
290 | 290 | ||
291 | #[allow(deprecated)] | 291 | #[allow(deprecated)] |
292 | let doc_symbol = DocumentSymbol { | 292 | let doc_symbol = lsp_types::DocumentSymbol { |
293 | name: symbol.label, | 293 | name: symbol.label, |
294 | detail: symbol.detail, | 294 | detail: symbol.detail, |
295 | kind: to_proto::symbol_kind(symbol.kind), | 295 | kind: to_proto::symbol_kind(symbol.kind), |
@@ -333,7 +333,7 @@ pub(crate) fn handle_document_symbol( | |||
333 | return Ok(Some(res)); | 333 | return Ok(Some(res)); |
334 | 334 | ||
335 | fn flatten_document_symbol( | 335 | fn flatten_document_symbol( |
336 | symbol: &DocumentSymbol, | 336 | symbol: &lsp_types::DocumentSymbol, |
337 | container_name: Option<String>, | 337 | container_name: Option<String>, |
338 | url: &Url, | 338 | url: &Url, |
339 | res: &mut Vec<SymbolInformation>, | 339 | res: &mut Vec<SymbolInformation>, |