-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std: Move std::env to the new I/O APIs #22727
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
378206f
to
3f47b67
Compare
/// | ||
/// let root = Path::new("/"); | ||
/// assert!(env::set_current_dir(&root).is_ok()); | ||
/// println!("Successfully changed working directory to {}!", root.display()); | ||
/// ``` | ||
pub fn set_current_dir(p: &Path) -> IoResult<()> { | ||
pub fn set_current_dir(p: &path::Path) -> io::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AsPath?
r=me after minor nit. Fine to not expose conversions if you want to keep up the pressure. |
d2a97a4
to
2d200c9
Compare
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
Needs 9f8a1cb to compile ( |
Also Manishearth@35eed36 |
⌛ Testing commit 2d200c9 with merge fa1a6e2... |
💔 Test failed - auto-win-64-nopt-t |
This commit moves
std::env
away from thestd::old_io
error type as well asthe
std::old_path
module. Methods returning an error now returnio::Error
and methods consuming or returning paths use
std::path
instead ofstd::old_path
. This commit does not yet mark these APIs as#[stable]
.This commit also migrates
std::old_io::TempDir
tostd::fs::TempDir
withessentially the exact same API. This type was added to interoperate with the new
path API and has its own
tempdir
feature.Finally, this commit reverts the deprecation of
std::os
APIs returning the oldpath API types. This deprecation can come back once the entire
std::old_path
module is deprecated.
[breaking-change]