Skip to content

Commit 0ae2a30

Browse files
authored
Rollup merge of rust-lang#136071 - wowinter13:clippy-add-diagnostic-items, r=flip1995
[Clippy] Add vec_reserve & vecdeque_reserve diagnostic items I’m currently working on reviving this lint (rust-lang/rust-clippy#10157), and there was [a comment](rust-lang/rust-clippy#10157 (comment)) from ``@flip1995`` regarding the necessity of adding new diagnostic items.
2 parents e449a6c + 9d4544c commit 0ae2a30

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)