summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ast/expr.cpp4
-rw-r--r--src/expand/lang_item.cpp23
-rw-r--r--src/types.cpp4
3 files changed, 24 insertions, 7 deletions
diff --git a/src/ast/expr.cpp b/src/ast/expr.cpp
index 0c40c741..49ebdbe2 100644
--- a/src/ast/expr.cpp
+++ b/src/ast/expr.cpp
@@ -510,7 +510,7 @@ NV(ExprNode_Block, {
})
NV(ExprNode_Macro,
{
- DEBUG("TODO: Macro");
+ BUG(node.get_pos(), "Hit unexpanded macro in expression");
})
NV(ExprNode_Flow,
{
@@ -518,7 +518,7 @@ NV(ExprNode_Flow,
})
NV(ExprNode_LetBinding,
{
- // TODO: Handle recurse into Let pattern
+ // TODO: Handle recurse into Let pattern?
visit(node.m_value);
})
NV(ExprNode_Assign,
diff --git a/src/expand/lang_item.cpp b/src/expand/lang_item.cpp
index 3df3a54f..a86cdd62 100644
--- a/src/expand/lang_item.cpp
+++ b/src/expand/lang_item.cpp
@@ -74,6 +74,21 @@ void handle_lang_item(AST::Crate& crate, const AST::Path& path, const ::std::str
else if( name == "debug_trait" ) { /* TODO: Poke derive() with this */ }
+ // Structs
+ else if( name == "non_zero" ) { }
+ else if( name == "phantom_data" ) { }
+ else if( name == "range_full" ) { }
+ else if( name == "range" ) { }
+ else if( name == "range_from" ) { }
+ else if( name == "range_to" ) { }
+ else if( name == "unsafe_cell" ) { }
+
+ // Functions
+ else if( name == "panic" ) { }
+ else if( name == "panic_bounds_check" ) { }
+ else if( name == "panic_fmt" ) { }
+ else if( name == "str_eq" ) { }
+
else {
throw CompileError::Generic(FMT("Unknown lang item '" << name << "'"));
}
@@ -90,7 +105,13 @@ public:
{
TU_MATCH_DEF(::AST::Item, (i), (e),
(
- // TODO: Error
+ TODO(Span(), "Unknown item type with #[lang] attached at " << path);
+ ),
+ (Function,
+ handle_lang_item(crate, path, attr.string(), AST::ITEM_FN);
+ ),
+ (Struct,
+ handle_lang_item(crate, path, attr.string(), AST::ITEM_STRUCT);
),
(Trait,
handle_lang_item(crate, path, attr.string(), AST::ITEM_TRAIT);
diff --git a/src/types.cpp b/src/types.cpp
index e5dee127..845af9d2 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -448,7 +448,6 @@ bool TypeRef::impls_wildcard(const AST::Crate& crate, const AST::Path& trait) co
auto fld_ty = fld.m_type;
fld_ty.resolve_args( resolve_fn );
DEBUG("- Fld '" << fld.m_name << "' := " << fld.m_type << " => " << fld_ty);
- // TODO: Defer failure until after all fields are processed
if( !crate.find_impl(trait, fld_ty, nullptr, nullptr) )
return false;
}
@@ -459,7 +458,6 @@ bool TypeRef::impls_wildcard(const AST::Crate& crate, const AST::Path& trait) co
auto fld_ty = fld.m_type;
fld_ty.resolve_args( resolve_fn );
DEBUG("- Fld ? := " << fld.m_type << " => " << fld_ty);
- // TODO: Defer failure until after all fields are processed
if( !crate.find_impl(trait, fld_ty, nullptr, nullptr) )
return false;
}
@@ -481,7 +479,6 @@ bool TypeRef::impls_wildcard(const AST::Crate& crate, const AST::Path& trait) co
TypeRef real_ty = ty;
real_ty.resolve_args( resolve_fn );
DEBUG("- Var '" << var.m_name << "' := " << ty << " => " << real_ty);
- // TODO: Defer failure until after all fields are processed
if( !crate.find_impl(trait, real_ty, nullptr, nullptr) )
return false;
}
@@ -492,7 +489,6 @@ bool TypeRef::impls_wildcard(const AST::Crate& crate, const AST::Path& trait) co
auto fld_ty = fld.m_type;
fld_ty.resolve_args( resolve_fn );
DEBUG("- Fld '" << fld.m_name << "' := " << fld.m_type << " => " << fld_ty);
- // TODO: Defer failure until after all fields are processed
if( !crate.find_impl(trait, fld_ty, nullptr, nullptr) )
return false;
}