Skip to content

Add missing errors to @ptrFromInt and calling convention validation - #20084

Merged
Vexu merged 2 commits into
ziglang:masterfrom
Vexu:missing-errors
Jun 3, 2024
Merged

Add missing errors to @ptrFromInt and calling convention validation#20084
Vexu merged 2 commits into
ziglang:masterfrom
Vexu:missing-errors

Conversation

@Vexu

@VexuVexu commented May 27, 2024

Copy link
Copy Markdown
Member

No description provided.

@Vexu
Vexuforce-pushed the missing-errors branch 2 times, most recently from 7148717 to e96dca0CompareMay 28, 2024 08:38
@VexuVexu mentioned this pull request May 30, 2024
Comment threadsrc/Sema.zig Outdated
}
if (try sema.typeRequiresComptime(ptr_ty)) {
return sema.failWithOwnedErrorMsg(block, msg: {
const msg = try sema.errMsg(block, src, "cannot get a runtime pointer to comptime-only type '{}'", .{ptr_ty.fmt(mod)});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
constmsg=trysema.errMsg(block, src, "cannot get a runtime pointer to comptime-only type '{}'", .{ptr_ty.fmt(mod)});
constmsg=trysema.errMsg(block, src, "pointer to comptime-only type '{}' must be comptime-known, but operand is runtime-known", .{ptr_ty.fmt(mod)});

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit verbose but I do like it better.

// error
// target=native
//
// :5:54: error: cannot get a runtime pointer to comptime-only type '?*tmp.GuSettings'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this line needs changing too under the above suggestion)

@Vexu
Vexu merged commit 7f6ec51 into ziglang:masterJun 3, 2024
@Vexu
Vexu deleted the missing-errors branch June 3, 2024 11:20
andrewrk pushed a commit that referenced this pull request Jun 6, 2024
Add missing errors to `@ptrFromInt` and Signal calling convention validation
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Vexu@mlugg