-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Closed as not planned
Copy link
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
Code:
const std = @import("std");
var al_sfa = std.heap.stackFallback(4096, std.heap.page_allocator);
var al = std.ArrayList(u8).init(al_sfa.get());
pub fn main() !void {
_ = al_sfa;
_ = al;
}Output
/lib/zig/std/heap.zig:532:24: error: unable to evaluate comptime expression
assert(!self.get_called); // `get` called multiple times; instead use `const allocator = stackFallback(N).get();`
^~~~~~~~~~~~~~~~
test.zig:4:43: note: called from here
var al = std.ArrayList(u8).init(al_sfa.get());
~~~~~~~~~~^~
This is due to #18275 because it used to work perfectly fine in 0.11.0.
Expected Behavior
No compilation error or crash from the compilator when using stackFallbackAllocator.get() during comptime.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior