Skip to content

Commit 2117afd

Browse files
committed
[Clippy] Add vec_reserve & vecdeque_reserve diagnostic items
1 parent f7cc13a commit 2117afd

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

compiler/rustc_span/src/symbol.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2186,8 +2186,10 @@ symbols! {
21862186
vec_macro,
21872187
vec_new,
21882188
vec_pop,
2189+
vec_reserve,
21892190
vec_with_capacity,
21902191
vecdeque_iter,
2192+
vecdeque_reserve,
21912193
vector,
21922194
version,
21932195
vfp2,

library/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");

library/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)