backport from ruby trunk
Merge branch 'backport-ruby-trunk'