Dyn type
This commit is contained in:
@@ -26,6 +26,7 @@ pub enum TypePostfix {
|
||||
RefMut,
|
||||
RefLifetime(Identifier),
|
||||
RefMutLifetime(Identifier),
|
||||
Dyn,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
|
||||
@@ -85,8 +85,12 @@ ref_type = {
|
||||
mutable? ~ lifetime? ~ "*"
|
||||
}
|
||||
|
||||
dyn_type = {
|
||||
"dyn"
|
||||
}
|
||||
|
||||
type_expr = {
|
||||
(path_type | tuple_type) ~ ref_type*
|
||||
(path_type | tuple_type) ~ (ref_type | dyn_type)*
|
||||
}
|
||||
|
||||
lifetime = {
|
||||
|
||||
@@ -36,6 +36,8 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for TypePostfix {
|
||||
})
|
||||
}
|
||||
|
||||
Rule::dyn_type => Ok(TypePostfix::Dyn),
|
||||
|
||||
_ => AstError::bug_unimplemented(pair),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user