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