Fixed #1531
auto merge of #4843 : ILyoan/rust/i1531, r=catamorphism

Fix for #1531