From 2f7d7c03334924d8d7b3630545cef62038ff0526 Mon Sep 17 00:00:00 2001 From: Kornel Date: Fri, 20 Mar 2020 14:40:35 +0000 Subject: [PATCH] must_use on split_off --- src/liballoc/vec.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index d1956270f135f..4769091183a37 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1377,6 +1377,7 @@ impl Vec { /// assert_eq!(vec2, [2, 3]); /// ``` #[inline] + #[must_use = "use `.truncate()` if you don't need the other half"] #[stable(feature = "split_off", since = "1.4.0")] pub fn split_off(&mut self, at: usize) -> Self { assert!(at <= self.len(), "`at` out of bounds");