Add language reference material for unsafe updates for memory safety#54367
Draft
BillWagner wants to merge 3 commits into
Draft
Add language reference material for unsafe updates for memory safety#54367BillWagner wants to merge 3 commits into
unsafe updates for memory safety#54367BillWagner wants to merge 3 commits into
Conversation
Use the preferred terms for memory safety.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds C# 15 (preview) documentation for the evolving memory safety model around unsafe, and wires the related feature-spec proposal into the documentation set.
Changes:
- Adds a new “Memory safety” section to the C# 15 “What’s new” page.
- Adds a “Memory safety (preview)” section to the unsafe code reference and updates related keyword/operator/statement reference pages.
- Adds a new C# snippet project used by the memory safety docs, and updates docfx/toc wiring for the proposal.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/csharp/whats-new/csharp-15.md | Adds a C# 15 “Memory safety” feature overview and link to the spec/proposal. |
| docs/csharp/specification/toc.yml | Adds a “Unsafe code > Memory safety” entry under feature specifications. |
| docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md | Renames an internal keyword grouping comment from “unsafe evolution” to “memory safety”. |
| docs/csharp/language-reference/unsafe-code.md | Adds “Memory safety (preview)” reference content and snippet inclusions. |
| docs/csharp/language-reference/statements/fixed.md | Adds a note about the preview relaxations for fixed. |
| docs/csharp/language-reference/snippets/memory-safety/Relaxations.cs | New snippet source demonstrating memory safety relaxations. |
| docs/csharp/language-reference/snippets/memory-safety/Program.cs | New entry point to build/verify the snippet project. |
| docs/csharp/language-reference/snippets/memory-safety/memory-safety.csproj | New snippet project targeting net11.0 with LangVersion=preview. |
| docs/csharp/language-reference/operators/stackalloc.md | Adds a note about preview relaxations for stackalloc→pointer conversion. |
| docs/csharp/language-reference/operators/sizeof.md | Adds a note about preview relaxations for sizeof on unmanaged types. |
| docs/csharp/language-reference/operators/pointer-related-operators.md | Adds a note about preview relaxations for the address-of operator. |
| docs/csharp/language-reference/keywords/unsafe.md | Adds a summary note about the memory safety preview changes. |
| docfx.json | Adds the unsafe-evolution proposal to proposal content/title/description mappings. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #54011
Internal previews