Skip to content

docs: document @unsafe blocks - #81

Closed
MilesCranmerBot wants to merge 3 commits into
MilesCranmer:mainfrom
MilesCranmerBot:pr/unsafe-docs
Closed

MilesCranmerBot wants to merge 3 commits into
MilesCranmer:mainfrom
MilesCranmerBot:pr/unsafe-docs

Conversation

@MilesCranmerBot

Copy link
Copy Markdown
Contributor

Summary

The @unsafe block escape hatch shipped without README coverage. This adds a short section to the @safe documentation covering:

  • statements inside the block are not checked, and internal effects (writes, consumes, new aliases) do not propagate outward;
  • the single-expression form for silencing one unanalyzable call in an otherwise checked function, e.g. @safe w(f, x) = @unsafe f(x).

Docs-only; no functional changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d503c4057

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread README.md Outdated
Comment thread README.md Outdated
@MilesCranmerBot

Copy link
Copy Markdown
Contributor Author

Addressed both comments in 906f237:

  • Examples now use the qualified BorrowChecker.@unsafe form (correct in a session that only imported BorrowChecker).
  • Replaced the Rust unsafe analogy with an @inbounds-style description: this hatch disables validation for the region rather than unlocking extra operations under normal rules.

The @unsafe documentation section landed on master via MilesCranmer#82's README
rewrite; the remaining diff was against the removed manual-overlay
README and is stale.
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