MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / array_index_read_write_and_address

Function array_index_read_write_and_address

tests/integration/hll_conformance.rs:70–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68"#,
69 42,
70 );
71}
72
73#[test]
74fn array_of_struct_element_place() {
75 // Indexing an array of structs yields an element place; selecting a field
76 // and taking &arr[i] both work without `@arr[i]`.
77 assert_exit(
78 r#"
79struct Point {
80 x: i32
81 y: i32
82}
83
84main: () -> i32 {
85 pts: Point[2] = [Point { .x = 1, .y = 2 }, Point { .x = 3, .y = 4 }]
86 pts[1].x = 36
87 first: Point* = &pts[0]

Callers

nothing calls this directly

Calls 1

assert_exitFunction · 0.85

Tested by

no test coverage detected