mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-07 11:04:17 +00:00
Add struct #no_copy
This commit is contained in:
@@ -326,7 +326,6 @@ gb_internal bool check_is_terminating(Ast *node, String const &label) {
|
||||
|
||||
|
||||
|
||||
|
||||
gb_internal Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, Operand *rhs) {
|
||||
if (rhs->mode == Addressing_Invalid) {
|
||||
return nullptr;
|
||||
@@ -339,6 +338,8 @@ gb_internal Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, O
|
||||
|
||||
Ast *node = unparen_expr(lhs->expr);
|
||||
|
||||
check_no_copy_assignment(*rhs, str_lit("assignment"));
|
||||
|
||||
// NOTE(bill): Ignore assignments to '_'
|
||||
if (is_blank_ident(node)) {
|
||||
check_assignment(ctx, rhs, nullptr, str_lit("assignment to '_' identifier"));
|
||||
@@ -400,6 +401,7 @@ gb_internal Type *check_assignment_variable(CheckerContext *ctx, Operand *lhs, O
|
||||
}
|
||||
|
||||
Type *assignment_type = lhs->type;
|
||||
|
||||
switch (lhs->mode) {
|
||||
case Addressing_Invalid:
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user