Adapt to removal of ~str from libstd.

Fixes build with rust master.