rustdoc: Show purity
auto merge of #5536 : sanxiyn/rust/doc-purity, r=brson

Fix #3804.