Skip to content

Conversation

Vexu
Copy link
Member

@Vexu Vexu commented May 27, 2024

No description provided.

@Vexu Vexu force-pushed the missing-errors branch 2 times, most recently from 7148717 to e96dca0 Compare May 28, 2024 08:38
src/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
Member

Choose a reason for hiding this comment

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

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

Copy link
Member Author

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
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 force-pushed the missing-errors branch from e96dca0 to 15791b8 Compare June 2, 2024 18:43
@Vexu Vexu merged commit 7f6ec51 into ziglang:master Jun 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 free to 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