Skip to content
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

Low level struct updates #5602

Merged
merged 28 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
38b1386
Lifetime updates
jaredpar Nov 16, 2021
4a2ac0c
format
jaredpar Dec 30, 2021
b83e114
moving forward
jaredpar Dec 30, 2021
d3e5c34
more progress
jaredpar Dec 30, 2021
5023c9e
rename to RefThisEscapes
jaredpar Dec 30, 2021
776a7cd
better RefThisEscapes documentation and rules
jaredpar Dec 30, 2021
4dca026
pull out the compat considerations into their own section
jaredpar Dec 30, 2021
6478bfc
progress
jaredpar Dec 30, 2021
e515d58
major progress
jaredpar Dec 30, 2021
7aef477
core parts of the doc are in shape now
jaredpar Dec 31, 2021
ce9f258
edits complete
jaredpar Dec 31, 2021
a60f9c3
edits
jaredpar Jan 3, 2022
4a61b91
Apply suggestions from code review
jaredpar Jan 3, 2022
5edbfe9
PR feedback
jaredpar Jan 3, 2022
3cabddd
Better sample
jaredpar Jan 3, 2022
f9eb4de
more
jaredpar Jan 3, 2022
33bddf4
feedback
jaredpar Jan 4, 2022
97225d7
Update proposals/low-level-struct-improvements.md
jaredpar Jan 5, 2022
1a38089
Update proposals/low-level-struct-improvements.md
jaredpar Jan 5, 2022
b74e897
Apply suggestions from code review
jaredpar Jan 5, 2022
f9f57fe
Update proposals/low-level-struct-improvements.md
jaredpar Jan 5, 2022
26876d6
Fixed a flaw with [DoesNotEscape]
jaredpar Jan 5, 2022
d10b06d
Apply suggestions from code review
jaredpar Jan 5, 2022
6c1ac07
ref assembly discussion
jaredpar Jan 13, 2022
d57a315
Apply suggestions from code review
jaredpar Jan 13, 2022
df1dca0
Apply suggestions from code review
jaredpar Jan 13, 2022
dafa854
PR feedback
jaredpar Jan 13, 2022
4b89f19
Update proposals/low-level-struct-improvements.md
jaredpar Jan 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion proposals/csharp-7.2/span-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ The precise rules for computing the *safe-to-return* status of an expression, an

The *ref-safe-to-escape* is a scope, enclosing an lvalue expression, to which it is safe for a ref to the lvalue to escape to. If that scope is the entire method, we say that a ref to the lvalue is *safe to return* from the method.

The *ref-safe-to-escape* scope for an lvalue expression can never be to a greater scope than the *safe-to-escape* for the same value. That means when the spec limits the *safe-to-escape* of a value it is implicitly also limiting the *ref-safe-to-escape* as well. However *ref-safe-to-escape* scope can be to a smaller scope than *safe-to-escape*. Consider that non-ref locals have *safe-to-escape* scope outside method but *ref-safe-to-escape* inside the method.

### safe-to-escape

The *safe-to-escape* is a scope, enclosing an expression, to which it is safe for the value to escape to. If that scope is the entire method, we say that the value is *safe to return* from the method.

An expression whose type is not a `ref struct` type is *safe-to-return* from the entire enclosing method. Otherwise we refer to the rules below.
An expression whose type is not a `ref struct` type is always *safe-to-return* from the entire enclosing method. Otherwise we refer to the rules below.

#### Parameters

Expand Down
Loading