Rename TypeRef -> Type

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.
This commit is contained in:
Aleksey Kladov
2020-07-31 12:06:38 +02:00
parent e0f21133cd
commit 08ea2271e8
19 changed files with 209 additions and 203 deletions

View File

@@ -287,7 +287,7 @@ where
assert!(pred.for_token().is_none());
assert!(pred.generic_param_list().is_none());
assert_eq!("T", pred.type_ref().unwrap().syntax().text().to_string());
assert_eq!("T", pred.ty().unwrap().syntax().text().to_string());
assert_bound("Clone", bounds.next());
assert_bound("Copy", bounds.next());
assert_bound("Debug", bounds.next());
@@ -304,20 +304,20 @@ where
let pred = predicates.next().unwrap();
let mut bounds = pred.type_bound_list().unwrap().bounds();
assert_eq!("Iterator::Item", pred.type_ref().unwrap().syntax().text().to_string());
assert_eq!("Iterator::Item", pred.ty().unwrap().syntax().text().to_string());
assert_bound("'a", bounds.next());
let pred = predicates.next().unwrap();
let mut bounds = pred.type_bound_list().unwrap().bounds();
assert_eq!("Iterator::Item", pred.type_ref().unwrap().syntax().text().to_string());
assert_eq!("Iterator::Item", pred.ty().unwrap().syntax().text().to_string());
assert_bound("Debug", bounds.next());
assert_bound("'a", bounds.next());
let pred = predicates.next().unwrap();
let mut bounds = pred.type_bound_list().unwrap().bounds();
assert_eq!("<T as Iterator>::Item", pred.type_ref().unwrap().syntax().text().to_string());
assert_eq!("<T as Iterator>::Item", pred.ty().unwrap().syntax().text().to_string());
assert_bound("Debug", bounds.next());
assert_bound("'a", bounds.next());
@@ -326,6 +326,6 @@ where
assert!(pred.for_token().is_some());
assert_eq!("<'a>", pred.generic_param_list().unwrap().syntax().text().to_string());
assert_eq!("F", pred.type_ref().unwrap().syntax().text().to_string());
assert_eq!("F", pred.ty().unwrap().syntax().text().to_string());
assert_bound("Fn(&'a str)", bounds.next());
}