summaryrefslogtreecommitdiff
path: root/src/hir/from_ast.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-08-01 18:21:01 +0800
committerJohn Hodge <tpg@mutabah.net>2018-08-01 18:21:01 +0800
commita88d64cbbaeaeb2725259f318f7758ae7a7a91b0 (patch)
tree8150a7e15b1de59edefc2bdfcae0a121ea811ce8 /src/hir/from_ast.cpp
parentc971a6fa8375598ecf9c99ee6b086e8cf957f568 (diff)
downloadmrust-a88d64cbbaeaeb2725259f318f7758ae7a7a91b0.tar.gz
HIR - Conversion and typecheck fixes for 1.29
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r--src/hir/from_ast.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp
index 5dbf9c03..9c8f34f6 100644
--- a/src/hir/from_ast.cpp
+++ b/src/hir/from_ast.cpp
@@ -1258,6 +1258,21 @@ namespace {
receiver = ::HIR::Function::Receiver::Box;
}
}
+ // TODO: for other types, support arbitary structs/paths.
+ // - The path must include Self as a (the only?) type param.
+ if( receiver == ::HIR::Function::Receiver::Free )
+ {
+ if( pe.m_params.m_types.size() == 0 ) {
+ ERROR(sp, E0000, "Unsupported receiver type - " << arg_self_ty);
+ }
+ if( pe.m_params.m_types.size() != 1 ) {
+ TODO(sp, "Receiver types with more than one param - " << arg_self_ty);
+ }
+ if( pe.m_params.m_types[0] != self_type ) {
+ ERROR(sp, E0000, "Unsupported receiver type - " << arg_self_ty);
+ }
+ receiver = ::HIR::Function::Receiver::Custom;
+ }
)
)
else {