summaryrefslogtreecommitdiff
path: root/src/ast
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-10-06 08:09:45 +0800
committerJohn Hodge <tpg@mutabah.net>2016-10-06 08:09:45 +0800
commit8c4c592c977833ac41defcf78463b811ae14e1ca (patch)
tree698ebf9a1a25d949cd376aa54af1b8d1a899999b /src/ast
parented32a6680af7731b647962ee8cbb94cbcc3b9fa1 (diff)
downloadmrust-8c4c592c977833ac41defcf78463b811ae14e1ca.tar.gz
Parse - Save unsafety for function pointer types
Diffstat (limited to 'src/ast')
-rw-r--r--src/ast/types.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ast/types.hpp b/src/ast/types.hpp
index e35c178f..e0cede23 100644
--- a/src/ast/types.hpp
+++ b/src/ast/types.hpp
@@ -41,13 +41,15 @@ struct Type_Function
::std::string m_abi;
::std::unique_ptr<TypeRef> m_rettype;
::std::vector<TypeRef> m_arg_types;
+ bool is_variadic;
Type_Function() {}
- Type_Function(bool is_unsafe, ::std::string abi, ::std::unique_ptr<TypeRef> ret, ::std::vector<TypeRef> args):
+ Type_Function(bool is_unsafe, ::std::string abi, ::std::unique_ptr<TypeRef> ret, ::std::vector<TypeRef> args, bool is_variadic):
is_unsafe(is_unsafe),
m_abi(mv$(abi)),
m_rettype(mv$(ret)),
- m_arg_types(mv$(args))
+ m_arg_types(mv$(args)),
+ is_variadic(is_variadic)
{}
Type_Function(Type_Function&& other) = default;
Type_Function(const Type_Function& other);
@@ -166,9 +168,9 @@ public:
m_data(TypeData::make_Tuple({::std::move(inner_types)}))
{}
struct TagFunction {};
- TypeRef(TagFunction, Span sp, ::std::string abi, ::std::vector<TypeRef> args, TypeRef ret):
+ TypeRef(TagFunction, Span sp, bool is_unsafe, ::std::string abi, ::std::vector<TypeRef> args, bool is_variadic, TypeRef ret):
m_span(mv$(sp)),
- m_data(TypeData::make_Function({ Type_Function( false, abi, box$(ret), mv$(args) ) }))
+ m_data(TypeData::make_Function({ Type_Function( is_unsafe, abi, box$(ret), mv$(args), is_variadic ) }))
{}
struct TagReference {};