Add safety comments proposal#10201
Conversation
| byte* addr = (byte*)ptr; | ||
| unsafe | ||
| { | ||
| // SAFETY: relies on caller obligation. |
There was a problem hiding this comment.
I'd personally prefer this at the top of the unsafe block, since the corresponding doc comment is directly above the unsafe member
There was a problem hiding this comment.
at the top of the unsafe block
It is the Rust convention as well if we want to follow that.
| ## Requirements | ||
|
|
||
| We need the following: | ||
|
|
There was a problem hiding this comment.
Compiler should also be sure to emit docs with the tag
There was a problem hiding this comment.
Compiler already supports this (it forwards any element to the final XML, even those it doesn't know about).
But if you want IDE tooltip support, that would need to be implemented.
|
|
||
| We need the following: | ||
|
|
||
| - Document + standardize the form, in both regular docs and best-practice guidance. |
There was a problem hiding this comment.
For reference, https://tbt.qkation.com/posts/safety-comments-matter/ is very detailed best-practice guidance for Rust
| @@ -0,0 +1,72 @@ | |||
| # C/# safety comments | |||
There was a problem hiding this comment.
| # C/# safety comments | |
| # C# safety comments |
Replaces #10197
@333fred