diff --git a/library/core/src/option.rs b/library/core/src/option.rs index c27db0767ac..8057ff07591 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1179,6 +1179,7 @@ pub fn xor(self, optb: Option) -> 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 {