Skip to content

Commit 1458964

Browse files
authored
Unrolled build for rust-lang#136071
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 77a4553 + 2117afd commit 1458964

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
@@ -2184,8 +2184,10 @@ symbols! {
21842184
vec_macro,
21852185
vec_new,
21862186
vec_pop,
2187+
vec_reserve,
21872188
vec_with_capacity,
21882189
vecdeque_iter,
2190+
vecdeque_reserve,
21892191
vector,
21902192
version,
21912193
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)