remove most conditional compilation based on stage1

There are still a few occurrences of "stage1" in the standard library
and self-hosted compiler source, however, these instances need a bit
more careful inspection to ensure no breakage.
This commit is contained in:
Andrew Kelley
2022-12-06 20:35:50 -07:00
parent c8aba15c22
commit 50eb7983cd
88 changed files with 365 additions and 573 deletions

View File

@@ -90,13 +90,12 @@ pub fn MultiArrayList(comptime S: type) type {
};
}
const Sort = struct {
fn lessThan(trash: *i32, lhs: Data, rhs: Data) bool {
_ = trash;
fn lessThan(context: void, lhs: Data, rhs: Data) bool {
_ = context;
return lhs.alignment > rhs.alignment;
}
};
var trash: i32 = undefined; // workaround for stage1 compiler bug
std.sort.sort(Data, &data, &trash, Sort.lessThan);
std.sort.sort(Data, &data, {}, Sort.lessThan);
var sizes_bytes: [fields.len]usize = undefined;
var field_indexes: [fields.len]usize = undefined;
for (data) |elem, i| {