remove deprecation messages for unsafeAddr; add warnings to docs (#20496)

This commit is contained in:
ringabout
2022-10-04 23:05:11 +08:00
committed by GitHub
parent f89ba2c951
commit 827971dab2

View File

@@ -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