aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs7
-rw-r--r--crates/ra_hir_def/src/data.rs6
-rw-r--r--crates/ra_hir_def/src/generics.rs2
-rw-r--r--crates/ra_hir_def/src/nameres/raw.rs2
-rw-r--r--crates/ra_hir_def/src/path/lower.rs2
-rw-r--r--crates/ra_hir_def/src/path/lower/lower_use.rs2
-rw-r--r--crates/ra_hir_def/src/type_ref.rs4
7 files changed, 14 insertions, 11 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 032037c8c..df560155c 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -587,7 +587,10 @@ impl ExprCollector<'_> {
587 let pattern = match &pat { 587 let pattern = match &pat {
588 ast::Pat::BindPat(bp) => { 588 ast::Pat::BindPat(bp) => {
589 let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing); 589 let name = bp.name().map(|nr| nr.as_name()).unwrap_or_else(Name::missing);
590 let annotation = BindingAnnotation::new(bp.is_mutable(), bp.is_ref()); 590 let annotation = BindingAnnotation::new(
591 bp.mut_kw_token().is_some(),
592 bp.ref_kw_token().is_some(),
593 );
591 let subpat = bp.pat().map(|subpat| self.collect_pat(subpat)); 594 let subpat = bp.pat().map(|subpat| self.collect_pat(subpat));
592 if annotation == BindingAnnotation::Unannotated && subpat.is_none() { 595 if annotation == BindingAnnotation::Unannotated && subpat.is_none() {
593 // This could also be a single-segment path pattern. To 596 // This could also be a single-segment path pattern. To
@@ -628,7 +631,7 @@ impl ExprCollector<'_> {
628 } 631 }
629 ast::Pat::RefPat(p) => { 632 ast::Pat::RefPat(p) => {
630 let pat = self.collect_pat_opt(p.pat()); 633 let pat = self.collect_pat_opt(p.pat());
631 let mutability = Mutability::from_mutable(p.is_mut()); 634 let mutability = Mutability::from_mutable(p.mut_kw_token().is_some());
632 Pat::Ref { pat, mutability } 635 Pat::Ref { pat, mutability }
633 } 636 }
634 ast::Pat::PathPat(p) => { 637 ast::Pat::PathPat(p) => {
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs
index e793ad874..419d62c28 100644
--- a/crates/ra_hir_def/src/data.rs
+++ b/crates/ra_hir_def/src/data.rs
@@ -74,7 +74,7 @@ impl FunctionData {
74 TypeRef::unit() 74 TypeRef::unit()
75 }; 75 };
76 76
77 let ret_type = if src.value.is_async() { 77 let ret_type = if src.value.async_kw_token().is_some() {
78 let future_impl = desugar_future_path(ret_type); 78 let future_impl = desugar_future_path(ret_type);
79 let ty_bound = TypeBound::Path(future_impl); 79 let ty_bound = TypeBound::Path(future_impl);
80 TypeRef::ImplTrait(vec![ty_bound]) 80 TypeRef::ImplTrait(vec![ty_bound])
@@ -135,7 +135,7 @@ impl TraitData {
135 pub(crate) fn trait_data_query(db: &dyn DefDatabase, tr: TraitId) -> Arc<TraitData> { 135 pub(crate) fn trait_data_query(db: &dyn DefDatabase, tr: TraitId) -> Arc<TraitData> {
136 let src = tr.lookup(db).source(db); 136 let src = tr.lookup(db).source(db);
137 let name = src.value.name().map_or_else(Name::missing, |n| n.as_name()); 137 let name = src.value.name().map_or_else(Name::missing, |n| n.as_name());
138 let auto = src.value.is_auto(); 138 let auto = src.value.auto_kw_token().is_some();
139 let ast_id_map = db.ast_id_map(src.file_id); 139 let ast_id_map = db.ast_id_map(src.file_id);
140 140
141 let container = AssocContainerId::TraitId(tr); 141 let container = AssocContainerId::TraitId(tr);
@@ -212,7 +212,7 @@ impl ImplData {
212 212
213 let target_trait = src.value.target_trait().map(TypeRef::from_ast); 213 let target_trait = src.value.target_trait().map(TypeRef::from_ast);
214 let target_type = TypeRef::from_ast_opt(src.value.target_type()); 214 let target_type = TypeRef::from_ast_opt(src.value.target_type());
215 let is_negative = src.value.is_negative(); 215 let is_negative = src.value.excl_token().is_some();
216 let module_id = impl_loc.container.module(db); 216 let module_id = impl_loc.container.module(db);
217 217
218 let mut items = Vec::new(); 218 let mut items = Vec::new();
diff --git a/crates/ra_hir_def/src/generics.rs b/crates/ra_hir_def/src/generics.rs
index b687ce2b2..d850244c4 100644
--- a/crates/ra_hir_def/src/generics.rs
+++ b/crates/ra_hir_def/src/generics.rs
@@ -194,7 +194,7 @@ impl GenericParams {
194 } 194 }
195 195
196 fn add_where_predicate_from_bound(&mut self, bound: ast::TypeBound, type_ref: TypeRef) { 196 fn add_where_predicate_from_bound(&mut self, bound: ast::TypeBound, type_ref: TypeRef) {
197 if bound.has_question_mark() { 197 if bound.question_token().is_some() {
198 // FIXME: remove this bound 198 // FIXME: remove this bound
199 return; 199 return;
200 } 200 }
diff --git a/crates/ra_hir_def/src/nameres/raw.rs b/crates/ra_hir_def/src/nameres/raw.rs
index a9dff3a5d..e72ba52cf 100644
--- a/crates/ra_hir_def/src/nameres/raw.rs
+++ b/crates/ra_hir_def/src/nameres/raw.rs
@@ -287,7 +287,7 @@ impl RawItemsCollector {
287 let visibility = RawVisibility::from_ast_with_hygiene(module.visibility(), &self.hygiene); 287 let visibility = RawVisibility::from_ast_with_hygiene(module.visibility(), &self.hygiene);
288 288
289 let ast_id = self.source_ast_id_map.ast_id(&module); 289 let ast_id = self.source_ast_id_map.ast_id(&module);
290 if module.has_semi() { 290 if module.semi_token().is_some() {
291 let item = 291 let item =
292 self.raw_items.modules.alloc(ModuleData::Declaration { name, visibility, ast_id }); 292 self.raw_items.modules.alloc(ModuleData::Declaration { name, visibility, ast_id });
293 self.push_item(current_module, attrs, RawItemKind::Module(item)); 293 self.push_item(current_module, attrs, RawItemKind::Module(item));
diff --git a/crates/ra_hir_def/src/path/lower.rs b/crates/ra_hir_def/src/path/lower.rs
index 3c13cb2c7..0f806d6fb 100644
--- a/crates/ra_hir_def/src/path/lower.rs
+++ b/crates/ra_hir_def/src/path/lower.rs
@@ -28,7 +28,7 @@ pub(super) fn lower_path(mut path: ast::Path, hygiene: &Hygiene) -> Option<Path>
28 loop { 28 loop {
29 let segment = path.segment()?; 29 let segment = path.segment()?;
30 30
31 if segment.coloncolon().is_some() { 31 if segment.coloncolon_token().is_some() {
32 kind = PathKind::Abs; 32 kind = PathKind::Abs;
33 } 33 }
34 34
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs
index 6ec944228..5b6854b0f 100644
--- a/crates/ra_hir_def/src/path/lower/lower_use.rs
+++ b/crates/ra_hir_def/src/path/lower/lower_use.rs
@@ -34,7 +34,7 @@ pub(crate) fn lower_use_tree(
34 let alias = tree.alias().map(|a| { 34 let alias = tree.alias().map(|a| {
35 a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) 35 a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias)
36 }); 36 });
37 let is_glob = tree.star().is_some(); 37 let is_glob = tree.star_token().is_some();
38 if let Some(ast_path) = tree.path() { 38 if let Some(ast_path) = tree.path() {
39 // Handle self in a path. 39 // Handle self in a path.
40 // E.g. `use something::{self, <...>}` 40 // E.g. `use something::{self, <...>}`
diff --git a/crates/ra_hir_def/src/type_ref.rs b/crates/ra_hir_def/src/type_ref.rs
index 01cc392db..7a8338937 100644
--- a/crates/ra_hir_def/src/type_ref.rs
+++ b/crates/ra_hir_def/src/type_ref.rs
@@ -77,7 +77,7 @@ impl TypeRef {
77 } 77 }
78 ast::TypeRef::PointerType(inner) => { 78 ast::TypeRef::PointerType(inner) => {
79 let inner_ty = TypeRef::from_ast_opt(inner.type_ref()); 79 let inner_ty = TypeRef::from_ast_opt(inner.type_ref());
80 let mutability = Mutability::from_mutable(inner.is_mut()); 80 let mutability = Mutability::from_mutable(inner.mut_kw_token().is_some());
81 TypeRef::RawPtr(Box::new(inner_ty), mutability) 81 TypeRef::RawPtr(Box::new(inner_ty), mutability)
82 } 82 }
83 ast::TypeRef::ArrayType(inner) => { 83 ast::TypeRef::ArrayType(inner) => {
@@ -88,7 +88,7 @@ impl TypeRef {
88 } 88 }
89 ast::TypeRef::ReferenceType(inner) => { 89 ast::TypeRef::ReferenceType(inner) => {
90 let inner_ty = TypeRef::from_ast_opt(inner.type_ref()); 90 let inner_ty = TypeRef::from_ast_opt(inner.type_ref());
91 let mutability = Mutability::from_mutable(inner.is_mut()); 91 let mutability = Mutability::from_mutable(inner.mut_kw_token().is_some());
92 TypeRef::Reference(Box::new(inner_ty), mutability) 92 TypeRef::Reference(Box::new(inner_ty), mutability)
93 } 93 }
94 ast::TypeRef::PlaceholderType(_inner) => TypeRef::Placeholder, 94 ast::TypeRef::PlaceholderType(_inner) => TypeRef::Placeholder,