Fix type inference for proc expressions
auto merge of #10728 : sanxiyn/rust/proc, r=cmr

Fix #10718.