summary refs log tree commit diff stats
path: root/changelogs
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-06-21 14:51:03 +0800
committerGitHub <noreply@github.com>2023-06-21 08:51:03 +0200
commita345cde26e15ef8e1c905c48507195739fab4515 (patch)
tree400a569b50add80200b548739a0986291ccf64e4 /changelogs
parentdb41f04ab0734b0ac5267b46f306b0a311f7fc71 (diff)
downloadNim-a345cde26e15ef8e1c905c48507195739fab4515.tar.gz
allow destructors to accept non var parameters; deprecate `proc =destroy(x: var T)` (#22130)
* make destructors accept non var parameters
* define nimAllowNonVarDestructor
* add a test case and a changelog
* update documentation and error messages
* deprecate destructors taking 'var T'
Diffstat (limited to 'changelogs')
-rw-r--r--changelogs/changelog_2_0_0.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/changelogs/changelog_2_0_0.md b/changelogs/changelog_2_0_0.md
index 5707cf955..b56a3e71c 100644
--- a/changelogs/changelog_2_0_0.md
+++ b/changelogs/changelog_2_0_0.md
@@ -258,6 +258,8 @@
 
 - `strutils.split` and `strutils.rsplit` now forbid an empty separator.
 
+- Custom destructors now supports non-var parameters, e.g. `proc =destroy[T: object](x: T)` is valid. `proc =destroy[T: object](x: var T)` is deprecated.
+
 - Relative imports will not resolve to searched paths anymore, e.g. `import ./tables` now reports an error properly.
 
 ## Standard library additions and changes