Revert "Support taking extern pointers at comptime"
This reverts commit d3ebd42865.
This caused a build failure on multiple targets.
This commit is contained in:
@@ -7637,26 +7637,4 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
|
||||
, &[_][]const u8{
|
||||
"tmp.zig:4:9: error: expected type '*c_void', found '?*c_void'",
|
||||
});
|
||||
|
||||
cases.add("pointer to a local runtime `var` is not constant",
|
||||
\\export fn get_ptr() *const u32 {
|
||||
\\ var local_var: u32 = 42;
|
||||
\\ return struct {
|
||||
\\ const ptr = &local_var;
|
||||
\\ }.ptr;
|
||||
\\}
|
||||
, &[_][]const u8{
|
||||
":4:21: error: cannot store runtime value in compile time variable",
|
||||
});
|
||||
|
||||
cases.add("pointer to a local runtime `const` is not constant",
|
||||
\\export fn get_ptr(x: u32) *const u32 {
|
||||
\\ const local_var: u32 = x;
|
||||
\\ return struct {
|
||||
\\ const ptr = &local_var;
|
||||
\\ }.ptr;
|
||||
\\}
|
||||
, &[_][]const u8{
|
||||
":4:21: error: cannot store runtime value in compile time variable",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user