Close out #9155

Add a test to make sure it works and switch a private struct over to a
newtype.

Closes #9155
auto merge of #9697 : sfackler/rust/issue_9155, r=cmr

Add a test to make sure it works and switch a private struct over to a
newtype.

Closes #9155