Skip to content

Add additional memory safety diagnostics#54369

Open
BillWagner wants to merge 7 commits into
dotnet:mainfrom
BillWagner:unsafe-2-diagnostics
Open

Add additional memory safety diagnostics#54369
BillWagner wants to merge 7 commits into
dotnet:mainfrom
BillWagner:unsafe-2-diagnostics

Conversation

@BillWagner

@BillWagner BillWagner commented Jun 12, 2026

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings June 12, 2026 17:18
@dotnetrepoman dotnetrepoman Bot added this to the June 2026 milestone Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the C# documentation mapping for new and existing memory-safety and unsafe-code diagnostics by consolidating several compiler error/warning codes into the centralized Unsafe code diagnostics page, updating F1 keyword routing, and adding redirects for removed standalone pages.

Changes:

  • Move/centralize additional unsafe/memory-safety diagnostics (including newer C# 15 “unsafe evolution” codes) into unsafe-code-errors.md with updated keyword mappings.
  • Remove standalone pages for CS1664 and CS8500, and add redirects to the consolidated unsafe diagnostics page.
  • Update the “Sorry, we don’t have specifics…” catch-all list and the C# language reference TOC/displayName mapping to reflect the new routing.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md Removes diagnostics that now have coverage via the unsafe diagnostics hub page.
docs/csharp/misc/cs8500.md Deletes the standalone CS8500 page in favor of consolidated coverage.
docs/csharp/misc/cs1664.md Deletes the standalone CS1664 page in favor of consolidated coverage.
docs/csharp/language-reference/toc.yml Updates the unsafe-code node displayName list and removes the CS1664 standalone TOC entry.
docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md Adds keyword routing and guidance for additional unsafe/memory-safety diagnostics.
.openpublishing.redirection.csharp.json Adds redirects from removed standalone pages to the consolidated unsafe diagnostics page.
Comments suppressed due to low confidence (1)

docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md:302

  • There are two consecutive blank lines at the end of the file, which can trigger markdownlint MD012 (multiple consecutive blank lines). Remove the extra trailing blank lines.
To get a function pointer, use the address-of operator with an explicit function pointer type cast. Don't use the [address-of operator `&`](../operators/pointer-related-operators.md#address-of-operator-) to assign method groups to `void*` or other non-function pointer types. For more information, see [Function pointers](../unsafe-code.md#function-pointers).


Comment thread docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md Outdated
Comment thread docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@BillWagner BillWagner marked this pull request as ready for review June 12, 2026 17:25
@BillWagner BillWagner requested a review from a team as a code owner June 12, 2026 17:25
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.

[C# 15-Errors and warnings]: New Feature - unsafe evolution

2 participants