Revert "Support taking extern pointers at comptime"

This reverts commit d3ebd42865.

This caused a build failure on multiple targets.
This commit is contained in:
Andrew Kelley
2020-07-24 14:06:44 -07:00
parent 978a38ee40
commit 995fd7314c
8 changed files with 47 additions and 284 deletions

View File

@@ -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",
});
}