From 827971dab2a455559d9df7c79efb882a273203d0 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Tue, 4 Oct 2022 23:05:11 +0800 Subject: [PATCH] remove deprecation messages for `unsafeAddr`; add warnings to docs (#20496) --- lib/system.nim | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index ed1a0077ed..dd46705771 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