aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/panic_has_source_location.zig
blob: 6e9d16d76d2467302091a84a54d924d80ac9cde0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const std = @import("std");

export fn foo() void {
    // This should appear in the reference trace
    // (and definitely shouldn't crash due to an unneeded source location!)
    @panic("oh no");
}

pub fn panic(_: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {
    @compileError("panic");
}

// error
// backend=stage2
// target=native
//
// :10:5: error: panic