vq / vlib / v / checker / tests / warnings_for_string_c2v_calls.out
14 lines · 14 sloc · 656 bytes · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1vlib/v/checker/tests/warnings_for_string_c2v_calls.vv:8:7: error: to convert a C string buffer pointer to a V string, use x.vstring() instead of string(x)
2 6 | p[2] = `z`
3 7 | }
4 8 | x := string(p)
5 | ~~~~~~~~~
6 9 | eprintln('x: ${x}')
7 10 | eprintln('x.len: ${x.len}')
8vlib/v/checker/tests/warnings_for_string_c2v_calls.vv:8:7: error: cannot cast pointer type `&u8` to string, use `&u8(p).vstring()` or `cstring_to_vstring(p)` instead.
9 6 | p[2] = `z`
10 7 | }
11 8 | x := string(p)
12 | ~~~~~~~~~
13 9 | eprintln('x: ${x}')
14 10 | eprintln('x.len: ${x.len}')
15