summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/string.c b/string.c
index 367773f0f5..3f0e69689c 100644
--- a/string.c
+++ b/string.c
@@ -10869,7 +10869,8 @@ sym_inspect(VALUE sym)
* sym.id2name -> string
* sym.to_s -> string
*
- * Returns the name or string corresponding to <i>sym</i>.
+ * Returns a frozen string corresponding to <i>sym</i>.
+ * The returned String is always the same String instance for a given Symbol.
*
* :fred.id2name #=> "fred"
* :ginger.to_s #=> "ginger"
@@ -10879,7 +10880,7 @@ sym_inspect(VALUE sym)
VALUE
rb_sym_to_s(VALUE sym)
{
- return str_new_shared(rb_cString, rb_sym2str(sym));
+ return rb_sym2str(sym);
}