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

Function inferred_struct_pointer_binding

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

Source from the content-addressed store, hash-verified

146 named := Point { .y = 2, .x = 1 }
147 contextual: Point = { .x = 3, .y = 4 }
148 return named.x + named.y + contextual.x + contextual.y
149}
150"#,
151 10,
152 );
153}
154
155#[test]
156fn contextual_literal_zero_fills() {
157 // Omitted fields in an anonymous literal default to zero at runtime.
158 assert_exit(
159 r#"
160struct Point {
161 x: i32
162 y: i32
163}
164
165main: () -> i32 {
166 point: Point = { .x = 7, .. }
167 return point.x + point.y

Callers

nothing calls this directly

Calls 1

assert_exitFunction · 0.85

Tested by

no test coverage detected