mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-28 17:41:45 +00:00
lift the =dup hook (#21903)
* fixes tests again * remove helper functions * fixes closures, owned refs * final cleanup
This commit is contained in:
@@ -137,7 +137,7 @@ proc new*[T](a: var ref T, finalizer: proc (x: ref T) {.nimcall.}) {.
|
||||
## **Note**: The `finalizer` refers to the type `T`, not to the object!
|
||||
## This means that for each object of type `T` the finalizer will be called!
|
||||
|
||||
proc `=wasMoved`[T](obj: var T) {.magic: "WasMoved", noSideEffect.} =
|
||||
proc `=wasMoved`*[T](obj: var T) {.magic: "WasMoved", noSideEffect.} =
|
||||
## Generic `wasMoved`:idx: implementation that can be overridden.
|
||||
|
||||
proc wasMoved*[T](obj: var T) {.inline, noSideEffect.} =
|
||||
@@ -354,7 +354,7 @@ proc `=destroy`*[T](x: var T) {.inline, magic: "Destroy".} =
|
||||
discard
|
||||
|
||||
when defined(nimHasDup):
|
||||
proc `=dup`*[T](x: ref T): ref T {.inline, magic: "Dup".} =
|
||||
proc `=dup`*[T](x: T): T {.inline, magic: "Dup".} =
|
||||
## Generic `dup`:idx: implementation that can be overridden.
|
||||
discard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user