mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 02:44:44 +00:00
remove deprecation messages for unsafeAddr; add warnings to docs (#20496)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user