Document ECMA-335 augment III.1.7.7 recognition for UnscopedRefAttribute and RefSafetyRulesAttribute#12902
Draft
jakobbotsch with Copilot wants to merge 3 commits into
Draft
Document ECMA-335 augment III.1.7.7 recognition for UnscopedRefAttribute and RefSafetyRulesAttribute#12902jakobbotsch with Copilot wants to merge 3 commits into
jakobbotsch with Copilot wants to merge 3 commits into
Conversation
Copilot created this pull request from a session on behalf of
jakobbotsch
July 24, 2026 12:31
View session
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.
Documents that
UnscopedRefAttributeandRefSafetyRulesAttributeare specially recognized by the runtime per ECMA-335 augment III.1.7.7 (from dotnet/runtime#130863), and links out to the augment for the full IL restriction rules.Changes
UnscopedRefAttribute— Added remarks explaining the augment: applying it to a value type instance method letsthisescape; when absent, an optimizing compiler can rely onthisnot escaping (e.g., to eliminate boxing). Notes the runtime relies on it (can't be stripped) and that its effect only holds in a module also annotated withRefSafetyRulesAttribute.RefSafetyRulesAttribute— Replaced the placeholder remarks with a description of the module-level opt-in and version value, links to the augment, and notes the runtime can't strip it.Both entries follow repo style (contractions, "might"/"can" over "may") and link to the augment's
#iii177-opt-in-restrictionsanchor. No claim that dynamic IL emitters must apply either attribute, since omitting them is always conservatively correct.