From c3f0577002b5c158c63dab92476d94af954086f1 Mon Sep 17 00:00:00 2001 From: John Kugelman Date: Mon, 11 Oct 2021 20:40:03 -0400 Subject: Add #[must_use] to non-mutating verb methods --- library/std/src/path.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'library/std/src') diff --git a/library/std/src/path.rs b/library/std/src/path.rs index a8a79fb9c8f..008baa2443f 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2511,6 +2511,8 @@ impl Path { /// 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 } -- cgit 1.4.1-3-g733a5