Remove #no_copy

This commit is contained in:
gingerBill
2025-11-05 13:44:14 +00:00
parent c937d38db2
commit fc2cb8fb39
7 changed files with 34 additions and 42 deletions

View File

@@ -1230,7 +1230,7 @@ gb_internal Ast *ast_dynamic_array_type(AstFile *f, Token token, Ast *elem) {
}
gb_internal Ast *ast_struct_type(AstFile *f, Token token, Slice<Ast *> fields, isize field_count,
Ast *polymorphic_params, bool is_packed, bool is_raw_union, bool is_no_copy, bool is_all_or_none,
Ast *polymorphic_params, bool is_packed, bool is_raw_union, bool is_all_or_none,
Ast *align, Ast *min_field_align, Ast *max_field_align,
Token where_token, Array<Ast *> const &where_clauses) {
Ast *result = alloc_ast_node(f, Ast_StructType);
@@ -1240,7 +1240,6 @@ gb_internal Ast *ast_struct_type(AstFile *f, Token token, Slice<Ast *> fields, i
result->StructType.polymorphic_params = polymorphic_params;
result->StructType.is_packed = is_packed;
result->StructType.is_raw_union = is_raw_union;
result->StructType.is_no_copy = is_no_copy;
result->StructType.is_all_or_none = is_all_or_none;
result->StructType.align = align;
result->StructType.min_field_align = min_field_align;
@@ -2776,7 +2775,6 @@ gb_internal Ast *parse_operand(AstFile *f, bool lhs) {
bool is_packed = false;
bool is_all_or_none = false;
bool is_raw_union = false;
bool no_copy = false;
Ast *align = nullptr;
Ast *min_field_align = nullptr;
Ast *max_field_align = nullptr;
@@ -2863,11 +2861,6 @@ gb_internal Ast *parse_operand(AstFile *f, bool lhs) {
syntax_error(tag, "Duplicate struct tag '#%.*s'", LIT(tag.string));
}
is_raw_union = true;
} else if (tag.string == "no_copy") {
if (no_copy) {
syntax_error(tag, "Duplicate struct tag '#%.*s'", LIT(tag.string));
}
no_copy = true;
} else {
syntax_error(tag, "Invalid struct tag '#%.*s'", LIT(tag.string));
}
@@ -2913,7 +2906,7 @@ gb_internal Ast *parse_operand(AstFile *f, bool lhs) {
parser_check_polymorphic_record_parameters(f, polymorphic_params);
return ast_struct_type(f, token, decls, name_count,
polymorphic_params, is_packed, is_raw_union, no_copy, is_all_or_none,
polymorphic_params, is_packed, is_raw_union, is_all_or_none,
align, min_field_align, max_field_align,
where_token, where_clauses);
} break;