From 2870effd5c69941bbf32a44c0ee6d9d42e0b038d Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Tue, 25 Dec 2018 17:17:39 +0100 Subject: Implement reference / pointer types - parse them - infer types of & and * expressions --- crates/ra_syntax/src/ast/generated.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'crates/ra_syntax/src/ast') diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 6b2800a0e..535dcc975 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -2607,7 +2607,11 @@ impl> ParenTypeNode { } -impl<'a> ParenType<'a> {} +impl<'a> ParenType<'a> { + pub fn type_ref(self) -> Option> { + super::child_opt(self) + } +} // Pat #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -2972,7 +2976,11 @@ impl> PointerTypeNode { } -impl<'a> PointerType<'a> {} +impl<'a> PointerType<'a> { + pub fn type_ref(self) -> Option> { + super::child_opt(self) + } +} // PosField #[derive(Debug, Clone, Copy,)] @@ -3285,7 +3293,11 @@ impl> ReferenceTypeNode { } -impl<'a> ReferenceType<'a> {} +impl<'a> ReferenceType<'a> { + pub fn type_ref(self) -> Option> { + super::child_opt(self) + } +} // RetType #[derive(Debug, Clone, Copy,)] -- cgit v1.2.3