Fix for issue 4875
auto merge of #5039 : alexcrichton/rust/issue-4875, r=catamorphism

It looks like the type for the whole pattern wasn't being written back, so when privacy tried to look it up everything died.