Add additional memory safety diagnostics#54369
Open
BillWagner wants to merge 7 commits into
Open
Conversation
Add additional errors related to the main topic.
Contributor
There was a problem hiding this comment.
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.mdwith updated keyword mappings. - Remove standalone pages for
CS1664andCS8500, 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).
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…docs into unsafe-2-diagnostics
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 #54012
Add the additional memory safety related diagnostics.
Internal previews