aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/ast/generated/nodes.rs22
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast2
-rw-r--r--crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast4
4 files changed, 15 insertions, 15 deletions
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs
index 9cfd5d017..465cb3202 100644
--- a/crates/ra_syntax/src/ast/generated/nodes.rs
+++ b/crates/ra_syntax/src/ast/generated/nodes.rs
@@ -594,10 +594,10 @@ impl ReferenceType {
594 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) } 594 pub fn ty(&self) -> Option<Type> { support::child(&self.syntax) }
595} 595}
596#[derive(Debug, Clone, PartialEq, Eq, Hash)] 596#[derive(Debug, Clone, PartialEq, Eq, Hash)]
597pub struct PlaceholderType { 597pub struct InferType {
598 pub(crate) syntax: SyntaxNode, 598 pub(crate) syntax: SyntaxNode,
599} 599}
600impl PlaceholderType { 600impl InferType {
601 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) } 601 pub fn underscore_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![_]) }
602} 602}
603#[derive(Debug, Clone, PartialEq, Eq, Hash)] 603#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -1291,7 +1291,7 @@ pub enum Type {
1291 ArrayType(ArrayType), 1291 ArrayType(ArrayType),
1292 SliceType(SliceType), 1292 SliceType(SliceType),
1293 ReferenceType(ReferenceType), 1293 ReferenceType(ReferenceType),
1294 PlaceholderType(PlaceholderType), 1294 InferType(InferType),
1295 FnPointerType(FnPointerType), 1295 FnPointerType(FnPointerType),
1296 ForType(ForType), 1296 ForType(ForType),
1297 ImplTraitType(ImplTraitType), 1297 ImplTraitType(ImplTraitType),
@@ -1988,8 +1988,8 @@ impl AstNode for ReferenceType {
1988 } 1988 }
1989 fn syntax(&self) -> &SyntaxNode { &self.syntax } 1989 fn syntax(&self) -> &SyntaxNode { &self.syntax }
1990} 1990}
1991impl AstNode for PlaceholderType { 1991impl AstNode for InferType {
1992 fn can_cast(kind: SyntaxKind) -> bool { kind == PLACEHOLDER_TYPE } 1992 fn can_cast(kind: SyntaxKind) -> bool { kind == INFER_TYPE }
1993 fn cast(syntax: SyntaxNode) -> Option<Self> { 1993 fn cast(syntax: SyntaxNode) -> Option<Self> {
1994 if Self::can_cast(syntax.kind()) { 1994 if Self::can_cast(syntax.kind()) {
1995 Some(Self { syntax }) 1995 Some(Self { syntax })
@@ -2871,8 +2871,8 @@ impl From<SliceType> for Type {
2871impl From<ReferenceType> for Type { 2871impl From<ReferenceType> for Type {
2872 fn from(node: ReferenceType) -> Type { Type::ReferenceType(node) } 2872 fn from(node: ReferenceType) -> Type { Type::ReferenceType(node) }
2873} 2873}
2874impl From<PlaceholderType> for Type { 2874impl From<InferType> for Type {
2875 fn from(node: PlaceholderType) -> Type { Type::PlaceholderType(node) } 2875 fn from(node: InferType) -> Type { Type::InferType(node) }
2876} 2876}
2877impl From<FnPointerType> for Type { 2877impl From<FnPointerType> for Type {
2878 fn from(node: FnPointerType) -> Type { Type::FnPointerType(node) } 2878 fn from(node: FnPointerType) -> Type { Type::FnPointerType(node) }
@@ -2890,7 +2890,7 @@ impl AstNode for Type {
2890 fn can_cast(kind: SyntaxKind) -> bool { 2890 fn can_cast(kind: SyntaxKind) -> bool {
2891 match kind { 2891 match kind {
2892 PAREN_TYPE | TUPLE_TYPE | NEVER_TYPE | PATH_TYPE | POINTER_TYPE | ARRAY_TYPE 2892 PAREN_TYPE | TUPLE_TYPE | NEVER_TYPE | PATH_TYPE | POINTER_TYPE | ARRAY_TYPE
2893 | SLICE_TYPE | REFERENCE_TYPE | PLACEHOLDER_TYPE | FN_POINTER_TYPE | FOR_TYPE 2893 | SLICE_TYPE | REFERENCE_TYPE | INFER_TYPE | FN_POINTER_TYPE | FOR_TYPE
2894 | IMPL_TRAIT_TYPE | DYN_TRAIT_TYPE => true, 2894 | IMPL_TRAIT_TYPE | DYN_TRAIT_TYPE => true,
2895 _ => false, 2895 _ => false,
2896 } 2896 }
@@ -2905,7 +2905,7 @@ impl AstNode for Type {
2905 ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }), 2905 ARRAY_TYPE => Type::ArrayType(ArrayType { syntax }),
2906 SLICE_TYPE => Type::SliceType(SliceType { syntax }), 2906 SLICE_TYPE => Type::SliceType(SliceType { syntax }),
2907 REFERENCE_TYPE => Type::ReferenceType(ReferenceType { syntax }), 2907 REFERENCE_TYPE => Type::ReferenceType(ReferenceType { syntax }),
2908 PLACEHOLDER_TYPE => Type::PlaceholderType(PlaceholderType { syntax }), 2908 INFER_TYPE => Type::InferType(InferType { syntax }),
2909 FN_POINTER_TYPE => Type::FnPointerType(FnPointerType { syntax }), 2909 FN_POINTER_TYPE => Type::FnPointerType(FnPointerType { syntax }),
2910 FOR_TYPE => Type::ForType(ForType { syntax }), 2910 FOR_TYPE => Type::ForType(ForType { syntax }),
2911 IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }), 2911 IMPL_TRAIT_TYPE => Type::ImplTraitType(ImplTraitType { syntax }),
@@ -2924,7 +2924,7 @@ impl AstNode for Type {
2924 Type::ArrayType(it) => &it.syntax, 2924 Type::ArrayType(it) => &it.syntax,
2925 Type::SliceType(it) => &it.syntax, 2925 Type::SliceType(it) => &it.syntax,
2926 Type::ReferenceType(it) => &it.syntax, 2926 Type::ReferenceType(it) => &it.syntax,
2927 Type::PlaceholderType(it) => &it.syntax, 2927 Type::InferType(it) => &it.syntax,
2928 Type::FnPointerType(it) => &it.syntax, 2928 Type::FnPointerType(it) => &it.syntax,
2929 Type::ForType(it) => &it.syntax, 2929 Type::ForType(it) => &it.syntax,
2930 Type::ImplTraitType(it) => &it.syntax, 2930 Type::ImplTraitType(it) => &it.syntax,
@@ -3719,7 +3719,7 @@ impl std::fmt::Display for ReferenceType {
3719 std::fmt::Display::fmt(self.syntax(), f) 3719 std::fmt::Display::fmt(self.syntax(), f)
3720 } 3720 }
3721} 3721}
3722impl std::fmt::Display for PlaceholderType { 3722impl std::fmt::Display for InferType {
3723 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 3723 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3724 std::fmt::Display::fmt(self.syntax(), f) 3724 std::fmt::Display::fmt(self.syntax(), f)
3725 } 3725 }
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast
index 57008e5fe..e4fe2b948 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0023_placeholder_type.rast
@@ -7,7 +7,7 @@ [email protected]
7 [email protected] " " 7 [email protected] " "
8 [email protected] "=" 8 [email protected] "="
9 [email protected] " " 9 [email protected] " "
10 PLACEHOLDE[email protected] 10 INF[email protected]
11 [email protected] "_" 11 [email protected] "_"
12 [email protected] ";" 12 [email protected] ";"
13 [email protected] "\n" 13 [email protected] "\n"
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast b/crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast
index f5e20b93d..f8910677b 100644
--- a/crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast
+++ b/crates/ra_syntax/test_data/parser/inline/ok/0164_type_path_in_pattern.rast
@@ -19,7 +19,7 @@ [email protected]
19 [email protected] 19 [email protected]
20 [email protected] 20 [email protected]
21 [email protected] "<" 21 [email protected] "<"
22 PLACEHOLDE[email protected] 22 INF[email protected]
23 [email protected] "_" 23 [email protected] "_"
24 [email protected] ">" 24 [email protected] ">"
25 [email protected] "::" 25 [email protected] "::"
diff --git a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast
index b04a505ea..66cd5727a 100644
--- a/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast
+++ b/crates/ra_syntax/test_data/parser/ok/0035_weird_exprs.rast
@@ -1640,10 +1640,10 @@ [email protected]
1640 [email protected] ":" 1640 [email protected] ":"
1641 [email protected] 1641 [email protected]
1642 [email protected] "(" 1642 [email protected] "("
1643 PLACEHOLDE[email protected] 1643 INF[email protected]
1644 [email protected] "_" 1644 [email protected] "_"
1645 [email protected] "," 1645 [email protected] ","
1646 PLACEHOLDE[email protected] 1646 INF[email protected]
1647 [email protected] "_" 1647 [email protected] "_"
1648 [email protected] ")" 1648 [email protected] ")"
1649 [email protected] "," 1649 [email protected] ","