Skip to content
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

Merged
merged 1 commit into from
Feb 25, 2015
Merged

Conversation

alexcrichton
Copy link
Member

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]

@rust-highfive
Copy link
Collaborator

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@aturon aturon mentioned this pull request Feb 23, 2015
91 tasks
///
/// 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<()> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AsPath?

@aturon
Copy link
Member

aturon commented Feb 24, 2015

r=me after minor nit. Fine to not expose conversions if you want to keep up the pressure.

@huonw huonw mentioned this pull request Feb 24, 2015
10 tasks
@alexcrichton alexcrichton force-pushed the prep-env branch 10 times, most recently from d2a97a4 to 2d200c9 Compare February 24, 2015 23:27
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]
@alexcrichton
Copy link
Member Author

@bors: r+ 2d200c9

@alexcrichton
Copy link
Member Author

@bors: r=aturon 2d200c9

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 25, 2015
 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]
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 25, 2015
@Manishearth
Copy link
Member

Needs 9f8a1cb to compile (make x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin/rustbook)

@Manishearth
Copy link
Member

Also Manishearth@35eed36

@bors
Copy link
Contributor

bors commented Feb 25, 2015

⌛ Testing commit 2d200c9 with merge fa1a6e2...

@bors
Copy link
Contributor

bors commented Feb 25, 2015

💔 Test failed - auto-win-64-nopt-t

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 25, 2015
Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 25, 2015
@bors bors merged commit 2d200c9 into rust-lang:master Feb 25, 2015
@alexcrichton alexcrichton deleted the prep-env branch March 27, 2015 20:41
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants