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

// error
//
// :3:21: error: @ptrCast discards const qualifier
// :3:21: note: use @constCast to discard const qualifier