vxx2 / vlib / v / checker / tests / no_heap_struct.out
14 lines · 14 sloc · 602 bytes · 324edc6eabde255ab9bdc620a241c728618882e3
Raw
1vlib/v/checker/tests/no_heap_struct.vv:13:6: error: `x` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider declaring `Abc` as `@[heap]`.
2 11 | fn f(x &Abc) St {
3 12 | s := St{
4 13 | a: x
5 | ^
6 14 | }
7 15 | return s
8vlib/v/checker/tests/no_heap_struct.vv:23:7: error: `x` cannot be assigned outside `unsafe` blocks as it might refer to an object stored on stack. Consider declaring `Abc` as `@[heap]`.
9 21 |
10 22 | fn h(x &Abc) &Abc {
11 23 | y := x
12 | ^
13 24 | return y
14 25 | }
15