diff options
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index f65e1fd..a592e35 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -18,6 +18,7 @@ #include "rust-compile.h" #include "rust-compile-item.h" +#include "rust-compile-implitem.h" #include "rust-compile-expr.h" #include "rust-compile-struct-field-expr.h" #include "rust-hir-trait-resolve.h" @@ -204,7 +205,7 @@ CompileExpr::visit (HIR::MatchExpr &expr) expr.get_scrutinee_expr ()->get_mappings ().get_hirid (), &scrutinee_expr_tyty)) { - translated = ctx->get_backend ()->error_expression (); + translated = error_mark_node; return; } @@ -220,7 +221,7 @@ CompileExpr::visit (HIR::MatchExpr &expr) if (!ctx->get_tyctx ()->lookup_type (expr.get_mappings ().get_hirid (), &expr_tyty)) { - translated = ctx->get_backend ()->error_expression (); + translated = error_mark_node; return; } @@ -643,7 +644,7 @@ CompileExpr::compile_dyn_dispatch_call (const TyTy::DynamicObjectType *dyn, } if (ref == nullptr) - return ctx->get_backend ()->error_expression (); + return error_mark_node; // get any indirection sorted out if (receiver->get_kind () == TyTy::TypeKind::REF) @@ -713,7 +714,7 @@ CompileExpr::resolve_method_address (TyTy::FnType *fntype, HirId ref, tree fn = NULL_TREE; if (ctx->lookup_function_decl (fntype->get_ty_ref (), &fn)) { - return ctx->get_backend ()->function_code_expression (fn, expr_locus); + return address_expression (fn, expr_locus); } // Now we can try and resolve the address since this might be a forward @@ -765,8 +766,7 @@ CompileExpr::resolve_method_address (TyTy::FnType *fntype, HirId ref, // contain an implementation we should actually return // error_mark_node - return CompileTraitItem::Compile (receiver, - trait_item_ref->get_hir_trait_item (), + return CompileTraitItem::Compile (trait_item_ref->get_hir_trait_item (), ctx, fntype, true, expr_locus); } else @@ -1343,8 +1343,7 @@ CompileExpr::visit (HIR::IdentifierExpr &expr) } else if (ctx->lookup_function_decl (ref, &fn)) { - translated - = ctx->get_backend ()->function_code_expression (fn, expr.get_locus ()); + translated = address_expression (fn, expr.get_locus ()); } else if (ctx->lookup_var_decl (ref, &var)) { |