summary refs log tree commit diff
path: root/library/std/src/path.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-02-16 11:45:46 -0800
committerManish Goregaokar <manishsmail@gmail.com>2021-02-16 11:45:46 -0800
commita98b22c837edd73b11c8fca02a8bcedc9c94eb95 (patch)
treec639d8bdbab703c8cdcc9e46aba7d3ef1fc17620 /library/std/src/path.rs
parent9d3deed8a2f7dca16869ccd03a8e328ef627e6eb (diff)
downloadrust-a98b22c837edd73b11c8fca02a8bcedc9c94eb95.tar.gz
rust-a98b22c837edd73b11c8fca02a8bcedc9c94eb95.zip
Add caveat to Path::display() about lossiness
Diffstat (limited to 'library/std/src/path.rs')
-rw-r--r--library/std/src/path.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 1889e549338..581c09e23df 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -2321,7 +2321,9 @@ impl Path {
     }
 
     /// Returns an object that implements [`Display`] for safely printing paths
-    /// that may contain non-Unicode data.
+    /// that may contain non-Unicode data. This may perform lossy conversion,
+    /// depending on the platform.  If you would like an implementation which
+    /// escapes the path please use [`Debug`] instead.
     ///
     /// [`Display`]: fmt::Display
     ///
@@ -2555,7 +2557,9 @@ impl fmt::Debug for Path {
 ///
 /// A [`Path`] might contain non-Unicode data. This `struct` implements the
 /// [`Display`] trait in a way that mitigates that. It is created by the
-/// [`display`](Path::display) method on [`Path`].
+/// [`display`](Path::display) method on [`Path`]. This may perform lossy
+/// conversion, depending on the platform. If you would like an implementation
+/// which escapes the path please use [`Debug`] instead.
 ///
 /// # Examples
 ///