Fix #6696
auto merge of #6775 : yjh0502/rust/issue_6696, r=catamorphism