vxx2 / vlib / v / checker / tests / disallow_pointer_arithmetic_err.out
48 lines · 48 sloc · 2.44 KB · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1vlib/v/checker/tests/disallow_pointer_arithmetic_err.vv:7:7: warning: pointer arithmetic is only allowed in `unsafe` blocks
2 5 | _ := p * p // should be error
3 6 | _ := p * 2 // should be error
4 7 | _ := p + 5 // OK but only in unsafe block, r is *int
5 | ~~~~~
6 8 | _ := p - p // OK even in safe code, but n should be isize
7 9 | }
8vlib/v/checker/tests/disallow_pointer_arithmetic_err.vv:8:7: warning: pointer arithmetic is only allowed in `unsafe` blocks
9 6 | _ := p * 2 // should be error
10 7 | _ := p + 5 // OK but only in unsafe block, r is *int
11 8 | _ := p - p // OK even in safe code, but n should be isize
12 | ~~~~~
13 9 | }
14vlib/v/checker/tests/disallow_pointer_arithmetic_err.vv:4:7: error: invalid operator `+` to `&int` and `&int`
15 2 | x := 5
16 3 | p := &x
17 4 | _ := p + p // should be error
18 | ~~~~~
19 5 | _ := p * p // should be error
20 6 | _ := p * 2 // should be error
21vlib/v/checker/tests/disallow_pointer_arithmetic_err.vv:5:7: error: invalid operator `*` to `&int` and `&int`
22 3 | p := &x
23 4 | _ := p + p // should be error
24 5 | _ := p * p // should be error
25 | ~~~~~
26 6 | _ := p * 2 // should be error
27 7 | _ := p + 5 // OK but only in unsafe block, r is *int
28vlib/v/checker/tests/disallow_pointer_arithmetic_err.vv:5:7: error: infix `*` is not defined for pointer values
29 3 | p := &x
30 4 | _ := p + p // should be error
31 5 | _ := p * p // should be error
32 | ~~~~~
33 6 | _ := p * 2 // should be error
34 7 | _ := p + 5 // OK but only in unsafe block, r is *int
35vlib/v/checker/tests/disallow_pointer_arithmetic_err.vv:6:7: error: invalid operator `*` to `&int` and `int literal`
36 4 | _ := p + p // should be error
37 5 | _ := p * p // should be error
38 6 | _ := p * 2 // should be error
39 | ~~~~~
40 7 | _ := p + 5 // OK but only in unsafe block, r is *int
41 8 | _ := p - p // OK even in safe code, but n should be isize
42vlib/v/checker/tests/disallow_pointer_arithmetic_err.vv:6:7: error: infix `*` is not defined for pointer values
43 4 | _ := p + p // should be error
44 5 | _ := p * p // should be error
45 6 | _ := p * 2 // should be error
46 | ~~~~~
47 7 | _ := p + 5 // OK but only in unsafe block, r is *int
48 8 | _ := p - p // OK even in safe code, but n should be isize
49