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

Removes Default for Box<Path>. #40539

Merged
merged 1 commit into from
Mar 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1224,14 +1224,6 @@ impl Into<Box<Path>> for PathBuf {
}
}

#[stable(feature = "box_default_extra", since = "1.17.0")]
impl Default for Box<Path> {
fn default() -> Box<Path> {
let boxed: Box<OsStr> = Default::default();
unsafe { mem::transmute(boxed) }
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for PathBuf {
fn from(s: &'a T) -> PathBuf {
Expand Down Expand Up @@ -3730,10 +3722,4 @@ mod tests {
assert_eq!(&*boxed, &*path_buf);
assert_eq!(&*path_buf, path);
}

#[test]
fn boxed_default() {
let boxed = <Box<Path>>::default();
assert!(boxed.as_os_str().is_empty());
}
}