diff --git a/library/core/src/option.rs b/library/core/src/option.rs index b7af3ea8c1af4..d130854911322 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1179,6 +1179,7 @@ impl Option { /// *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 {