tests: fix compiler_errors_test.v

pull/5983/head
Alexander Medvednikov 2020-07-25 22:20:07 +02:00
parent 6fcc6cdc75
commit 6796b93abd
2 changed files with 10 additions and 10 deletions

View File

@ -1,5 +1,5 @@
vlib/v/checker/tests/unsafe_pointer_arithmetic_should_be_checked.v:4:6: error: pointer arithmetic is only allowed in `unsafe` blocks
2 | v := 5
2 | mut v := 5
3 | mut p := &v
4 | p++
| ~~

View File

@ -1,46 +1,46 @@
vlib/v/checker/tests/unsafe_required.v:4:6: error: pointer arithmetic is only allowed in `unsafe` blocks
2 | v := 5
vlib/v/checker/tests/unsafe_required.v:4:6: error: pointer arithmetic is only allowed in `unsafe` blocks
2 | mut v := 5
3 | mut p := &v
4 | p++
| ~~
5 | p += 2
6 | _ := v
vlib/v/checker/tests/unsafe_required.v:5:7: error: pointer arithmetic is only allowed in `unsafe` blocks
vlib/v/checker/tests/unsafe_required.v:5:7: error: pointer arithmetic is only allowed in `unsafe` blocks
3 | mut p := &v
4 | p++
5 | p += 2
| ~~
6 | _ := v
7 | }
vlib/v/checker/tests/unsafe_required.v:11:14: error: pointer arithmetic is only allowed in `unsafe` blocks
vlib/v/checker/tests/unsafe_required.v:11:14: error: pointer arithmetic is only allowed in `unsafe` blocks
9 | fn test_ptr_infix() {
10 | v := 4
11 | mut q := &v - 1
| ^
12 | q = q + 3
13 | _ := q
vlib/v/checker/tests/unsafe_required.v:12:9: error: pointer arithmetic is only allowed in `unsafe` blocks
vlib/v/checker/tests/unsafe_required.v:12:9: error: pointer arithmetic is only allowed in `unsafe` blocks
10 | v := 4
11 | mut q := &v - 1
12 | q = q + 3
| ^
13 | _ := q
14 | _ := v
vlib/v/checker/tests/unsafe_required.v:24:7: error: method `S1.f` must be called from an `unsafe` block
vlib/v/checker/tests/unsafe_required.v:24:7: error: method `S1.f` must be called from an `unsafe` block
22 | fn test_funcs() {
23 | s := S1{}
24 | s.f()
| ~~~
25 | }
26 |
vlib/v/checker/tests/unsafe_required.v:32:7: error: pointer indexing is only allowed in `unsafe` blocks
vlib/v/checker/tests/unsafe_required.v:32:7: error: pointer indexing is only allowed in `unsafe` blocks
30 | _ = b[0]
31 | c := &b
32 | _ = c[0]
| ~~~
33 |
33 |
34 | v := 4
vlib/v/checker/tests/unsafe_required.v:36:10: error: pointer indexing is only allowed in `unsafe` blocks
vlib/v/checker/tests/unsafe_required.v:36:10: error: pointer indexing is only allowed in `unsafe` blocks
34 | v := 4
35 | p := &v
36 | _ = p[0]