From f8cfe330b3c23bd538ec50a674b2b578bd431d21 Mon Sep 17 00:00:00 2001 From: flywind Date: Fri, 5 Mar 2021 16:50:57 +0800 Subject: [PATCH] follow #17245 deprecate refchecks (#17261) * follow #17245 deprecate refchecks * changelog * address comments --- changelog.md | 2 +- compiler/commands.nim | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index cf3fd642b..94f5f3253 100644 --- a/changelog.md +++ b/changelog.md @@ -245,7 +245,7 @@ provided by the operating system. - Added `then`, `catch` to `asyncjs`, for now hidden behind `-d:nimExperimentalAsyncjsThen`. -- `--newruntime` is deprecated. +- `--newruntime` and `--refchecks` are deprecated. ## Tool changes diff --git a/compiler/commands.nim b/compiler/commands.nim index abe1970dc..9c6af83d0 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -307,7 +307,9 @@ proc testCompileOption*(conf: ConfigRef; switch: string, info: TLineInfo): bool of "fieldchecks": result = contains(conf.options, optFieldCheck) of "rangechecks": result = contains(conf.options, optRangeCheck) of "boundchecks": result = contains(conf.options, optBoundsCheck) - of "refchecks": result = contains(conf.options, optRefCheck) + of "refchecks": + warningDeprecated(conf, info, "refchecks is deprecated!") + result = contains(conf.options, optRefCheck) of "overflowchecks": result = contains(conf.options, optOverflowCheck) of "staticboundchecks": result = contains(conf.options, optStaticBoundsCheck) of "stylechecks": result = contains(conf.options, optStyleCheck) @@ -659,7 +661,9 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo; of "fieldchecks": processOnOffSwitch(conf, {optFieldCheck}, arg, pass, info) of "rangechecks": processOnOffSwitch(conf, {optRangeCheck}, arg, pass, info) of "boundchecks": processOnOffSwitch(conf, {optBoundsCheck}, arg, pass, info) - of "refchecks": processOnOffSwitch(conf, {optRefCheck}, arg, pass, info) + of "refchecks": + warningDeprecated(conf, info, "refchecks is deprecated!") + processOnOffSwitch(conf, {optRefCheck}, arg, pass, info) of "overflowchecks": processOnOffSwitch(conf, {optOverflowCheck}, arg, pass, info) of "staticboundchecks": processOnOffSwitch(conf, {optStaticBoundsCheck}, arg, pass, info) of "stylechecks": processOnOffSwitch(conf, {optStyleCheck}, arg, pass, info)