mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-28 03:17:08 +03:00
add compile error test for pointless discards
This commit is contained in:
@@ -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