Add test for #4666, which didn't *quite* seem to be covered by

existing tests. The bug itself was fixed as part of recent borrowck
reform.

Fixes #4666.