-
Notifications
You must be signed in to change notification settings - Fork 6k
Consolidate warnings and errors for unsafe code. #49388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Copilot didn't find any errors related to `fixed` buffers.
There was a problem hiding this 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 consolidates documentation for compiler errors and warnings related to unsafe code constructs into a single comprehensive article. The primary purpose is to improve discoverability and provide centralized guidance for developers working with unsafe code features in C#.
Key changes:
- Created a new consolidated article covering 27 unsafe code-related compiler errors and warnings (CS0193 through CS9123)
- Organized content into logical sections: pointer operations, managed types, fixed buffers, unsafe context restrictions, fixed-size buffers, and function pointers
- Added redirects from individual error pages to the new consolidated article
Reviewed Changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/csharp/language-reference/compiler-messages/unsafe-code-errors.md | New consolidated article covering all unsafe code errors and warnings |
| docs/csharp/language-reference/toc.yml | Added new unsafe code errors section to table of contents, reformatted displayName fields for readability |
| docs/csharp/misc/sorry-we-don-t-have-specifics-on-this-csharp-error.md | Removed CS9123 from list as it's now documented in the new article |
| docs/csharp/misc/cs1654.md | Updated cross-reference from CS1656 to point to new consolidated article |
| docs/csharp/misc/*.md (18 files) | Deleted individual error documentation files that are now consolidated |
| docs/csharp/language-reference/compiler-messages/*.md (7 files) | Deleted individual error documentation files that are now consolidated |
| .openpublishing.redirection.csharp.json | Added redirects from deleted error pages to new consolidated article |
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BillWagner these changes LGTM.
One thing I think can be improved is to add periods to all line items in unsafe-code-errors.md.
Contributes to #45118
CS9123 indicates that
&can't be used on a local variable in an async method.Grab all other errors and warnings related to unsafe code into a single file.
Internal previews