Skip to content

some small langref changes #24537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 31, 2025
Merged

Conversation

IOKG04
Copy link
Contributor

@IOKG04 IOKG04 commented Jul 22, 2025

  1. Stating that sentinel-terminated slices can be coerced into sentinel-terminated pointers. (closes Still more slice/pointer confusion #9628)
  2. Currently it is stated that error return traces are enabled by default in ReleaseSafe. This is false and now corrected. (closes @errorReturnTrace() == null in ReleaseSafe build #24232)
  3. Currently the langrefs for @rem() and @mod() state that the caller must guarantee denominator > 0, when it is actually denominator != 0, which is what it's changed to. (closes @rem and @mod langref documentation is wrong #23635)

Regarding 3. I also wanted to ensure the new langrefs would stay correct, so I looked if denominator < 0 is tested anywhere. For @mod() it is already tested, for @rem() not, so I added those tests.
I hope I added them in the correct file, if not I can change it.

IOKG04 added 3 commits July 22, 2025 12:30
…> 0`

ziglang#23635

I also added tests for `@rem()` with `denominator < 0` cause there were none before
I hope I added them in the correct place, if not I can change it ofc
@alexrp alexrp requested a review from mlugg July 22, 2025 12:17
@sfiedler0
Copy link
Contributor

I guess it would also be a great idea fix a mistake in @export where the test says .linkage = .strong, but the explanation says "options.linkage is '.Strong'" (so in the documentation there is a case error).
(and yes, I could have opened a separate pull request and issue, but maybe you could also do it here so there is just one pull request)

@IOKG04 IOKG04 marked this pull request as draft July 28, 2025 12:58
@leecannon
Copy link
Contributor

setFloatMode also refers to Strict and Optimized, both of these should be lowercase

@IOKG04
Copy link
Contributor Author

IOKG04 commented Jul 28, 2025

setFloatMode also refers to Strict and Optimized, both of these should be lowercase

In that case, wouldn't the floating point operator documentation also have to use lowercase versions?
Also I feel like the uppercase is understandable there, considering it isn't prefixed with ., meaning it could just be referring to the name, not the code.

@IOKG04 IOKG04 marked this pull request as ready for review July 28, 2025 19:06
Copy link
Member

@mlugg mlugg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mlugg mlugg enabled auto-merge July 30, 2025 09:13
@mlugg mlugg merged commit 032bbd6 into ziglang:master Jul 31, 2025
10 checks passed
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.

@errorReturnTrace() == null in ReleaseSafe build @rem and @mod langref documentation is wrong Still more slice/pointer confusion
4 participants