diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2022-10-04 23:05:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 17:05:11 +0200 |
commit | 827971dab2a455559d9df7c79efb882a273203d0 (patch) | |
tree | 22cc1a1b26430c0ecd067b016bf89ab3e528cd3e | |
parent | f89ba2c951232fe7f82d211fe43f774e68563a73 (diff) | |
download | Nim-827971dab2a455559d9df7c79efb882a273203d0.tar.gz |
remove deprecation messages for `unsafeAddr`; add warnings to docs (#20496)
-rw-r--r-- | lib/system.nim | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/system.nim b/lib/system.nim index ed1a0077e..dd4670577 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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 |