diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir_def/src/find_path.rs | 59 | ||||
-rw-r--r-- | crates/ra_hir_def/src/import_map.rs | 39 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 274 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/generated/tokens.rs | 8 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/tokens.rs | 10 |
5 files changed, 223 insertions, 167 deletions
diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs index a7f59e028..06701a830 100644 --- a/crates/ra_hir_def/src/find_path.rs +++ b/crates/ra_hir_def/src/find_path.rs | |||
@@ -159,10 +159,16 @@ fn find_path_inner( | |||
159 | let crate_graph = db.crate_graph(); | 159 | let crate_graph = db.crate_graph(); |
160 | let extern_paths = crate_graph[from.krate].dependencies.iter().filter_map(|dep| { | 160 | let extern_paths = crate_graph[from.krate].dependencies.iter().filter_map(|dep| { |
161 | let import_map = db.import_map(dep.crate_id); | 161 | let import_map = db.import_map(dep.crate_id); |
162 | import_map.path_of(item).map(|modpath| { | 162 | import_map.import_info_for(item).and_then(|info| { |
163 | let mut modpath = modpath.clone(); | 163 | // Determine best path for containing module and append last segment from `info`. |
164 | modpath.segments.insert(0, dep.as_name()); | 164 | let mut path = find_path_inner( |
165 | modpath | 165 | db, |
166 | ItemInNs::Types(ModuleDefId::ModuleId(info.container)), | ||
167 | from, | ||
168 | best_path_len - 1, | ||
169 | )?; | ||
170 | path.segments.push(info.path.segments.last().unwrap().clone()); | ||
171 | Some(path) | ||
166 | }) | 172 | }) |
167 | }); | 173 | }); |
168 | 174 | ||
@@ -299,8 +305,8 @@ mod tests { | |||
299 | /// `code` needs to contain a cursor marker; checks that `find_path` for the | 305 | /// `code` needs to contain a cursor marker; checks that `find_path` for the |
300 | /// item the `path` refers to returns that same path when called from the | 306 | /// item the `path` refers to returns that same path when called from the |
301 | /// module the cursor is in. | 307 | /// module the cursor is in. |
302 | fn check_found_path(code: &str, path: &str) { | 308 | fn check_found_path(ra_fixture: &str, path: &str) { |
303 | let (db, pos) = TestDB::with_position(code); | 309 | let (db, pos) = TestDB::with_position(ra_fixture); |
304 | let module = db.module_for_file(pos.file_id); | 310 | let module = db.module_for_file(pos.file_id); |
305 | let parsed_path_file = ra_syntax::SourceFile::parse(&format!("use {};", path)); | 311 | let parsed_path_file = ra_syntax::SourceFile::parse(&format!("use {};", path)); |
306 | let ast_path = parsed_path_file | 312 | let ast_path = parsed_path_file |
@@ -420,7 +426,6 @@ mod tests { | |||
420 | 426 | ||
421 | #[test] | 427 | #[test] |
422 | fn different_crate_renamed() { | 428 | fn different_crate_renamed() { |
423 | // Even if a local path exists, if the item is defined externally, prefer an external path. | ||
424 | let code = r#" | 429 | let code = r#" |
425 | //- /main.rs crate:main deps:std | 430 | //- /main.rs crate:main deps:std |
426 | extern crate std as std_renamed; | 431 | extern crate std as std_renamed; |
@@ -428,7 +433,45 @@ mod tests { | |||
428 | //- /std.rs crate:std | 433 | //- /std.rs crate:std |
429 | pub struct S; | 434 | pub struct S; |
430 | "#; | 435 | "#; |
431 | check_found_path(code, "std::S"); | 436 | check_found_path(code, "std_renamed::S"); |
437 | } | ||
438 | |||
439 | #[test] | ||
440 | fn partially_imported() { | ||
441 | // Tests that short paths are used even for external items, when parts of the path are | ||
442 | // already in scope. | ||
443 | check_found_path( | ||
444 | r#" | ||
445 | //- /main.rs crate:main deps:ra_syntax | ||
446 | |||
447 | use ra_syntax::ast; | ||
448 | <|> | ||
449 | |||
450 | //- /lib.rs crate:ra_syntax | ||
451 | pub mod ast { | ||
452 | pub enum ModuleItem { | ||
453 | A, B, C, | ||
454 | } | ||
455 | } | ||
456 | "#, | ||
457 | "ast::ModuleItem", | ||
458 | ); | ||
459 | |||
460 | check_found_path( | ||
461 | r#" | ||
462 | //- /main.rs crate:main deps:ra_syntax | ||
463 | |||
464 | <|> | ||
465 | |||
466 | //- /lib.rs crate:ra_syntax | ||
467 | pub mod ast { | ||
468 | pub enum ModuleItem { | ||
469 | A, B, C, | ||
470 | } | ||
471 | } | ||
472 | "#, | ||
473 | "ra_syntax::ast::ModuleItem", | ||
474 | ); | ||
432 | } | 475 | } |
433 | 476 | ||
434 | #[test] | 477 | #[test] |
diff --git a/crates/ra_hir_def/src/import_map.rs b/crates/ra_hir_def/src/import_map.rs index 36b4fdd81..68e20d06b 100644 --- a/crates/ra_hir_def/src/import_map.rs +++ b/crates/ra_hir_def/src/import_map.rs | |||
@@ -17,6 +17,15 @@ use crate::{ | |||
17 | 17 | ||
18 | type FxIndexMap<K, V> = IndexMap<K, V, BuildHasherDefault<FxHasher>>; | 18 | type FxIndexMap<K, V> = IndexMap<K, V, BuildHasherDefault<FxHasher>>; |
19 | 19 | ||
20 | /// Item import details stored in the `ImportMap`. | ||
21 | #[derive(Debug, Clone, Eq, PartialEq)] | ||
22 | pub struct ImportInfo { | ||
23 | /// A path that can be used to import the item, relative to the crate's root. | ||
24 | pub path: ModPath, | ||
25 | /// The module containing this item. | ||
26 | pub container: ModuleId, | ||
27 | } | ||
28 | |||
20 | /// A map from publicly exported items to the path needed to import/name them from a downstream | 29 | /// A map from publicly exported items to the path needed to import/name them from a downstream |
21 | /// crate. | 30 | /// crate. |
22 | /// | 31 | /// |
@@ -26,7 +35,7 @@ type FxIndexMap<K, V> = IndexMap<K, V, BuildHasherDefault<FxHasher>>; | |||
26 | /// Note that all paths are relative to the containing crate's root, so the crate name still needs | 35 | /// Note that all paths are relative to the containing crate's root, so the crate name still needs |
27 | /// to be prepended to the `ModPath` before the path is valid. | 36 | /// to be prepended to the `ModPath` before the path is valid. |
28 | pub struct ImportMap { | 37 | pub struct ImportMap { |
29 | map: FxIndexMap<ItemInNs, ModPath>, | 38 | map: FxIndexMap<ItemInNs, ImportInfo>, |
30 | 39 | ||
31 | /// List of keys stored in `map`, sorted lexicographically by their `ModPath`. Indexed by the | 40 | /// List of keys stored in `map`, sorted lexicographically by their `ModPath`. Indexed by the |
32 | /// values returned by running `fst`. | 41 | /// values returned by running `fst`. |
@@ -78,12 +87,12 @@ impl ImportMap { | |||
78 | let path = mk_path(); | 87 | let path = mk_path(); |
79 | match import_map.entry(item) { | 88 | match import_map.entry(item) { |
80 | Entry::Vacant(entry) => { | 89 | Entry::Vacant(entry) => { |
81 | entry.insert(path); | 90 | entry.insert(ImportInfo { path, container: module }); |
82 | } | 91 | } |
83 | Entry::Occupied(mut entry) => { | 92 | Entry::Occupied(mut entry) => { |
84 | // If the new path is shorter, prefer that one. | 93 | // If the new path is shorter, prefer that one. |
85 | if path.len() < entry.get().len() { | 94 | if path.len() < entry.get().path.len() { |
86 | *entry.get_mut() = path; | 95 | *entry.get_mut() = ImportInfo { path, container: module }; |
87 | } else { | 96 | } else { |
88 | continue; | 97 | continue; |
89 | } | 98 | } |
@@ -119,7 +128,7 @@ impl ImportMap { | |||
119 | let start = last_batch_start; | 128 | let start = last_batch_start; |
120 | last_batch_start = idx + 1; | 129 | last_batch_start = idx + 1; |
121 | 130 | ||
122 | let key = fst_path(&importables[start].1); | 131 | let key = fst_path(&importables[start].1.path); |
123 | 132 | ||
124 | builder.insert(key, start as u64).unwrap(); | 133 | builder.insert(key, start as u64).unwrap(); |
125 | } | 134 | } |
@@ -132,6 +141,10 @@ impl ImportMap { | |||
132 | 141 | ||
133 | /// Returns the `ModPath` needed to import/mention `item`, relative to this crate's root. | 142 | /// Returns the `ModPath` needed to import/mention `item`, relative to this crate's root. |
134 | pub fn path_of(&self, item: ItemInNs) -> Option<&ModPath> { | 143 | pub fn path_of(&self, item: ItemInNs) -> Option<&ModPath> { |
144 | Some(&self.map.get(&item)?.path) | ||
145 | } | ||
146 | |||
147 | pub fn import_info_for(&self, item: ItemInNs) -> Option<&ImportInfo> { | ||
135 | self.map.get(&item) | 148 | self.map.get(&item) |
136 | } | 149 | } |
137 | } | 150 | } |
@@ -150,13 +163,13 @@ impl fmt::Debug for ImportMap { | |||
150 | let mut importable_paths: Vec<_> = self | 163 | let mut importable_paths: Vec<_> = self |
151 | .map | 164 | .map |
152 | .iter() | 165 | .iter() |
153 | .map(|(item, modpath)| { | 166 | .map(|(item, info)| { |
154 | let ns = match item { | 167 | let ns = match item { |
155 | ItemInNs::Types(_) => "t", | 168 | ItemInNs::Types(_) => "t", |
156 | ItemInNs::Values(_) => "v", | 169 | ItemInNs::Values(_) => "v", |
157 | ItemInNs::Macros(_) => "m", | 170 | ItemInNs::Macros(_) => "m", |
158 | }; | 171 | }; |
159 | format!("- {} ({})", modpath, ns) | 172 | format!("- {} ({})", info.path, ns) |
160 | }) | 173 | }) |
161 | .collect(); | 174 | .collect(); |
162 | 175 | ||
@@ -171,9 +184,9 @@ fn fst_path(path: &ModPath) -> String { | |||
171 | s | 184 | s |
172 | } | 185 | } |
173 | 186 | ||
174 | fn cmp((_, lhs): &(&ItemInNs, &ModPath), (_, rhs): &(&ItemInNs, &ModPath)) -> Ordering { | 187 | fn cmp((_, lhs): &(&ItemInNs, &ImportInfo), (_, rhs): &(&ItemInNs, &ImportInfo)) -> Ordering { |
175 | let lhs_str = fst_path(lhs); | 188 | let lhs_str = fst_path(&lhs.path); |
176 | let rhs_str = fst_path(rhs); | 189 | let rhs_str = fst_path(&rhs.path); |
177 | lhs_str.cmp(&rhs_str) | 190 | lhs_str.cmp(&rhs_str) |
178 | } | 191 | } |
179 | 192 | ||
@@ -243,7 +256,7 @@ pub fn search_dependencies<'a>( | |||
243 | let importables = &import_map.importables[indexed_value.value as usize..]; | 256 | let importables = &import_map.importables[indexed_value.value as usize..]; |
244 | 257 | ||
245 | // Path shared by the importable items in this group. | 258 | // Path shared by the importable items in this group. |
246 | let path = &import_map.map[&importables[0]]; | 259 | let path = &import_map.map[&importables[0]].path; |
247 | 260 | ||
248 | if query.anchor_end { | 261 | if query.anchor_end { |
249 | // Last segment must match query. | 262 | // Last segment must match query. |
@@ -256,14 +269,14 @@ pub fn search_dependencies<'a>( | |||
256 | // Add the items from this `ModPath` group. Those are all subsequent items in | 269 | // Add the items from this `ModPath` group. Those are all subsequent items in |
257 | // `importables` whose paths match `path`. | 270 | // `importables` whose paths match `path`. |
258 | let iter = importables.iter().copied().take_while(|item| { | 271 | let iter = importables.iter().copied().take_while(|item| { |
259 | let item_path = &import_map.map[item]; | 272 | let item_path = &import_map.map[item].path; |
260 | fst_path(item_path) == fst_path(path) | 273 | fst_path(item_path) == fst_path(path) |
261 | }); | 274 | }); |
262 | 275 | ||
263 | if query.case_sensitive { | 276 | if query.case_sensitive { |
264 | // FIXME: This does not do a subsequence match. | 277 | // FIXME: This does not do a subsequence match. |
265 | res.extend(iter.filter(|item| { | 278 | res.extend(iter.filter(|item| { |
266 | let item_path = &import_map.map[item]; | 279 | let item_path = &import_map.map[item].path; |
267 | item_path.to_string().contains(&query.query) | 280 | item_path.to_string().contains(&query.query) |
268 | })); | 281 | })); |
269 | } else { | 282 | } else { |
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 40081ebb1..58141da11 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -4851,687 +4851,687 @@ impl AstNode for FieldDefList { | |||
4851 | } | 4851 | } |
4852 | } | 4852 | } |
4853 | impl std::fmt::Display for NominalDef { | 4853 | impl std::fmt::Display for NominalDef { |
4854 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4854 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4855 | std::fmt::Display::fmt(self.syntax(), f) | 4855 | std::fmt::Display::fmt(self.syntax(), f) |
4856 | } | 4856 | } |
4857 | } | 4857 | } |
4858 | impl std::fmt::Display for GenericParam { | 4858 | impl std::fmt::Display for GenericParam { |
4859 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4859 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4860 | std::fmt::Display::fmt(self.syntax(), f) | 4860 | std::fmt::Display::fmt(self.syntax(), f) |
4861 | } | 4861 | } |
4862 | } | 4862 | } |
4863 | impl std::fmt::Display for GenericArg { | 4863 | impl std::fmt::Display for GenericArg { |
4864 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4864 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4865 | std::fmt::Display::fmt(self.syntax(), f) | 4865 | std::fmt::Display::fmt(self.syntax(), f) |
4866 | } | 4866 | } |
4867 | } | 4867 | } |
4868 | impl std::fmt::Display for TypeRef { | 4868 | impl std::fmt::Display for TypeRef { |
4869 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4869 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4870 | std::fmt::Display::fmt(self.syntax(), f) | 4870 | std::fmt::Display::fmt(self.syntax(), f) |
4871 | } | 4871 | } |
4872 | } | 4872 | } |
4873 | impl std::fmt::Display for ModuleItem { | 4873 | impl std::fmt::Display for ModuleItem { |
4874 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4874 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4875 | std::fmt::Display::fmt(self.syntax(), f) | 4875 | std::fmt::Display::fmt(self.syntax(), f) |
4876 | } | 4876 | } |
4877 | } | 4877 | } |
4878 | impl std::fmt::Display for AssocItem { | 4878 | impl std::fmt::Display for AssocItem { |
4879 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4879 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4880 | std::fmt::Display::fmt(self.syntax(), f) | 4880 | std::fmt::Display::fmt(self.syntax(), f) |
4881 | } | 4881 | } |
4882 | } | 4882 | } |
4883 | impl std::fmt::Display for ExternItem { | 4883 | impl std::fmt::Display for ExternItem { |
4884 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4884 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4885 | std::fmt::Display::fmt(self.syntax(), f) | 4885 | std::fmt::Display::fmt(self.syntax(), f) |
4886 | } | 4886 | } |
4887 | } | 4887 | } |
4888 | impl std::fmt::Display for Expr { | 4888 | impl std::fmt::Display for Expr { |
4889 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4889 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4890 | std::fmt::Display::fmt(self.syntax(), f) | 4890 | std::fmt::Display::fmt(self.syntax(), f) |
4891 | } | 4891 | } |
4892 | } | 4892 | } |
4893 | impl std::fmt::Display for Pat { | 4893 | impl std::fmt::Display for Pat { |
4894 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4894 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4895 | std::fmt::Display::fmt(self.syntax(), f) | 4895 | std::fmt::Display::fmt(self.syntax(), f) |
4896 | } | 4896 | } |
4897 | } | 4897 | } |
4898 | impl std::fmt::Display for RecordInnerPat { | 4898 | impl std::fmt::Display for RecordInnerPat { |
4899 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4899 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4900 | std::fmt::Display::fmt(self.syntax(), f) | 4900 | std::fmt::Display::fmt(self.syntax(), f) |
4901 | } | 4901 | } |
4902 | } | 4902 | } |
4903 | impl std::fmt::Display for AttrInput { | 4903 | impl std::fmt::Display for AttrInput { |
4904 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4904 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4905 | std::fmt::Display::fmt(self.syntax(), f) | 4905 | std::fmt::Display::fmt(self.syntax(), f) |
4906 | } | 4906 | } |
4907 | } | 4907 | } |
4908 | impl std::fmt::Display for Stmt { | 4908 | impl std::fmt::Display for Stmt { |
4909 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4909 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4910 | std::fmt::Display::fmt(self.syntax(), f) | 4910 | std::fmt::Display::fmt(self.syntax(), f) |
4911 | } | 4911 | } |
4912 | } | 4912 | } |
4913 | impl std::fmt::Display for FieldDefList { | 4913 | impl std::fmt::Display for FieldDefList { |
4914 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4914 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4915 | std::fmt::Display::fmt(self.syntax(), f) | 4915 | std::fmt::Display::fmt(self.syntax(), f) |
4916 | } | 4916 | } |
4917 | } | 4917 | } |
4918 | impl std::fmt::Display for SourceFile { | 4918 | impl std::fmt::Display for SourceFile { |
4919 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4919 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4920 | std::fmt::Display::fmt(self.syntax(), f) | 4920 | std::fmt::Display::fmt(self.syntax(), f) |
4921 | } | 4921 | } |
4922 | } | 4922 | } |
4923 | impl std::fmt::Display for FnDef { | 4923 | impl std::fmt::Display for FnDef { |
4924 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4924 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4925 | std::fmt::Display::fmt(self.syntax(), f) | 4925 | std::fmt::Display::fmt(self.syntax(), f) |
4926 | } | 4926 | } |
4927 | } | 4927 | } |
4928 | impl std::fmt::Display for RetType { | 4928 | impl std::fmt::Display for RetType { |
4929 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4929 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4930 | std::fmt::Display::fmt(self.syntax(), f) | 4930 | std::fmt::Display::fmt(self.syntax(), f) |
4931 | } | 4931 | } |
4932 | } | 4932 | } |
4933 | impl std::fmt::Display for StructDef { | 4933 | impl std::fmt::Display for StructDef { |
4934 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4934 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4935 | std::fmt::Display::fmt(self.syntax(), f) | 4935 | std::fmt::Display::fmt(self.syntax(), f) |
4936 | } | 4936 | } |
4937 | } | 4937 | } |
4938 | impl std::fmt::Display for UnionDef { | 4938 | impl std::fmt::Display for UnionDef { |
4939 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4939 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4940 | std::fmt::Display::fmt(self.syntax(), f) | 4940 | std::fmt::Display::fmt(self.syntax(), f) |
4941 | } | 4941 | } |
4942 | } | 4942 | } |
4943 | impl std::fmt::Display for RecordFieldDefList { | 4943 | impl std::fmt::Display for RecordFieldDefList { |
4944 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4944 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4945 | std::fmt::Display::fmt(self.syntax(), f) | 4945 | std::fmt::Display::fmt(self.syntax(), f) |
4946 | } | 4946 | } |
4947 | } | 4947 | } |
4948 | impl std::fmt::Display for RecordFieldDef { | 4948 | impl std::fmt::Display for RecordFieldDef { |
4949 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4949 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4950 | std::fmt::Display::fmt(self.syntax(), f) | 4950 | std::fmt::Display::fmt(self.syntax(), f) |
4951 | } | 4951 | } |
4952 | } | 4952 | } |
4953 | impl std::fmt::Display for TupleFieldDefList { | 4953 | impl std::fmt::Display for TupleFieldDefList { |
4954 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4954 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4955 | std::fmt::Display::fmt(self.syntax(), f) | 4955 | std::fmt::Display::fmt(self.syntax(), f) |
4956 | } | 4956 | } |
4957 | } | 4957 | } |
4958 | impl std::fmt::Display for TupleFieldDef { | 4958 | impl std::fmt::Display for TupleFieldDef { |
4959 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4959 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4960 | std::fmt::Display::fmt(self.syntax(), f) | 4960 | std::fmt::Display::fmt(self.syntax(), f) |
4961 | } | 4961 | } |
4962 | } | 4962 | } |
4963 | impl std::fmt::Display for EnumDef { | 4963 | impl std::fmt::Display for EnumDef { |
4964 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4964 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4965 | std::fmt::Display::fmt(self.syntax(), f) | 4965 | std::fmt::Display::fmt(self.syntax(), f) |
4966 | } | 4966 | } |
4967 | } | 4967 | } |
4968 | impl std::fmt::Display for EnumVariantList { | 4968 | impl std::fmt::Display for EnumVariantList { |
4969 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4969 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4970 | std::fmt::Display::fmt(self.syntax(), f) | 4970 | std::fmt::Display::fmt(self.syntax(), f) |
4971 | } | 4971 | } |
4972 | } | 4972 | } |
4973 | impl std::fmt::Display for EnumVariant { | 4973 | impl std::fmt::Display for EnumVariant { |
4974 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4974 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4975 | std::fmt::Display::fmt(self.syntax(), f) | 4975 | std::fmt::Display::fmt(self.syntax(), f) |
4976 | } | 4976 | } |
4977 | } | 4977 | } |
4978 | impl std::fmt::Display for TraitDef { | 4978 | impl std::fmt::Display for TraitDef { |
4979 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4979 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4980 | std::fmt::Display::fmt(self.syntax(), f) | 4980 | std::fmt::Display::fmt(self.syntax(), f) |
4981 | } | 4981 | } |
4982 | } | 4982 | } |
4983 | impl std::fmt::Display for Module { | 4983 | impl std::fmt::Display for Module { |
4984 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4984 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4985 | std::fmt::Display::fmt(self.syntax(), f) | 4985 | std::fmt::Display::fmt(self.syntax(), f) |
4986 | } | 4986 | } |
4987 | } | 4987 | } |
4988 | impl std::fmt::Display for ItemList { | 4988 | impl std::fmt::Display for ItemList { |
4989 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4989 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4990 | std::fmt::Display::fmt(self.syntax(), f) | 4990 | std::fmt::Display::fmt(self.syntax(), f) |
4991 | } | 4991 | } |
4992 | } | 4992 | } |
4993 | impl std::fmt::Display for ConstDef { | 4993 | impl std::fmt::Display for ConstDef { |
4994 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4994 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
4995 | std::fmt::Display::fmt(self.syntax(), f) | 4995 | std::fmt::Display::fmt(self.syntax(), f) |
4996 | } | 4996 | } |
4997 | } | 4997 | } |
4998 | impl std::fmt::Display for StaticDef { | 4998 | impl std::fmt::Display for StaticDef { |
4999 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 4999 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5000 | std::fmt::Display::fmt(self.syntax(), f) | 5000 | std::fmt::Display::fmt(self.syntax(), f) |
5001 | } | 5001 | } |
5002 | } | 5002 | } |
5003 | impl std::fmt::Display for TypeAliasDef { | 5003 | impl std::fmt::Display for TypeAliasDef { |
5004 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5004 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5005 | std::fmt::Display::fmt(self.syntax(), f) | 5005 | std::fmt::Display::fmt(self.syntax(), f) |
5006 | } | 5006 | } |
5007 | } | 5007 | } |
5008 | impl std::fmt::Display for ImplDef { | 5008 | impl std::fmt::Display for ImplDef { |
5009 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5009 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5010 | std::fmt::Display::fmt(self.syntax(), f) | 5010 | std::fmt::Display::fmt(self.syntax(), f) |
5011 | } | 5011 | } |
5012 | } | 5012 | } |
5013 | impl std::fmt::Display for ParenType { | 5013 | impl std::fmt::Display for ParenType { |
5014 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5014 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5015 | std::fmt::Display::fmt(self.syntax(), f) | 5015 | std::fmt::Display::fmt(self.syntax(), f) |
5016 | } | 5016 | } |
5017 | } | 5017 | } |
5018 | impl std::fmt::Display for TupleType { | 5018 | impl std::fmt::Display for TupleType { |
5019 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5019 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5020 | std::fmt::Display::fmt(self.syntax(), f) | 5020 | std::fmt::Display::fmt(self.syntax(), f) |
5021 | } | 5021 | } |
5022 | } | 5022 | } |
5023 | impl std::fmt::Display for NeverType { | 5023 | impl std::fmt::Display for NeverType { |
5024 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5024 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5025 | std::fmt::Display::fmt(self.syntax(), f) | 5025 | std::fmt::Display::fmt(self.syntax(), f) |
5026 | } | 5026 | } |
5027 | } | 5027 | } |
5028 | impl std::fmt::Display for PathType { | 5028 | impl std::fmt::Display for PathType { |
5029 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5029 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5030 | std::fmt::Display::fmt(self.syntax(), f) | 5030 | std::fmt::Display::fmt(self.syntax(), f) |
5031 | } | 5031 | } |
5032 | } | 5032 | } |
5033 | impl std::fmt::Display for PointerType { | 5033 | impl std::fmt::Display for PointerType { |
5034 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5034 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5035 | std::fmt::Display::fmt(self.syntax(), f) | 5035 | std::fmt::Display::fmt(self.syntax(), f) |
5036 | } | 5036 | } |
5037 | } | 5037 | } |
5038 | impl std::fmt::Display for ArrayType { | 5038 | impl std::fmt::Display for ArrayType { |
5039 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5039 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5040 | std::fmt::Display::fmt(self.syntax(), f) | 5040 | std::fmt::Display::fmt(self.syntax(), f) |
5041 | } | 5041 | } |
5042 | } | 5042 | } |
5043 | impl std::fmt::Display for SliceType { | 5043 | impl std::fmt::Display for SliceType { |
5044 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5044 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5045 | std::fmt::Display::fmt(self.syntax(), f) | 5045 | std::fmt::Display::fmt(self.syntax(), f) |
5046 | } | 5046 | } |
5047 | } | 5047 | } |
5048 | impl std::fmt::Display for ReferenceType { | 5048 | impl std::fmt::Display for ReferenceType { |
5049 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5049 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5050 | std::fmt::Display::fmt(self.syntax(), f) | 5050 | std::fmt::Display::fmt(self.syntax(), f) |
5051 | } | 5051 | } |
5052 | } | 5052 | } |
5053 | impl std::fmt::Display for PlaceholderType { | 5053 | impl std::fmt::Display for PlaceholderType { |
5054 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5054 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5055 | std::fmt::Display::fmt(self.syntax(), f) | 5055 | std::fmt::Display::fmt(self.syntax(), f) |
5056 | } | 5056 | } |
5057 | } | 5057 | } |
5058 | impl std::fmt::Display for FnPointerType { | 5058 | impl std::fmt::Display for FnPointerType { |
5059 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5059 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5060 | std::fmt::Display::fmt(self.syntax(), f) | 5060 | std::fmt::Display::fmt(self.syntax(), f) |
5061 | } | 5061 | } |
5062 | } | 5062 | } |
5063 | impl std::fmt::Display for ForType { | 5063 | impl std::fmt::Display for ForType { |
5064 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5064 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5065 | std::fmt::Display::fmt(self.syntax(), f) | 5065 | std::fmt::Display::fmt(self.syntax(), f) |
5066 | } | 5066 | } |
5067 | } | 5067 | } |
5068 | impl std::fmt::Display for ImplTraitType { | 5068 | impl std::fmt::Display for ImplTraitType { |
5069 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5069 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5070 | std::fmt::Display::fmt(self.syntax(), f) | 5070 | std::fmt::Display::fmt(self.syntax(), f) |
5071 | } | 5071 | } |
5072 | } | 5072 | } |
5073 | impl std::fmt::Display for DynTraitType { | 5073 | impl std::fmt::Display for DynTraitType { |
5074 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5074 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5075 | std::fmt::Display::fmt(self.syntax(), f) | 5075 | std::fmt::Display::fmt(self.syntax(), f) |
5076 | } | 5076 | } |
5077 | } | 5077 | } |
5078 | impl std::fmt::Display for TupleExpr { | 5078 | impl std::fmt::Display for TupleExpr { |
5079 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5079 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5080 | std::fmt::Display::fmt(self.syntax(), f) | 5080 | std::fmt::Display::fmt(self.syntax(), f) |
5081 | } | 5081 | } |
5082 | } | 5082 | } |
5083 | impl std::fmt::Display for ArrayExpr { | 5083 | impl std::fmt::Display for ArrayExpr { |
5084 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5084 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5085 | std::fmt::Display::fmt(self.syntax(), f) | 5085 | std::fmt::Display::fmt(self.syntax(), f) |
5086 | } | 5086 | } |
5087 | } | 5087 | } |
5088 | impl std::fmt::Display for ParenExpr { | 5088 | impl std::fmt::Display for ParenExpr { |
5089 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5089 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5090 | std::fmt::Display::fmt(self.syntax(), f) | 5090 | std::fmt::Display::fmt(self.syntax(), f) |
5091 | } | 5091 | } |
5092 | } | 5092 | } |
5093 | impl std::fmt::Display for PathExpr { | 5093 | impl std::fmt::Display for PathExpr { |
5094 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5094 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5095 | std::fmt::Display::fmt(self.syntax(), f) | 5095 | std::fmt::Display::fmt(self.syntax(), f) |
5096 | } | 5096 | } |
5097 | } | 5097 | } |
5098 | impl std::fmt::Display for LambdaExpr { | 5098 | impl std::fmt::Display for LambdaExpr { |
5099 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5099 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5100 | std::fmt::Display::fmt(self.syntax(), f) | 5100 | std::fmt::Display::fmt(self.syntax(), f) |
5101 | } | 5101 | } |
5102 | } | 5102 | } |
5103 | impl std::fmt::Display for IfExpr { | 5103 | impl std::fmt::Display for IfExpr { |
5104 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5104 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5105 | std::fmt::Display::fmt(self.syntax(), f) | 5105 | std::fmt::Display::fmt(self.syntax(), f) |
5106 | } | 5106 | } |
5107 | } | 5107 | } |
5108 | impl std::fmt::Display for LoopExpr { | 5108 | impl std::fmt::Display for LoopExpr { |
5109 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5109 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5110 | std::fmt::Display::fmt(self.syntax(), f) | 5110 | std::fmt::Display::fmt(self.syntax(), f) |
5111 | } | 5111 | } |
5112 | } | 5112 | } |
5113 | impl std::fmt::Display for EffectExpr { | 5113 | impl std::fmt::Display for EffectExpr { |
5114 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5114 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5115 | std::fmt::Display::fmt(self.syntax(), f) | 5115 | std::fmt::Display::fmt(self.syntax(), f) |
5116 | } | 5116 | } |
5117 | } | 5117 | } |
5118 | impl std::fmt::Display for ForExpr { | 5118 | impl std::fmt::Display for ForExpr { |
5119 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5119 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5120 | std::fmt::Display::fmt(self.syntax(), f) | 5120 | std::fmt::Display::fmt(self.syntax(), f) |
5121 | } | 5121 | } |
5122 | } | 5122 | } |
5123 | impl std::fmt::Display for WhileExpr { | 5123 | impl std::fmt::Display for WhileExpr { |
5124 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5124 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5125 | std::fmt::Display::fmt(self.syntax(), f) | 5125 | std::fmt::Display::fmt(self.syntax(), f) |
5126 | } | 5126 | } |
5127 | } | 5127 | } |
5128 | impl std::fmt::Display for ContinueExpr { | 5128 | impl std::fmt::Display for ContinueExpr { |
5129 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5129 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5130 | std::fmt::Display::fmt(self.syntax(), f) | 5130 | std::fmt::Display::fmt(self.syntax(), f) |
5131 | } | 5131 | } |
5132 | } | 5132 | } |
5133 | impl std::fmt::Display for BreakExpr { | 5133 | impl std::fmt::Display for BreakExpr { |
5134 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5134 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5135 | std::fmt::Display::fmt(self.syntax(), f) | 5135 | std::fmt::Display::fmt(self.syntax(), f) |
5136 | } | 5136 | } |
5137 | } | 5137 | } |
5138 | impl std::fmt::Display for Label { | 5138 | impl std::fmt::Display for Label { |
5139 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5139 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5140 | std::fmt::Display::fmt(self.syntax(), f) | 5140 | std::fmt::Display::fmt(self.syntax(), f) |
5141 | } | 5141 | } |
5142 | } | 5142 | } |
5143 | impl std::fmt::Display for BlockExpr { | 5143 | impl std::fmt::Display for BlockExpr { |
5144 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5144 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5145 | std::fmt::Display::fmt(self.syntax(), f) | 5145 | std::fmt::Display::fmt(self.syntax(), f) |
5146 | } | 5146 | } |
5147 | } | 5147 | } |
5148 | impl std::fmt::Display for ReturnExpr { | 5148 | impl std::fmt::Display for ReturnExpr { |
5149 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5149 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5150 | std::fmt::Display::fmt(self.syntax(), f) | 5150 | std::fmt::Display::fmt(self.syntax(), f) |
5151 | } | 5151 | } |
5152 | } | 5152 | } |
5153 | impl std::fmt::Display for CallExpr { | 5153 | impl std::fmt::Display for CallExpr { |
5154 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5154 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5155 | std::fmt::Display::fmt(self.syntax(), f) | 5155 | std::fmt::Display::fmt(self.syntax(), f) |
5156 | } | 5156 | } |
5157 | } | 5157 | } |
5158 | impl std::fmt::Display for MethodCallExpr { | 5158 | impl std::fmt::Display for MethodCallExpr { |
5159 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5159 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5160 | std::fmt::Display::fmt(self.syntax(), f) | 5160 | std::fmt::Display::fmt(self.syntax(), f) |
5161 | } | 5161 | } |
5162 | } | 5162 | } |
5163 | impl std::fmt::Display for IndexExpr { | 5163 | impl std::fmt::Display for IndexExpr { |
5164 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5164 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5165 | std::fmt::Display::fmt(self.syntax(), f) | 5165 | std::fmt::Display::fmt(self.syntax(), f) |
5166 | } | 5166 | } |
5167 | } | 5167 | } |
5168 | impl std::fmt::Display for FieldExpr { | 5168 | impl std::fmt::Display for FieldExpr { |
5169 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5169 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5170 | std::fmt::Display::fmt(self.syntax(), f) | 5170 | std::fmt::Display::fmt(self.syntax(), f) |
5171 | } | 5171 | } |
5172 | } | 5172 | } |
5173 | impl std::fmt::Display for AwaitExpr { | 5173 | impl std::fmt::Display for AwaitExpr { |
5174 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5174 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5175 | std::fmt::Display::fmt(self.syntax(), f) | 5175 | std::fmt::Display::fmt(self.syntax(), f) |
5176 | } | 5176 | } |
5177 | } | 5177 | } |
5178 | impl std::fmt::Display for TryExpr { | 5178 | impl std::fmt::Display for TryExpr { |
5179 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5179 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5180 | std::fmt::Display::fmt(self.syntax(), f) | 5180 | std::fmt::Display::fmt(self.syntax(), f) |
5181 | } | 5181 | } |
5182 | } | 5182 | } |
5183 | impl std::fmt::Display for CastExpr { | 5183 | impl std::fmt::Display for CastExpr { |
5184 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5184 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5185 | std::fmt::Display::fmt(self.syntax(), f) | 5185 | std::fmt::Display::fmt(self.syntax(), f) |
5186 | } | 5186 | } |
5187 | } | 5187 | } |
5188 | impl std::fmt::Display for RefExpr { | 5188 | impl std::fmt::Display for RefExpr { |
5189 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5189 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5190 | std::fmt::Display::fmt(self.syntax(), f) | 5190 | std::fmt::Display::fmt(self.syntax(), f) |
5191 | } | 5191 | } |
5192 | } | 5192 | } |
5193 | impl std::fmt::Display for PrefixExpr { | 5193 | impl std::fmt::Display for PrefixExpr { |
5194 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5194 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5195 | std::fmt::Display::fmt(self.syntax(), f) | 5195 | std::fmt::Display::fmt(self.syntax(), f) |
5196 | } | 5196 | } |
5197 | } | 5197 | } |
5198 | impl std::fmt::Display for BoxExpr { | 5198 | impl std::fmt::Display for BoxExpr { |
5199 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5199 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5200 | std::fmt::Display::fmt(self.syntax(), f) | 5200 | std::fmt::Display::fmt(self.syntax(), f) |
5201 | } | 5201 | } |
5202 | } | 5202 | } |
5203 | impl std::fmt::Display for RangeExpr { | 5203 | impl std::fmt::Display for RangeExpr { |
5204 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5204 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5205 | std::fmt::Display::fmt(self.syntax(), f) | 5205 | std::fmt::Display::fmt(self.syntax(), f) |
5206 | } | 5206 | } |
5207 | } | 5207 | } |
5208 | impl std::fmt::Display for BinExpr { | 5208 | impl std::fmt::Display for BinExpr { |
5209 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5209 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5210 | std::fmt::Display::fmt(self.syntax(), f) | 5210 | std::fmt::Display::fmt(self.syntax(), f) |
5211 | } | 5211 | } |
5212 | } | 5212 | } |
5213 | impl std::fmt::Display for Literal { | 5213 | impl std::fmt::Display for Literal { |
5214 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5214 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5215 | std::fmt::Display::fmt(self.syntax(), f) | 5215 | std::fmt::Display::fmt(self.syntax(), f) |
5216 | } | 5216 | } |
5217 | } | 5217 | } |
5218 | impl std::fmt::Display for MatchExpr { | 5218 | impl std::fmt::Display for MatchExpr { |
5219 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5219 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5220 | std::fmt::Display::fmt(self.syntax(), f) | 5220 | std::fmt::Display::fmt(self.syntax(), f) |
5221 | } | 5221 | } |
5222 | } | 5222 | } |
5223 | impl std::fmt::Display for MatchArmList { | 5223 | impl std::fmt::Display for MatchArmList { |
5224 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5224 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5225 | std::fmt::Display::fmt(self.syntax(), f) | 5225 | std::fmt::Display::fmt(self.syntax(), f) |
5226 | } | 5226 | } |
5227 | } | 5227 | } |
5228 | impl std::fmt::Display for MatchArm { | 5228 | impl std::fmt::Display for MatchArm { |
5229 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5229 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5230 | std::fmt::Display::fmt(self.syntax(), f) | 5230 | std::fmt::Display::fmt(self.syntax(), f) |
5231 | } | 5231 | } |
5232 | } | 5232 | } |
5233 | impl std::fmt::Display for MatchGuard { | 5233 | impl std::fmt::Display for MatchGuard { |
5234 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5234 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5235 | std::fmt::Display::fmt(self.syntax(), f) | 5235 | std::fmt::Display::fmt(self.syntax(), f) |
5236 | } | 5236 | } |
5237 | } | 5237 | } |
5238 | impl std::fmt::Display for RecordLit { | 5238 | impl std::fmt::Display for RecordLit { |
5239 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5239 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5240 | std::fmt::Display::fmt(self.syntax(), f) | 5240 | std::fmt::Display::fmt(self.syntax(), f) |
5241 | } | 5241 | } |
5242 | } | 5242 | } |
5243 | impl std::fmt::Display for RecordFieldList { | 5243 | impl std::fmt::Display for RecordFieldList { |
5244 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5244 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5245 | std::fmt::Display::fmt(self.syntax(), f) | 5245 | std::fmt::Display::fmt(self.syntax(), f) |
5246 | } | 5246 | } |
5247 | } | 5247 | } |
5248 | impl std::fmt::Display for RecordField { | 5248 | impl std::fmt::Display for RecordField { |
5249 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5249 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5250 | std::fmt::Display::fmt(self.syntax(), f) | 5250 | std::fmt::Display::fmt(self.syntax(), f) |
5251 | } | 5251 | } |
5252 | } | 5252 | } |
5253 | impl std::fmt::Display for OrPat { | 5253 | impl std::fmt::Display for OrPat { |
5254 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5254 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5255 | std::fmt::Display::fmt(self.syntax(), f) | 5255 | std::fmt::Display::fmt(self.syntax(), f) |
5256 | } | 5256 | } |
5257 | } | 5257 | } |
5258 | impl std::fmt::Display for ParenPat { | 5258 | impl std::fmt::Display for ParenPat { |
5259 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5259 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5260 | std::fmt::Display::fmt(self.syntax(), f) | 5260 | std::fmt::Display::fmt(self.syntax(), f) |
5261 | } | 5261 | } |
5262 | } | 5262 | } |
5263 | impl std::fmt::Display for RefPat { | 5263 | impl std::fmt::Display for RefPat { |
5264 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5264 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5265 | std::fmt::Display::fmt(self.syntax(), f) | 5265 | std::fmt::Display::fmt(self.syntax(), f) |
5266 | } | 5266 | } |
5267 | } | 5267 | } |
5268 | impl std::fmt::Display for BoxPat { | 5268 | impl std::fmt::Display for BoxPat { |
5269 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5269 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5270 | std::fmt::Display::fmt(self.syntax(), f) | 5270 | std::fmt::Display::fmt(self.syntax(), f) |
5271 | } | 5271 | } |
5272 | } | 5272 | } |
5273 | impl std::fmt::Display for BindPat { | 5273 | impl std::fmt::Display for BindPat { |
5274 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5274 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5275 | std::fmt::Display::fmt(self.syntax(), f) | 5275 | std::fmt::Display::fmt(self.syntax(), f) |
5276 | } | 5276 | } |
5277 | } | 5277 | } |
5278 | impl std::fmt::Display for PlaceholderPat { | 5278 | impl std::fmt::Display for PlaceholderPat { |
5279 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5279 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5280 | std::fmt::Display::fmt(self.syntax(), f) | 5280 | std::fmt::Display::fmt(self.syntax(), f) |
5281 | } | 5281 | } |
5282 | } | 5282 | } |
5283 | impl std::fmt::Display for DotDotPat { | 5283 | impl std::fmt::Display for DotDotPat { |
5284 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5284 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5285 | std::fmt::Display::fmt(self.syntax(), f) | 5285 | std::fmt::Display::fmt(self.syntax(), f) |
5286 | } | 5286 | } |
5287 | } | 5287 | } |
5288 | impl std::fmt::Display for PathPat { | 5288 | impl std::fmt::Display for PathPat { |
5289 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5289 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5290 | std::fmt::Display::fmt(self.syntax(), f) | 5290 | std::fmt::Display::fmt(self.syntax(), f) |
5291 | } | 5291 | } |
5292 | } | 5292 | } |
5293 | impl std::fmt::Display for SlicePat { | 5293 | impl std::fmt::Display for SlicePat { |
5294 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5294 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5295 | std::fmt::Display::fmt(self.syntax(), f) | 5295 | std::fmt::Display::fmt(self.syntax(), f) |
5296 | } | 5296 | } |
5297 | } | 5297 | } |
5298 | impl std::fmt::Display for RangePat { | 5298 | impl std::fmt::Display for RangePat { |
5299 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5299 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5300 | std::fmt::Display::fmt(self.syntax(), f) | 5300 | std::fmt::Display::fmt(self.syntax(), f) |
5301 | } | 5301 | } |
5302 | } | 5302 | } |
5303 | impl std::fmt::Display for LiteralPat { | 5303 | impl std::fmt::Display for LiteralPat { |
5304 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5304 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5305 | std::fmt::Display::fmt(self.syntax(), f) | 5305 | std::fmt::Display::fmt(self.syntax(), f) |
5306 | } | 5306 | } |
5307 | } | 5307 | } |
5308 | impl std::fmt::Display for MacroPat { | 5308 | impl std::fmt::Display for MacroPat { |
5309 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5309 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5310 | std::fmt::Display::fmt(self.syntax(), f) | 5310 | std::fmt::Display::fmt(self.syntax(), f) |
5311 | } | 5311 | } |
5312 | } | 5312 | } |
5313 | impl std::fmt::Display for RecordPat { | 5313 | impl std::fmt::Display for RecordPat { |
5314 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5314 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5315 | std::fmt::Display::fmt(self.syntax(), f) | 5315 | std::fmt::Display::fmt(self.syntax(), f) |
5316 | } | 5316 | } |
5317 | } | 5317 | } |
5318 | impl std::fmt::Display for RecordFieldPatList { | 5318 | impl std::fmt::Display for RecordFieldPatList { |
5319 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5319 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5320 | std::fmt::Display::fmt(self.syntax(), f) | 5320 | std::fmt::Display::fmt(self.syntax(), f) |
5321 | } | 5321 | } |
5322 | } | 5322 | } |
5323 | impl std::fmt::Display for RecordFieldPat { | 5323 | impl std::fmt::Display for RecordFieldPat { |
5324 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5324 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5325 | std::fmt::Display::fmt(self.syntax(), f) | 5325 | std::fmt::Display::fmt(self.syntax(), f) |
5326 | } | 5326 | } |
5327 | } | 5327 | } |
5328 | impl std::fmt::Display for TupleStructPat { | 5328 | impl std::fmt::Display for TupleStructPat { |
5329 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5329 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5330 | std::fmt::Display::fmt(self.syntax(), f) | 5330 | std::fmt::Display::fmt(self.syntax(), f) |
5331 | } | 5331 | } |
5332 | } | 5332 | } |
5333 | impl std::fmt::Display for TuplePat { | 5333 | impl std::fmt::Display for TuplePat { |
5334 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5334 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5335 | std::fmt::Display::fmt(self.syntax(), f) | 5335 | std::fmt::Display::fmt(self.syntax(), f) |
5336 | } | 5336 | } |
5337 | } | 5337 | } |
5338 | impl std::fmt::Display for Visibility { | 5338 | impl std::fmt::Display for Visibility { |
5339 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5339 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5340 | std::fmt::Display::fmt(self.syntax(), f) | 5340 | std::fmt::Display::fmt(self.syntax(), f) |
5341 | } | 5341 | } |
5342 | } | 5342 | } |
5343 | impl std::fmt::Display for Name { | 5343 | impl std::fmt::Display for Name { |
5344 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5344 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5345 | std::fmt::Display::fmt(self.syntax(), f) | 5345 | std::fmt::Display::fmt(self.syntax(), f) |
5346 | } | 5346 | } |
5347 | } | 5347 | } |
5348 | impl std::fmt::Display for NameRef { | 5348 | impl std::fmt::Display for NameRef { |
5349 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5349 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5350 | std::fmt::Display::fmt(self.syntax(), f) | 5350 | std::fmt::Display::fmt(self.syntax(), f) |
5351 | } | 5351 | } |
5352 | } | 5352 | } |
5353 | impl std::fmt::Display for MacroCall { | 5353 | impl std::fmt::Display for MacroCall { |
5354 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5354 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5355 | std::fmt::Display::fmt(self.syntax(), f) | 5355 | std::fmt::Display::fmt(self.syntax(), f) |
5356 | } | 5356 | } |
5357 | } | 5357 | } |
5358 | impl std::fmt::Display for Attr { | 5358 | impl std::fmt::Display for Attr { |
5359 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5359 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5360 | std::fmt::Display::fmt(self.syntax(), f) | 5360 | std::fmt::Display::fmt(self.syntax(), f) |
5361 | } | 5361 | } |
5362 | } | 5362 | } |
5363 | impl std::fmt::Display for TokenTree { | 5363 | impl std::fmt::Display for TokenTree { |
5364 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5364 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5365 | std::fmt::Display::fmt(self.syntax(), f) | 5365 | std::fmt::Display::fmt(self.syntax(), f) |
5366 | } | 5366 | } |
5367 | } | 5367 | } |
5368 | impl std::fmt::Display for TypeParamList { | 5368 | impl std::fmt::Display for TypeParamList { |
5369 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5369 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5370 | std::fmt::Display::fmt(self.syntax(), f) | 5370 | std::fmt::Display::fmt(self.syntax(), f) |
5371 | } | 5371 | } |
5372 | } | 5372 | } |
5373 | impl std::fmt::Display for TypeParam { | 5373 | impl std::fmt::Display for TypeParam { |
5374 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5374 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5375 | std::fmt::Display::fmt(self.syntax(), f) | 5375 | std::fmt::Display::fmt(self.syntax(), f) |
5376 | } | 5376 | } |
5377 | } | 5377 | } |
5378 | impl std::fmt::Display for ConstParam { | 5378 | impl std::fmt::Display for ConstParam { |
5379 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5379 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5380 | std::fmt::Display::fmt(self.syntax(), f) | 5380 | std::fmt::Display::fmt(self.syntax(), f) |
5381 | } | 5381 | } |
5382 | } | 5382 | } |
5383 | impl std::fmt::Display for LifetimeParam { | 5383 | impl std::fmt::Display for LifetimeParam { |
5384 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5384 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5385 | std::fmt::Display::fmt(self.syntax(), f) | 5385 | std::fmt::Display::fmt(self.syntax(), f) |
5386 | } | 5386 | } |
5387 | } | 5387 | } |
5388 | impl std::fmt::Display for TypeBound { | 5388 | impl std::fmt::Display for TypeBound { |
5389 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5389 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5390 | std::fmt::Display::fmt(self.syntax(), f) | 5390 | std::fmt::Display::fmt(self.syntax(), f) |
5391 | } | 5391 | } |
5392 | } | 5392 | } |
5393 | impl std::fmt::Display for TypeBoundList { | 5393 | impl std::fmt::Display for TypeBoundList { |
5394 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5394 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5395 | std::fmt::Display::fmt(self.syntax(), f) | 5395 | std::fmt::Display::fmt(self.syntax(), f) |
5396 | } | 5396 | } |
5397 | } | 5397 | } |
5398 | impl std::fmt::Display for WherePred { | 5398 | impl std::fmt::Display for WherePred { |
5399 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5399 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5400 | std::fmt::Display::fmt(self.syntax(), f) | 5400 | std::fmt::Display::fmt(self.syntax(), f) |
5401 | } | 5401 | } |
5402 | } | 5402 | } |
5403 | impl std::fmt::Display for WhereClause { | 5403 | impl std::fmt::Display for WhereClause { |
5404 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5404 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5405 | std::fmt::Display::fmt(self.syntax(), f) | 5405 | std::fmt::Display::fmt(self.syntax(), f) |
5406 | } | 5406 | } |
5407 | } | 5407 | } |
5408 | impl std::fmt::Display for Abi { | 5408 | impl std::fmt::Display for Abi { |
5409 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5409 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5410 | std::fmt::Display::fmt(self.syntax(), f) | 5410 | std::fmt::Display::fmt(self.syntax(), f) |
5411 | } | 5411 | } |
5412 | } | 5412 | } |
5413 | impl std::fmt::Display for ExprStmt { | 5413 | impl std::fmt::Display for ExprStmt { |
5414 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5414 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5415 | std::fmt::Display::fmt(self.syntax(), f) | 5415 | std::fmt::Display::fmt(self.syntax(), f) |
5416 | } | 5416 | } |
5417 | } | 5417 | } |
5418 | impl std::fmt::Display for LetStmt { | 5418 | impl std::fmt::Display for LetStmt { |
5419 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5419 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5420 | std::fmt::Display::fmt(self.syntax(), f) | 5420 | std::fmt::Display::fmt(self.syntax(), f) |
5421 | } | 5421 | } |
5422 | } | 5422 | } |
5423 | impl std::fmt::Display for Condition { | 5423 | impl std::fmt::Display for Condition { |
5424 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5424 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5425 | std::fmt::Display::fmt(self.syntax(), f) | 5425 | std::fmt::Display::fmt(self.syntax(), f) |
5426 | } | 5426 | } |
5427 | } | 5427 | } |
5428 | impl std::fmt::Display for ParamList { | 5428 | impl std::fmt::Display for ParamList { |
5429 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5429 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5430 | std::fmt::Display::fmt(self.syntax(), f) | 5430 | std::fmt::Display::fmt(self.syntax(), f) |
5431 | } | 5431 | } |
5432 | } | 5432 | } |
5433 | impl std::fmt::Display for SelfParam { | 5433 | impl std::fmt::Display for SelfParam { |
5434 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5434 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5435 | std::fmt::Display::fmt(self.syntax(), f) | 5435 | std::fmt::Display::fmt(self.syntax(), f) |
5436 | } | 5436 | } |
5437 | } | 5437 | } |
5438 | impl std::fmt::Display for Param { | 5438 | impl std::fmt::Display for Param { |
5439 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5439 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5440 | std::fmt::Display::fmt(self.syntax(), f) | 5440 | std::fmt::Display::fmt(self.syntax(), f) |
5441 | } | 5441 | } |
5442 | } | 5442 | } |
5443 | impl std::fmt::Display for UseItem { | 5443 | impl std::fmt::Display for UseItem { |
5444 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5444 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5445 | std::fmt::Display::fmt(self.syntax(), f) | 5445 | std::fmt::Display::fmt(self.syntax(), f) |
5446 | } | 5446 | } |
5447 | } | 5447 | } |
5448 | impl std::fmt::Display for UseTree { | 5448 | impl std::fmt::Display for UseTree { |
5449 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5449 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5450 | std::fmt::Display::fmt(self.syntax(), f) | 5450 | std::fmt::Display::fmt(self.syntax(), f) |
5451 | } | 5451 | } |
5452 | } | 5452 | } |
5453 | impl std::fmt::Display for Alias { | 5453 | impl std::fmt::Display for Alias { |
5454 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5454 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5455 | std::fmt::Display::fmt(self.syntax(), f) | 5455 | std::fmt::Display::fmt(self.syntax(), f) |
5456 | } | 5456 | } |
5457 | } | 5457 | } |
5458 | impl std::fmt::Display for UseTreeList { | 5458 | impl std::fmt::Display for UseTreeList { |
5459 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5459 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5460 | std::fmt::Display::fmt(self.syntax(), f) | 5460 | std::fmt::Display::fmt(self.syntax(), f) |
5461 | } | 5461 | } |
5462 | } | 5462 | } |
5463 | impl std::fmt::Display for ExternCrateItem { | 5463 | impl std::fmt::Display for ExternCrateItem { |
5464 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5464 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5465 | std::fmt::Display::fmt(self.syntax(), f) | 5465 | std::fmt::Display::fmt(self.syntax(), f) |
5466 | } | 5466 | } |
5467 | } | 5467 | } |
5468 | impl std::fmt::Display for ArgList { | 5468 | impl std::fmt::Display for ArgList { |
5469 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5469 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5470 | std::fmt::Display::fmt(self.syntax(), f) | 5470 | std::fmt::Display::fmt(self.syntax(), f) |
5471 | } | 5471 | } |
5472 | } | 5472 | } |
5473 | impl std::fmt::Display for Path { | 5473 | impl std::fmt::Display for Path { |
5474 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5474 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5475 | std::fmt::Display::fmt(self.syntax(), f) | 5475 | std::fmt::Display::fmt(self.syntax(), f) |
5476 | } | 5476 | } |
5477 | } | 5477 | } |
5478 | impl std::fmt::Display for PathSegment { | 5478 | impl std::fmt::Display for PathSegment { |
5479 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5479 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5480 | std::fmt::Display::fmt(self.syntax(), f) | 5480 | std::fmt::Display::fmt(self.syntax(), f) |
5481 | } | 5481 | } |
5482 | } | 5482 | } |
5483 | impl std::fmt::Display for TypeArgList { | 5483 | impl std::fmt::Display for TypeArgList { |
5484 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5484 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5485 | std::fmt::Display::fmt(self.syntax(), f) | 5485 | std::fmt::Display::fmt(self.syntax(), f) |
5486 | } | 5486 | } |
5487 | } | 5487 | } |
5488 | impl std::fmt::Display for TypeArg { | 5488 | impl std::fmt::Display for TypeArg { |
5489 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5489 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5490 | std::fmt::Display::fmt(self.syntax(), f) | 5490 | std::fmt::Display::fmt(self.syntax(), f) |
5491 | } | 5491 | } |
5492 | } | 5492 | } |
5493 | impl std::fmt::Display for AssocTypeArg { | 5493 | impl std::fmt::Display for AssocTypeArg { |
5494 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5494 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5495 | std::fmt::Display::fmt(self.syntax(), f) | 5495 | std::fmt::Display::fmt(self.syntax(), f) |
5496 | } | 5496 | } |
5497 | } | 5497 | } |
5498 | impl std::fmt::Display for LifetimeArg { | 5498 | impl std::fmt::Display for LifetimeArg { |
5499 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5499 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5500 | std::fmt::Display::fmt(self.syntax(), f) | 5500 | std::fmt::Display::fmt(self.syntax(), f) |
5501 | } | 5501 | } |
5502 | } | 5502 | } |
5503 | impl std::fmt::Display for ConstArg { | 5503 | impl std::fmt::Display for ConstArg { |
5504 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5504 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5505 | std::fmt::Display::fmt(self.syntax(), f) | 5505 | std::fmt::Display::fmt(self.syntax(), f) |
5506 | } | 5506 | } |
5507 | } | 5507 | } |
5508 | impl std::fmt::Display for MacroItems { | 5508 | impl std::fmt::Display for MacroItems { |
5509 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5509 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5510 | std::fmt::Display::fmt(self.syntax(), f) | 5510 | std::fmt::Display::fmt(self.syntax(), f) |
5511 | } | 5511 | } |
5512 | } | 5512 | } |
5513 | impl std::fmt::Display for MacroStmts { | 5513 | impl std::fmt::Display for MacroStmts { |
5514 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5514 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5515 | std::fmt::Display::fmt(self.syntax(), f) | 5515 | std::fmt::Display::fmt(self.syntax(), f) |
5516 | } | 5516 | } |
5517 | } | 5517 | } |
5518 | impl std::fmt::Display for ExternItemList { | 5518 | impl std::fmt::Display for ExternItemList { |
5519 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5519 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5520 | std::fmt::Display::fmt(self.syntax(), f) | 5520 | std::fmt::Display::fmt(self.syntax(), f) |
5521 | } | 5521 | } |
5522 | } | 5522 | } |
5523 | impl std::fmt::Display for ExternBlock { | 5523 | impl std::fmt::Display for ExternBlock { |
5524 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5524 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5525 | std::fmt::Display::fmt(self.syntax(), f) | 5525 | std::fmt::Display::fmt(self.syntax(), f) |
5526 | } | 5526 | } |
5527 | } | 5527 | } |
5528 | impl std::fmt::Display for MetaItem { | 5528 | impl std::fmt::Display for MetaItem { |
5529 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5529 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5530 | std::fmt::Display::fmt(self.syntax(), f) | 5530 | std::fmt::Display::fmt(self.syntax(), f) |
5531 | } | 5531 | } |
5532 | } | 5532 | } |
5533 | impl std::fmt::Display for MacroDef { | 5533 | impl std::fmt::Display for MacroDef { |
5534 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 5534 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
5535 | std::fmt::Display::fmt(self.syntax(), f) | 5535 | std::fmt::Display::fmt(self.syntax(), f) |
5536 | } | 5536 | } |
5537 | } | 5537 | } |
diff --git a/crates/ra_syntax/src/ast/generated/tokens.rs b/crates/ra_syntax/src/ast/generated/tokens.rs index f91befaac..abadd0b61 100644 --- a/crates/ra_syntax/src/ast/generated/tokens.rs +++ b/crates/ra_syntax/src/ast/generated/tokens.rs | |||
@@ -11,7 +11,7 @@ pub struct Whitespace { | |||
11 | pub(crate) syntax: SyntaxToken, | 11 | pub(crate) syntax: SyntaxToken, |
12 | } | 12 | } |
13 | impl std::fmt::Display for Whitespace { | 13 | impl std::fmt::Display for Whitespace { |
14 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 14 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
15 | std::fmt::Display::fmt(&self.syntax, f) | 15 | std::fmt::Display::fmt(&self.syntax, f) |
16 | } | 16 | } |
17 | } | 17 | } |
@@ -32,7 +32,7 @@ pub struct Comment { | |||
32 | pub(crate) syntax: SyntaxToken, | 32 | pub(crate) syntax: SyntaxToken, |
33 | } | 33 | } |
34 | impl std::fmt::Display for Comment { | 34 | impl std::fmt::Display for Comment { |
35 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 35 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
36 | std::fmt::Display::fmt(&self.syntax, f) | 36 | std::fmt::Display::fmt(&self.syntax, f) |
37 | } | 37 | } |
38 | } | 38 | } |
@@ -53,7 +53,7 @@ pub struct String { | |||
53 | pub(crate) syntax: SyntaxToken, | 53 | pub(crate) syntax: SyntaxToken, |
54 | } | 54 | } |
55 | impl std::fmt::Display for String { | 55 | impl std::fmt::Display for String { |
56 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 56 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
57 | std::fmt::Display::fmt(&self.syntax, f) | 57 | std::fmt::Display::fmt(&self.syntax, f) |
58 | } | 58 | } |
59 | } | 59 | } |
@@ -74,7 +74,7 @@ pub struct RawString { | |||
74 | pub(crate) syntax: SyntaxToken, | 74 | pub(crate) syntax: SyntaxToken, |
75 | } | 75 | } |
76 | impl std::fmt::Display for RawString { | 76 | impl std::fmt::Display for RawString { |
77 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | 77 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
78 | std::fmt::Display::fmt(&self.syntax, f) | 78 | std::fmt::Display::fmt(&self.syntax, f) |
79 | } | 79 | } |
80 | } | 80 | } |
diff --git a/crates/ra_syntax/src/ast/tokens.rs b/crates/ra_syntax/src/ast/tokens.rs index 56378385a..2e72d4927 100644 --- a/crates/ra_syntax/src/ast/tokens.rs +++ b/crates/ra_syntax/src/ast/tokens.rs | |||
@@ -84,7 +84,7 @@ impl Whitespace { | |||
84 | } | 84 | } |
85 | 85 | ||
86 | pub struct QuoteOffsets { | 86 | pub struct QuoteOffsets { |
87 | pub quotes: [TextRange; 2], | 87 | pub quotes: (TextRange, TextRange), |
88 | pub contents: TextRange, | 88 | pub contents: TextRange, |
89 | } | 89 | } |
90 | 90 | ||
@@ -103,7 +103,7 @@ impl QuoteOffsets { | |||
103 | let end = TextSize::of(literal); | 103 | let end = TextSize::of(literal); |
104 | 104 | ||
105 | let res = QuoteOffsets { | 105 | let res = QuoteOffsets { |
106 | quotes: [TextRange::new(start, left_quote), TextRange::new(right_quote, end)], | 106 | quotes: (TextRange::new(start, left_quote), TextRange::new(right_quote, end)), |
107 | contents: TextRange::new(left_quote, right_quote), | 107 | contents: TextRange::new(left_quote, right_quote), |
108 | }; | 108 | }; |
109 | Some(res) | 109 | Some(res) |
@@ -116,17 +116,17 @@ pub trait HasQuotes: AstToken { | |||
116 | let offsets = QuoteOffsets::new(text)?; | 116 | let offsets = QuoteOffsets::new(text)?; |
117 | let o = self.syntax().text_range().start(); | 117 | let o = self.syntax().text_range().start(); |
118 | let offsets = QuoteOffsets { | 118 | let offsets = QuoteOffsets { |
119 | quotes: [offsets.quotes[0] + o, offsets.quotes[1] + o], | 119 | quotes: (offsets.quotes.0 + o, offsets.quotes.1 + o), |
120 | contents: offsets.contents + o, | 120 | contents: offsets.contents + o, |
121 | }; | 121 | }; |
122 | Some(offsets) | 122 | Some(offsets) |
123 | } | 123 | } |
124 | fn open_quote_text_range(&self) -> Option<TextRange> { | 124 | fn open_quote_text_range(&self) -> Option<TextRange> { |
125 | self.quote_offsets().map(|it| it.quotes[0]) | 125 | self.quote_offsets().map(|it| it.quotes.0) |
126 | } | 126 | } |
127 | 127 | ||
128 | fn close_quote_text_range(&self) -> Option<TextRange> { | 128 | fn close_quote_text_range(&self) -> Option<TextRange> { |
129 | self.quote_offsets().map(|it| it.quotes[1]) | 129 | self.quote_offsets().map(|it| it.quotes.1) |
130 | } | 130 | } |
131 | 131 | ||
132 | fn text_range_between_quotes(&self) -> Option<TextRange> { | 132 | fn text_range_between_quotes(&self) -> Option<TextRange> { |