aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-31 11:18:53 +0100
committerGitHub <[email protected]>2020-07-31 11:18:53 +0100
commit683d0a4d93c29c988c40c001a4b574d8f0dcb9c6 (patch)
tree1d5bb4ce799c6377b49ae73436d50a087db53392 /crates/ra_syntax/src/ast.rs
parent6b7cb8b5ab539fc4333ce34bc29bf77c976f232a (diff)
parent08ea2271e8050165d0aaf4c994ed3dd746aff3ba (diff)
Merge #5618
5618: Rename TypeRef -> Type r=matklad a=matklad The TypeRef name comes from IntelliJ days, where you often have both type *syntax* as well as *semantical* representation of types in scope. And naming both Type is confusing. In rust-analyzer however, we use ast types as `ast::Type`, and have many more semantic counterparts to ast types, so avoiding name clash here is just confusing. bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r--crates/ra_syntax/src/ast.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index fd426ece9..8a0e3d27b 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -287,7 +287,7 @@ where
287 287
288 assert!(pred.for_token().is_none()); 288 assert!(pred.for_token().is_none());
289 assert!(pred.generic_param_list().is_none()); 289 assert!(pred.generic_param_list().is_none());
290 assert_eq!("T", pred.type_ref().unwrap().syntax().text().to_string()); 290 assert_eq!("T", pred.ty().unwrap().syntax().text().to_string());
291 assert_bound("Clone", bounds.next()); 291 assert_bound("Clone", bounds.next());
292 assert_bound("Copy", bounds.next()); 292 assert_bound("Copy", bounds.next());
293 assert_bound("Debug", bounds.next()); 293 assert_bound("Debug", bounds.next());
@@ -304,20 +304,20 @@ where
304 let pred = predicates.next().unwrap(); 304 let pred = predicates.next().unwrap();
305 let mut bounds = pred.type_bound_list().unwrap().bounds(); 305 let mut bounds = pred.type_bound_list().unwrap().bounds();
306 306
307 assert_eq!("Iterator::Item", pred.type_ref().unwrap().syntax().text().to_string()); 307 assert_eq!("Iterator::Item", pred.ty().unwrap().syntax().text().to_string());
308 assert_bound("'a", bounds.next()); 308 assert_bound("'a", bounds.next());
309 309
310 let pred = predicates.next().unwrap(); 310 let pred = predicates.next().unwrap();
311 let mut bounds = pred.type_bound_list().unwrap().bounds(); 311 let mut bounds = pred.type_bound_list().unwrap().bounds();
312 312
313 assert_eq!("Iterator::Item", pred.type_ref().unwrap().syntax().text().to_string()); 313 assert_eq!("Iterator::Item", pred.ty().unwrap().syntax().text().to_string());
314 assert_bound("Debug", bounds.next()); 314 assert_bound("Debug", bounds.next());
315 assert_bound("'a", bounds.next()); 315 assert_bound("'a", bounds.next());
316 316
317 let pred = predicates.next().unwrap(); 317 let pred = predicates.next().unwrap();
318 let mut bounds = pred.type_bound_list().unwrap().bounds(); 318 let mut bounds = pred.type_bound_list().unwrap().bounds();
319 319
320 assert_eq!("<T as Iterator>::Item", pred.type_ref().unwrap().syntax().text().to_string()); 320 assert_eq!("<T as Iterator>::Item", pred.ty().unwrap().syntax().text().to_string());
321 assert_bound("Debug", bounds.next()); 321 assert_bound("Debug", bounds.next());
322 assert_bound("'a", bounds.next()); 322 assert_bound("'a", bounds.next());
323 323
@@ -326,6 +326,6 @@ where
326 326
327 assert!(pred.for_token().is_some()); 327 assert!(pred.for_token().is_some());
328 assert_eq!("<'a>", pred.generic_param_list().unwrap().syntax().text().to_string()); 328 assert_eq!("<'a>", pred.generic_param_list().unwrap().syntax().text().to_string());
329 assert_eq!("F", pred.type_ref().unwrap().syntax().text().to_string()); 329 assert_eq!("F", pred.ty().unwrap().syntax().text().to_string());
330 assert_bound("Fn(&'a str)", bounds.next()); 330 assert_bound("Fn(&'a str)", bounds.next());
331} 331}