Skip to content

Commit 846ec31

Browse files
committed
Rollup merge of rust-lang#24452 - tbu-:pr_file_path, r=aturon
Fixes rust-lang#22190.
2 parents 228987c + 53b7a06 commit 846ec31

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/libstd/fs.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ use vec::Vec;
5151
#[stable(feature = "rust1", since = "1.0.0")]
5252
pub struct File {
5353
inner: fs_imp::File,
54-
path: Option<PathBuf>,
5554
}
5655

5756
/// Metadata information about a file.
@@ -193,12 +192,12 @@ impl File {
193192
OpenOptions::new().write(true).create(true).truncate(true).open(path)
194193
}
195194

196-
/// Returns the original path that was used to open this file.
195+
/// Returns `None`.
197196
#[unstable(feature = "file_path",
198-
reason = "this abstraction is imposed by this library instead \
199-
of the underlying OS and may be removed")]
197+
reason = "this abstraction was imposed by this library and was removed")]
198+
#[deprecated(since = "1.0.0", reason = "abstraction was removed")]
200199
pub fn path(&self) -> Option<&Path> {
201-
self.path.as_ref().map(|p| &**p)
200+
None
202201
}
203202

204203
/// Attempts to sync all OS-internal metadata to disk.
@@ -302,7 +301,7 @@ impl AsInner<fs_imp::File> for File {
302301
}
303302
impl FromInner<fs_imp::File> for File {
304303
fn from_inner(f: fs_imp::File) -> File {
305-
File { inner: f, path: None }
304+
File { inner: f }
306305
}
307306
}
308307

@@ -470,7 +469,7 @@ impl OpenOptions {
470469
pub fn open<P: AsRef<Path>>(&self, path: P) -> io::Result<File> {
471470
let path = path.as_ref();
472471
let inner = try!(fs_imp::File::open(path, &self.0));
473-
Ok(File { path: Some(path.to_path_buf()), inner: inner })
472+
Ok(File { inner: inner })
474473
}
475474
}
476475

0 commit comments

Comments
 (0)