remove deprecation messages for unsafeAddr; add warnings to docs (#20496)
This commit is contained in:
parent
f89ba2c951
commit
827971dab2
1 changed files with 3 additions and 13 deletions
|
|
@ -118,19 +118,9 @@ proc `addr`*[T](x: T): ptr T {.magic: "Addr", noSideEffect.} =
|
|||
## ```
|
||||
discard
|
||||
|
||||
proc unsafeAddr*[T](x: T): ptr T {.magic: "Addr", noSideEffect,
|
||||
deprecated: "'unsafeAddr' is a deprecated alias for 'addr'".} =
|
||||
## Builtin `addr` operator for taking the address of a memory
|
||||
## location.
|
||||
##
|
||||
## .. note:: This works for `let` variables or parameters
|
||||
## for better interop with C. When you use it to write a wrapper
|
||||
## for a C library and take the address of `let` variables or parameters,
|
||||
## you should always check that the original library
|
||||
## does never write to data behind the pointer that is returned from
|
||||
## this procedure.
|
||||
##
|
||||
## Cannot be overloaded.
|
||||
proc unsafeAddr*[T](x: T): ptr T {.magic: "Addr", noSideEffect.} =
|
||||
## .. warning:: `unsafeAddr` is a deprecated alias for `addr`,
|
||||
## use `addr` instead.
|
||||
discard
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue