Adapt to removal of ~str.

Fixes build with rust master.