Do not imply that str is sometimes null-terminated.
auto merge of #9462 : SimonSapin/rust/patch-3, r=huonw