Skip to content

Commit 9d4544c

Browse files
committed
[Clippy] Add vec_reserve & vecdeque_reserve diagnostic items
1 parent 0285d89 commit 9d4544c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

alloc/src/collections/vec_deque/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
823823
/// assert!(buf.capacity() >= 11);
824824
/// ```
825825
#[stable(feature = "rust1", since = "1.0.0")]
826+
#[cfg_attr(not(test), rustc_diagnostic_item = "vecdeque_reserve")]
826827
#[track_caller]
827828
pub fn reserve(&mut self, additional: usize) {
828829
let new_cap = self.len.checked_add(additional).expect("capacity overflow");

alloc/src/vec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,7 @@ impl<T, A: Allocator> Vec<T, A> {
12671267
#[cfg(not(no_global_oom_handling))]
12681268
#[stable(feature = "rust1", since = "1.0.0")]
12691269
#[track_caller]
1270+
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_reserve")]
12701271
pub fn reserve(&mut self, additional: usize) {
12711272
self.buf.reserve(self.len, additional);
12721273
}

0 commit comments

Comments
 (0)