summary refs log tree commit diff stats
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2022-08-24 22:38:37 +0300
committerGitHub <noreply@github.com>2022-08-24 21:38:37 +0200
commitd143924ab2e3914cb3ce0fedac5c5779832df3d8 (patch)
tree49e63ab2c306ba489ae696fedebe6f7b61d6c71a
parentb6bfe38ff5283f77d5e5e78da06d2710bc16afb6 (diff)
downloadNim-d143924ab2e3914cb3ce0fedac5c5779832df3d8.tar.gz
remove unused sfProcvar, "procvar" mentions (#20204)
refs #12975. doesn't close it because wProcvar isn't removed
-rw-r--r--compiler/ast.nim5
-rw-r--r--compiler/pragmas.nim3
-rw-r--r--compiler/sempass2.nim3
-rw-r--r--doc/manual.md3
-rw-r--r--tests/errmsgs/tcannot_capture_builtin.nim2
5 files changed, 8 insertions, 8 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index 2ad700121..d569fee7b 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -260,7 +260,8 @@ type
                       # *OR*: a proc is indirectly called (used as first class)
     sfCompilerProc,   # proc is a compiler proc, that is a C proc that is
                       # needed for the code generator
-    sfProcvar,        # proc can be passed to a proc var
+    sfEscapes         # param escapes
+                      # currently unimplemented
     sfDiscriminant,   # field is a discriminant in a record/object
     sfRequiresInit,   # field must be initialized during construction
     sfDeprecated,     # symbol is deprecated
@@ -331,7 +332,7 @@ const
   sfExperimental* = sfOverriden       # module uses the .experimental switch
   sfGoto* = sfOverriden               # var is used for 'goto' code generation
   sfWrittenTo* = sfBorrow             # param is assigned to
-  sfEscapes* = sfProcvar              # param escapes
+                                      # currently unimplemented
   sfBase* = sfDiscriminant
   sfCustomPragma* = sfRegister        # symbol is custom pragma template
   sfTemplateRedefinition* = sfExportc # symbol is a redefinition of an earlier template
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index b662e09c5..06e861084 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -993,8 +993,8 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
       of wNonReloadable:
         sym.flags.incl sfNonReloadable
       of wProcVar:
+        # old procvar annotation, no longer needed
         noVal(c, it)
-        incl(sym.flags, sfProcvar)
       of wExplain:
         sym.flags.incl sfExplain
       of wDeprecated:
@@ -1043,7 +1043,6 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: var int,
       of wThread:
         noVal(c, it)
         incl(sym.flags, sfThread)
-        incl(sym.flags, sfProcvar)
         if sym.typ != nil:
           incl(sym.typ.flags, tfThread)
           if sym.typ.callConv == ccClosure: sym.typ.callConv = ccNimCall
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index 1e3e41350..ae6d638e4 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -562,7 +562,8 @@ proc procVarCheck(n: PNode; conf: ConfigRef) =
   if n.kind in nkSymChoices:
     for x in n: procVarCheck(x, conf)
   elif n.kind == nkSym and n.sym.magic != mNone and n.sym.kind in routineKinds:
-    localError(conf, n.info, "'$1' cannot be passed to a procvar" % n.sym.name.s)
+    localError(conf, n.info, ("'$1' is a built-in and cannot be used as " &
+      "a first-class procedure") % n.sym.name.s)
 
 proc notNilCheck(tracked: PEffects, n: PNode, paramType: PType) =
   let n = n.skipConv
diff --git a/doc/manual.md b/doc/manual.md
index 4642fdb5c..b4d06cf39 100644
--- a/doc/manual.md
+++ b/doc/manual.md
@@ -8336,8 +8336,7 @@ violations of the `no heap sharing restriction`:idx:\: This restriction implies
 that it is invalid to construct a data structure that consists of memory
 allocated from different (thread-local) heaps.
 
-A thread proc is passed to `createThread` or `spawn` and invoked
-indirectly; so the `thread` pragma implies `procvar`.
+A thread proc can be passed to `createThread` or `spawn`.
 
 
 
diff --git a/tests/errmsgs/tcannot_capture_builtin.nim b/tests/errmsgs/tcannot_capture_builtin.nim
index 3b8aae241..65afa627e 100644
--- a/tests/errmsgs/tcannot_capture_builtin.nim
+++ b/tests/errmsgs/tcannot_capture_builtin.nim
@@ -1,5 +1,5 @@
 discard """
-errormsg: "'+' cannot be passed to a procvar"
+errormsg: "'+' is a built-in and cannot be used as a first-class procedure"
 line: 8
 """