Skip to content

Document that adding unsafe modifier is a breaking change - #130117

Merged
tannergooding merged 1 commit into
mainfrom
jjonescz-patch-1
Jul 2, 2026
Merged

tannergooding merged 1 commit into
mainfrom
jjonescz-patch-1

Conversation

@jjonescz

@jjonescz jjonescz commented Jul 2, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 2, 2026 10:43
@jjonescz jjonescz added documentation Documentation bug or enhancement, does not impact product or test code and removed area-Meta labels Jul 2, 2026
@jjonescz
jjonescz requested review from EgorBo and tannergooding July 2, 2026 10:44
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

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

Updates the breaking-change documentation rules to explicitly call out adding the unsafe modifier as a breaking change scenario (under the proposed/updated C# unsafe/memory-safety semantics).

Changes:

  • Adds a new “Disallowed” item under “Signatures” for adding the unsafe modifier when compiled with the updated C# memory safety / unsafe evolution rules.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Copilot Code Review

Holistic Assessment

Motivation: Justified — the Unsafe evolution language feature will make adding unsafe to a public API a source-breaking change for callers not in an unsafe context. Proactively documenting this is appropriate, especially since the PR author is an assignee on the language feature itself.

Approach: Correct — adding a bullet point to the existing "Signatures > Disallowed" list in breaking-change-rules.md is the right place and format. The qualification "when compiled with the updated memory safety rules" properly scopes this to the new language feature and the link provides context.

Summary: ✅ LGTM. Clean, focused, two-line documentation change that accurately captures a new category of breaking change. Formatting is consistent with surrounding entries, no trailing whitespace, and the external link is valid.


Detailed Findings

Detailed Findings

✅ Content accuracy — correctly describes the breaking change

Under the updated memory safety rules (csharplang#9704), callers of unsafe-marked methods must themselves be in an unsafe context. Adding unsafe to an existing public method therefore breaks source compatibility for callers not already in an unsafe context. The entry accurately captures this.

✅ Placement — reasonable under "Signatures > Disallowed"

The entry is placed in the "Signatures" subsection alongside other modifier/keyword changes (ref/out, params, readonly). This is a defensible placement since the unsafe modifier affects how callers must invoke the method. An alternative would be the "Members" section (where abstract, virtual, static modifiers live), but the current location works well given the caller-side impact framing.

✅ Formatting — consistent with existing entries

Bullet style, backtick usage for the unsafe keyword, and markdown link format all match the conventions in the rest of the document.

Note

This review was created by GitHub Copilot.

Generated by Code Review for issue #130117 · ● 12.9M · ◷

@tannergooding
tannergooding merged commit 0a8142e into main Jul 2, 2026
47 checks passed
@tannergooding
tannergooding deleted the jjonescz-patch-1 branch July 2, 2026 14:23
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 3, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Meta documentation Documentation bug or enhancement, does not impact product or test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants