aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/ptrCast_discards_const_qualifier.zig
blob: 0c4bb0a1e24a666115fc0f59e774321538fefda4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
export fn entry() void {
    const x: i32 = 1234;
    const y: *i32 = @ptrCast(&x);
    _ = y;
}

// error
// backend=stage2
// target=native
//
// :3:21: error: @ptrCast discards const qualifier
// :3:21: note: use @constCast to discard const qualifier