parser: prepare for eliminating a warning for v -cross -o vc/v.c cmd/v (part 1) (reduce CI annotation noise)

This commit is contained in:
Delyan Angelov 2025-08-26 16:34:43 +03:00
parent d5ff13335f
commit 037a3b4a00
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -2903,7 +2903,7 @@ fn (mut p Parser) unsafe_stmt() ast.Stmt {
return p.error_with_pos('please use `unsafe {`', p.tok.pos())
}
p.next()
if p.inside_unsafe {
if p.inside_unsafe && !p.inside_defer {
return p.error_with_pos('already inside `unsafe` block', pos)
}
if p.tok.kind == .rcbr {