Skip to content

Commit

Permalink
Rollup merge of rust-lang#40539 - clarcharr:no_default_path, r=alexcr…
Browse files Browse the repository at this point in the history
…ichton

Removes Default for Box<Path>.

This was not supposed to be added. cc @alexcrichton
  • Loading branch information
frewsxcv authored Mar 17, 2017
2 parents 5616df5 + 0739ece commit 37863ab
Showing 1 changed file with 0 additions and 14 deletions.
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());
}
}

0 comments on commit 37863ab

Please sign in to comment.