]> git.lizzy.rs Git - rust.git/commit
Add ToCStr impl for &Path and StrBuf
authorAaron Turon <aturon@mozilla.com>
Mon, 5 May 2014 21:15:11 +0000 (14:15 -0700)
committerAaron Turon <aturon@mozilla.com>
Thu, 15 May 2014 05:42:46 +0000 (22:42 -0700)
commit8f9cbe08c61b05527e6d48589d4a963126448467
tree2e649aa017f49500e2ebd51d783073cf547d4b8a
parente10fd317211511c3fb4656aee10eb4fd17dc8586
Add ToCStr impl for &Path and StrBuf

This is a stopgap until DST (#12938) lands.

Until DST lands, we cannot decompose &str into & and str, so we cannot
usefully take ToCStr arguments by reference (without forcing an
additional & around &str). So we are instead temporarily adding an
instance for &Path and StrBuf, so that we can take ToCStr as owned. When
DST lands, the &Path instance should be removed, the string instances
should be revisted, and arguments bound by ToCStr should be passed by
reference.

FIXMEs have been added accordingly.
src/libstd/c_str.rs
src/libstd/path/posix.rs
src/libstd/path/windows.rs