Skip to content

Unsafe evolution: merge to main#82547

Merged
jjonescz merged 24 commits intodotnet:mainfrom
jjonescz:Unsafe-19-MergeToMain
Feb 27, 2026
Merged

Unsafe evolution: merge to main#82547
jjonescz merged 24 commits intodotnet:mainfrom
jjonescz:Unsafe-19-MergeToMain

Conversation

@jjonescz
Copy link
Copy Markdown
Member

@jjonescz jjonescz commented Feb 26, 2026

Test plan: #81207
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/unsafe-evolution.md
Proposal issue: dotnet/csharplang#9704

The last commit trivially resolves remaining PROTOTYPE comments (compacting numbers and using tracking issue for the rest).

jjonescz and others added 24 commits November 24, 2025 13:49
…81240)

Test plan: dotnet#81207

Require unsafe for pointer indirection, member access, and element
access when the new memory safety rules are enabled.
Unsafe is not required elsewhere (like for pointer types) under the new
rules, but more restrictions will be added in follow up PRs, like to
also require unsafe for function pointer invocation, etc.
…ods and properties (dotnet#81581)

Test plan: dotnet#81207

More member kinds (besides methods and properties; and also some other
types of methods, like synthesized methods) will be handled in a follow
up (once this proof of concept is approved). OHI is also not handled in
this PR.
…otnet#81698)

Test plan: dotnet#81207

Follow up on dotnet#81581 (i.e., still
only for methods and properties).
1. Checking lang version.
2. Improving some tests.
Test plan: dotnet#81207

Only one trivial conflict due to a variable rename from
dotnet#81651 (in PEMethodSymbol.cs on
line 1042).
Plus need to fixup the feature flag otherwise it fails on assert as an
unknown feature flag due to dotnet#81591
- commit
dotnet@0ae3719.
Test plan: dotnet#81207
OHI not handled as part of this PR.
Delegates handled according to this open question:
https://github.com/dotnet/csharplang/blob/79da45137622071d3c80ebe0a1296387af67afb9/proposals/unsafe-evolution.md#delegate-type-unsafety
(i.e., it's not possible to mark delegates as caller-unsafe - I'd expect
this to be approved and even if not, it seems like a good starting point
- see also comments by jkotas under
dotnet/csharplang#9831).
Test plan: dotnet#81207
All conflicts resolved in the last commit only.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: dibarbet <5749229+dibarbet@users.noreply.github.com>
Co-authored-by: Cyrus Najmabadi <cyrus.najmabadi@gmail.com>
Co-authored-by: David Barbet <dabarbet@microsoft.com>
Co-authored-by: Joseph Musser <me@jnm2.com>
Co-authored-by: Joey Robichaud <jorobich@microsoft.com>
Co-authored-by: Fred Silberberg <frsilb@microsoft.com>
Co-authored-by: dotnet bot <dotnet-bot@dotnetfoundation.org>
Co-authored-by: dotnet-policy-service[bot] <123482357+dotnet-policy-service[bot]@users.noreply.github.com>
Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
Co-authored-by: Jason Malinowski <jason.malinowski@microsoft.com>
Co-authored-by: DoctorKrolic <mapmyp03@gmail.com>
Co-authored-by: DoctorKrolic <70431552+DoctorKrolic@users.noreply.github.com>
Co-authored-by: Glen <glen.84@gmail.com>
Co-authored-by: David McFarland <corngood@gmail.com>
Co-authored-by: AlekseyTs <AlekseyTs@users.noreply.github.com>
Co-authored-by: Phil Allen <phillipa@microsoft.com>
Co-authored-by: Thomas Shephard <thomas@thomas-shephard.com>
Co-authored-by: Cyrus Najmabadi <cyrusn@microsoft.com>
Co-authored-by: David Wengier <david.wengier@microsoft.com>
Co-authored-by: Julien Couvreur <12466233+jcouv@users.noreply.github.com>
Co-authored-by: Tomáš Matoušek <tmat@users.noreply.github.com>
Co-authored-by: Ankita Khera <40616383+akhera99@users.noreply.github.com>
Co-authored-by: Todd Grunke <toddgrun@microsoft.com>
Co-authored-by: Rikki Gibson <rigibson@microsoft.com>
Co-authored-by: David Barbet <dibarbet@gmail.com>
Co-authored-by: Jason Malinowski <jason@jason-m.com>
Co-authored-by: JoeRobich <611219+JoeRobich@users.noreply.github.com>
Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
Co-authored-by: ratijas <ratijas.tkachenko@gmail.com>
Co-authored-by: cui <cuiweixie@gmail.com>
Co-authored-by: Kirill Osenkov <KirillOsenkov@users.noreply.github.com>
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
@jjonescz jjonescz marked this pull request as ready for review February 26, 2026 13:27
@jjonescz jjonescz requested a review from a team as a code owner February 26, 2026 13:27
@jjonescz jjonescz requested review from 333fred and jcouv February 26, 2026 13:27
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.

2 participants