mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
add compile error test for pointless discards
This commit is contained in:
1 parent
ebd082d3f6
commit
b2e94de358
1 file changed
+12
@@ -0,0 +1,12 @@
|
||||
export fn foo() void {
|
||||
var x: i32 = 1234;
|
||||
x += 1;
|
||||
_ = x;
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :4:9: error: pointless discard of local variable
|
||||
// :3:5: note: used here
|
||||
Reference in new issue
Block a user