diff options
author | John Hodge <tpg@mutabah.net> | 2016-05-22 13:49:45 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-05-22 13:49:45 +0800 |
commit | eba9d8f840a5b81f0188d109e63631c9a34c28e9 (patch) | |
tree | 84afcedb79bbe6fa8cb4098f78cd2b8e5dc700e9 /src/ast/provided_module.cpp | |
parent | 9a13dd6f999984c45c72eccd0f8ad35430c4b12e (diff) | |
download | mrust-eba9d8f840a5b81f0188d109e63631c9a34c28e9.tar.gz |
Clean up dead code (both useless code, and stuff that will be rewritten for HIR)
Diffstat (limited to 'src/ast/provided_module.cpp')
-rw-r--r-- | src/ast/provided_module.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/ast/provided_module.cpp b/src/ast/provided_module.cpp deleted file mode 100644 index e36784f0..00000000 --- a/src/ast/provided_module.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - */ -#include "ast.hpp" - -void AST_InitProvidedModule_Impls(); - -AST::Module g_compiler_module; -AST::Path g_copy_marker_path; -AST::Path g_sized_marker_path; - -void AST_InitProvidedModule() -{ - // "struct str([u8])" - ::std::vector<AST::StructItem> fields; - fields.push_back( AST::StructItem(AST::MetaItems(), false, "", TypeRef(TypeRef::TagUnsizedArray(), Span(), TypeRef(Span(), CORETYPE_U8))) ); - g_compiler_module.add_struct(true, "str", AST::Struct(AST::GenericParams(), mv$(fields)), AST::MetaItems()); - - AST_InitProvidedModule_Impls(); -} - -void AST_InitProvidedModule_Impls() -{ - if( !g_copy_marker_path.is_valid() ) { - g_copy_marker_path = AST::Path( "", {AST::PathNode("marker"),AST::PathNode("Copy")} ); - } - - if( !g_sized_marker_path.is_valid() ) { - g_sized_marker_path = AST::Path( "", {AST::PathNode("marker"),AST::PathNode("Sized")} ); - } - - #define impl(trait, type) \ - g_compiler_module.add_impl(AST::Impl(AST::MetaItems(), AST::GenericParams(), type, trait)) - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_U8)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_U16)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_U32)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_U64)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_UINT)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_I8)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_I16)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_I32)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_I64)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_INT)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_F32)); - impl(g_copy_marker_path, TypeRef(Span(), CORETYPE_F64)); - - // A hacky default impl of 'Sized', with a negative impl on [T] - impl(g_sized_marker_path, TypeRef()); - - { - AST::GenericParams tps; - tps.add_ty_param( AST::TypeParam("T") ); - g_compiler_module.add_neg_impl(AST::ImplDef( - AST::MetaItems(), ::std::move(tps), - g_sized_marker_path, - TypeRef(TypeRef::TagUnsizedArray(), Span(), TypeRef(TypeRef::TagArg(), "T")) - )); - } -} - |