feat: 数组支持 struct 元素类型 [Point; N]

This commit is contained in:
2026-06-05 19:38:48 +08:00
parent beac40fd74
commit a45f7d8e2f
2 changed files with 22 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
struct Point { x: i64, y: i64 }
fn main() -> i64 {
let arr: [Point; 2] = arr;
arr[0] = Point { x: 10, y: 20 };
arr[1] = Point { x: 30, y: 40 };
print_i64(arr[0].x);
print_i64(arr[0].y);
print_i64(arr[1].x);
print_i64(arr[1].y);
return 0;
}