]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/path.rs
Add #[must_use] to non-mutating verb methods
[rust.git] / library / std / src / path.rs
index a8a79fb9c8fbb6120c592184d975a699396386b7..008baa2443f50a7d59b0c46bfbf42d9458e2f1dc 100644 (file)
@@ -2511,6 +2511,8 @@ pub fn iter(&self) -> Iter<'_> {
     /// println!("{}", path.display());
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
+    #[must_use = "this does not display the path, \
+                  it returns an object that can be displayed"]
     #[inline]
     pub fn display(&self) -> Display<'_> {
         Display { path: self }