Forbid privacy in inner functions

Closes #10111
auto merge of #10443 : alexcrichton/rust/meaninless-pub-priv, r=cmr

Closes #10111