Add diagnostics for new unsafe contract errors#52839
Open
BillWagner wants to merge 7 commits intodotnet:mainfrom
Open
Add diagnostics for new unsafe contract errors#52839BillWagner wants to merge 7 commits intodotnet:mainfrom
BillWagner wants to merge 7 commits intodotnet:mainfrom
Conversation
These relate to the upcoming unsafe V2 additions
Update the diagnostics to focus on resolution instead of simply describing errors.
Contributor
There was a problem hiding this comment.
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.mdto 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. |
docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md
Outdated
Show resolved
Hide resolved
docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md
Outdated
Show resolved
Hide resolved
…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
These are added in PR dotnet#52839
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 #51989
Add new C# errors for Unsafe evolution. Search for other related errors and warnings.
Internal previews