1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: warn if unsafe method called outside unsafe block (#5863)

This commit is contained in:
Nick Treleaven
2020-07-17 18:14:12 +01:00
committed by GitHub
parent 90d9040e6e
commit 105a0e015e
9 changed files with 92 additions and 9 deletions

View File

@@ -1201,11 +1201,14 @@ pub fn (u ustring) at(idx int) string {
return u.substr(idx, idx + 1)
}
[unsafe_fn]
fn (u &ustring) free() {
$if prealloc {
return
}
u.runes.free()
unsafe {
u.runes.free()
}
}
pub fn (c byte) is_digit() bool {