about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/option.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index b7af3ea8c1a..d1308549113 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -1179,6 +1179,7 @@ impl<T> Option<T> {
     /// *val = 3;
     /// assert_eq!(opt.unwrap(), 3);
     /// ```
+    #[must_use = "if you intended to set a value, consider assignment instead"]
     #[inline]
     #[stable(feature = "option_insert", since = "1.53.0")]
     pub fn insert(&mut self, value: T) -> &mut T {