Skip to content

Add diagnostics for new unsafe contract errors#52839

Open
BillWagner wants to merge 7 commits intodotnet:mainfrom
BillWagner:unsafe-errors
Open

Add diagnostics for new unsafe contract errors#52839
BillWagner wants to merge 7 commits intodotnet:mainfrom
BillWagner:unsafe-errors

Conversation

@BillWagner
Copy link
Copy Markdown
Member

@BillWagner BillWagner commented Apr 1, 2026

These relate to the upcoming unsafe V2 additions
Update the diagnostics to focus on resolution instead of simply describing errors.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 to cover new “unsafe evolution” compiler diagnostics by routing the relevant error codes to the existing unsafe-code diagnostics article and surfacing them in the language reference TOC.

Changes:

  • Move CS7092 and CS8372 out of the generic “no specifics” list and into the unsafe-code diagnostics article.
  • Expand unsafe-code-errors.md to include new Unsafe evolution diagnostics (CS9360–CS9377) and reorganize sections to better group fixed-statement vs. unsafe-context guidance.
  • Update the C# language reference TOC to include the newly documented diagnostics under the “Unsafe code” entry.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md Removes CS7092 and CS8372 now that they’re documented elsewhere.
docs/csharp/language-reference/toc.yml Adds new unsafe-related diagnostic codes to the “Unsafe code” TOC displayName list.
docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md Documents new unsafe evolution diagnostics and reorganizes sections/keyword lists.

…rrors.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
BillWagner added a commit to BillWagner/docs that referenced this pull request Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C# 15-Errors and warnings]: Unsafe evolution diagnostics

2 participants