summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-05-14 15:39:57 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-05-14 15:39:57 +0900
commitf691c15792a587eeaa36a8c3ab1a6354368bfd33 (patch)
treec4691de2ade0b113890a8f2cf3500f4d92157d41
parentcf1e1879f12ad547f95fe94ab62b4d960e804eb8 (diff)
downloadruby-f691c15792a587eeaa36a8c3ab1a6354368bfd33.tar.gz
ext/objspace/lib/objspace/trace.rb: Remove the original Kernel#p
... to disable a "method redefined" warning. http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20210514T050008Z.fail.html.gz ``` 1) Failure: TestObjSpace#test_objspace_trace [/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/test/objspace/test_objspace.rb:621]: <["objspace/trace is enabled"]> expected but was <["/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/.ext/common/objspace/trace.rb:29: warning: method redefined; discarding old p", "objspace/trace is enabled"]>. ```
-rw-r--r--ext/objspace/lib/objspace/trace.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/objspace/lib/objspace/trace.rb b/ext/objspace/lib/objspace/trace.rb
index df803bbae6..c23f5a9d52 100644
--- a/ext/objspace/lib/objspace/trace.rb
+++ b/ext/objspace/lib/objspace/trace.rb
@@ -26,6 +26,7 @@
require 'objspace.so'
module Kernel
+ remove_method :p
define_method(:p) do |*objs|
objs.each do |obj|
file = ObjectSpace.allocation_sourcefile(obj)