about summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-01-12 20:28:19 +0000
committerbors <bors@rust-lang.org>2018-01-12 20:28:19 +0000
commit51b0b3734cbd0ca58c8be3512d53fce2d95f40dd (patch)
tree0f7929e306da4893a0db5671686f08d4443d8859 /src/libstd/path.rs
parent0b90e4e8cd068910f604f3e1fb5d03cc01f1658f (diff)
parentc12eabfb11384dfd45cab87a809aa442203dcc53 (diff)
downloadrust-51b0b3734cbd0ca58c8be3512d53fce2d95f40dd.tar.gz
rust-51b0b3734cbd0ca58c8be3512d53fce2d95f40dd.zip
Auto merge of #47392 - kennytm:rollup, r=kennytm
Rollup of 24 pull requests

- Successful merges: #46985, #47069, #47081, #47185, #47282, #47283, #47288, #47289, #47298, #47305, #47306, #47307, #47310, #47324, #47328, #47331, #47340, #47343, #47344, #47352, #47357, #47365, #47375, #47382
- Failed merges: #47334
Diffstat (limited to 'src/libstd/path.rs')
-rw-r--r--src/libstd/path.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index bed9efcb846..e8297c20af3 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -576,6 +576,13 @@ impl<'a> AsRef<OsStr> for Component<'a> {
     }
 }
 
+#[stable(feature = "path_component_asref", since = "1.24.0")]
+impl<'a> AsRef<Path> for Component<'a> {
+    fn as_ref(&self) -> &Path {
+        self.as_os_str().as_ref()
+    }
+}
+
 /// An iterator over the [`Component`]s of a [`Path`].
 ///
 /// This `struct` is created by the [`components`] method on [`Path`].