Skip to content

Commit 6284c27

Browse files
authored
builtin,checker: remove @[markused] from fn isnil(), set c.table.used_features.auto_str_ptr = true instead (#23464)
1 parent b1d2593 commit 6284c27

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

‎vlib/builtin/builtin.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module builtin
66

77
// isnil returns true if an object is nil (only for C objects).
8-
@[inline; markused]
8+
@[inline]
99
pub fn isnil(v voidptr) bool {
1010
return v == 0
1111
}

‎vlib/v/checker/str.v‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ fn (mut c Checker) string_inter_lit(mut node ast.StringInterLiteral) ast.Type {
5656
if c.pref.skip_unused && !c.is_builtin_mod {
5757
if !c.table.sym(ftyp).has_method('str') {
5858
c.table.used_features.auto_str = true
59-
if ftyp.is_ptr() {
60-
c.table.used_features.auto_str_ptr = true
61-
}
6259
} else {
6360
c.table.used_features.print_types[ftyp.idx()] = true
6461
}
62+
if ftyp.is_ptr() {
63+
c.table.used_features.auto_str_ptr = true
64+
}
6565
c.table.used_features.interpolation = true
6666
}
6767
c.fail_if_unreadable(expr, ftyp, 'interpolation object')
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Hello Tom
2+
C->&Tom
3+
&1.24
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Hello Tom
2+
C->&Tom
3+
&1.24
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
a := 'Tom'
2+
b := 'Hello ${a}'
3+
c := &a
4+
println(b)
5+
println('C->${c}')
6+
7+
f := 1.24
8+
f_p := &f
9+
println('${f_p}')

0 commit comments

Comments
 (0)