diff options
Diffstat (limited to 'crates/assists/src')
-rw-r--r-- | crates/assists/src/handlers/fill_match_arms.rs | 3 | ||||
-rw-r--r-- | crates/assists/src/handlers/fix_visibility.rs | 5 |
2 files changed, 3 insertions, 5 deletions
diff --git a/crates/assists/src/handlers/fill_match_arms.rs b/crates/assists/src/handlers/fill_match_arms.rs index d17c82e18..f9a62b9fa 100644 --- a/crates/assists/src/handlers/fill_match_arms.rs +++ b/crates/assists/src/handlers/fill_match_arms.rs | |||
@@ -196,8 +196,7 @@ fn build_pat(db: &RootDatabase, module: hir::Module, var: hir::Variant) -> Optio | |||
196 | let path = mod_path_to_ast(&module.find_use_path(db, ModuleDef::from(var))?); | 196 | let path = mod_path_to_ast(&module.find_use_path(db, ModuleDef::from(var))?); |
197 | 197 | ||
198 | // FIXME: use HIR for this; it doesn't currently expose struct vs. tuple vs. unit variants though | 198 | // FIXME: use HIR for this; it doesn't currently expose struct vs. tuple vs. unit variants though |
199 | #[allow(deprecated)] | 199 | let pat: ast::Pat = match var.source(db)?.value.kind() { |
200 | let pat: ast::Pat = match var.source_old(db).value.kind() { | ||
201 | ast::StructKind::Tuple(field_list) => { | 200 | ast::StructKind::Tuple(field_list) => { |
202 | let pats = iter::repeat(make::wildcard_pat().into()).take(field_list.fields().count()); | 201 | let pats = iter::repeat(make::wildcard_pat().into()).take(field_list.fields().count()); |
203 | make::tuple_struct_pat(path, pats).into() | 202 | make::tuple_struct_pat(path, pats).into() |
diff --git a/crates/assists/src/handlers/fix_visibility.rs b/crates/assists/src/handlers/fix_visibility.rs index 7d440d420..aa6aed9c2 100644 --- a/crates/assists/src/handlers/fix_visibility.rs +++ b/crates/assists/src/handlers/fix_visibility.rs | |||
@@ -98,7 +98,7 @@ fn add_vis_to_referenced_record_field(acc: &mut Assists, ctx: &AssistContext) -> | |||
98 | let target_module = parent.module(ctx.db()); | 98 | let target_module = parent.module(ctx.db()); |
99 | 99 | ||
100 | #[allow(deprecated)] | 100 | #[allow(deprecated)] |
101 | let in_file_source = record_field_def.source_old(ctx.db()); | 101 | let in_file_source = record_field_def.source(ctx.db())?; |
102 | let (offset, current_visibility, target) = match in_file_source.value { | 102 | let (offset, current_visibility, target) = match in_file_source.value { |
103 | hir::FieldSource::Named(it) => { | 103 | hir::FieldSource::Named(it) => { |
104 | let s = it.syntax(); | 104 | let s = it.syntax(); |
@@ -151,8 +151,7 @@ fn target_data_for_def( | |||
151 | S: HasSource<Ast = Ast>, | 151 | S: HasSource<Ast = Ast>, |
152 | Ast: AstNode + ast::VisibilityOwner, | 152 | Ast: AstNode + ast::VisibilityOwner, |
153 | { | 153 | { |
154 | #[allow(deprecated)] | 154 | let source = x.source(db)?; |
155 | let source = x.source_old(db); | ||
156 | let in_file_syntax = source.syntax(); | 155 | let in_file_syntax = source.syntax(); |
157 | let file_id = in_file_syntax.file_id; | 156 | let file_id = in_file_syntax.file_id; |
158 | let syntax = in_file_syntax.value; | 157 | let syntax = in_file_syntax.value; |