From 0d78f6b40f0cf8650bf3c40b65fa774533054d12 Mon Sep 17 00:00:00 2001
From: ggomez <guillaume1.gomez@gmail.com>
Date: Tue, 5 Jul 2016 11:36:43 +0200
Subject: [PATCH] Fix `std::path::Path::file_name()` doc

---
 src/libstd/path.rs | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index ad4cdef615847..2d19561139b58 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1529,8 +1529,7 @@ impl Path {
 
     /// The final component of the path, if it is a normal file.
     ///
-    /// If the path terminates in `.`, `..`, or consists solely of a root of
-    /// prefix, `file_name` will return `None`.
+    /// If the path terminates in `..`, `file_name` will return `None`.
     ///
     /// # Examples
     ///
@@ -1543,6 +1542,17 @@ impl Path {
     ///
     /// assert_eq!(Some(os_str), path.file_name());
     /// ```
+    ///
+    /// # Other examples
+    ///
+    /// ```
+    /// use std::path::Path;
+    /// use std::ffi::OsStr;
+    ///
+    /// assert_eq!(Some(OsStr::new("foo.txt")), Path::new("foo.txt/.").file_name());
+    /// assert_eq!(Some(OsStr::new("foo.txt")), Path::new("foo.txt/.//").file_name());
+    /// assert_eq!(None, Path::new("foo.txt/..").file_name());
+    /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn file_name(&self) -> Option<&OsStr> {
         self.components().next_back().and_then(|p| {