Skip to content

Commit 0710a20

Browse files
committed
rename to rc_clone_in_vec_init
1 parent 435b101 commit 0710a20

20 files changed

+24
-24
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3642,6 +3642,7 @@ Released 2018-09-13
36423642
[`range_step_by_zero`]: https://rust-lang.github.io/rust-clippy/master/index.html#range_step_by_zero
36433643
[`range_zip_with_len`]: https://rust-lang.github.io/rust-clippy/master/index.html#range_zip_with_len
36443644
[`rc_buffer`]: https://rust-lang.github.io/rust-clippy/master/index.html#rc_buffer
3645+
[`rc_clone_in_vec_init`]: https://rust-lang.github.io/rust-clippy/master/index.html#rc_clone_in_vec_init
36453646
[`rc_mutex`]: https://rust-lang.github.io/rust-clippy/master/index.html#rc_mutex
36463647
[`recursive_format_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#recursive_format_impl
36473648
[`redundant_allocation`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_allocation
@@ -3658,7 +3659,6 @@ Released 2018-09-13
36583659
[`redundant_slicing`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing
36593660
[`redundant_static_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
36603661
[`ref_binding_to_reference`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_binding_to_reference
3661-
[`ref_clone_in_vec_init`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_clone_in_vec_init
36623662
[`ref_option_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_option_ref
36633663
[`regex_macro`]: https://rust-lang.github.io/rust-clippy/master/index.html#regex_macro
36643664
[`repeat_once`]: https://rust-lang.github.io/rust-clippy/master/index.html#repeat_once

clippy_lints/src/lib.register_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,12 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
263263
LintId::of(ranges::MANUAL_RANGE_CONTAINS),
264264
LintId::of(ranges::RANGE_ZIP_WITH_LEN),
265265
LintId::of(ranges::REVERSED_EMPTY_RANGES),
266+
LintId::of(rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT),
266267
LintId::of(redundant_clone::REDUNDANT_CLONE),
267268
LintId::of(redundant_closure_call::REDUNDANT_CLOSURE_CALL),
268269
LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES),
269270
LintId::of(redundant_slicing::REDUNDANT_SLICING),
270271
LintId::of(redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
271-
LintId::of(ref_clone_in_vec_init::REF_CLONE_IN_VEC_INIT),
272272
LintId::of(reference::DEREF_ADDROF),
273273
LintId::of(regex::INVALID_REGEX),
274274
LintId::of(repeat_once::REPEAT_ONCE),

clippy_lints/src/lib.register_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ store.register_lints(&[
446446
ranges::RANGE_PLUS_ONE,
447447
ranges::RANGE_ZIP_WITH_LEN,
448448
ranges::REVERSED_EMPTY_RANGES,
449+
rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT,
449450
redundant_clone::REDUNDANT_CLONE,
450451
redundant_closure_call::REDUNDANT_CLOSURE_CALL,
451452
redundant_else::REDUNDANT_ELSE,
@@ -454,7 +455,6 @@ store.register_lints(&[
454455
redundant_slicing::DEREF_BY_SLICING,
455456
redundant_slicing::REDUNDANT_SLICING,
456457
redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES,
457-
ref_clone_in_vec_init::REF_CLONE_IN_VEC_INIT,
458458
ref_option_ref::REF_OPTION_REF,
459459
reference::DEREF_ADDROF,
460460
regex::INVALID_REGEX,

clippy_lints/src/lib.register_suspicious.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec!
2626
LintId::of(methods::SUSPICIOUS_MAP),
2727
LintId::of(mut_key::MUTABLE_KEY_TYPE),
2828
LintId::of(octal_escapes::OCTAL_ESCAPES),
29-
LintId::of(ref_clone_in_vec_init::REF_CLONE_IN_VEC_INIT),
29+
LintId::of(rc_clone_in_vec_init::RC_CLONE_IN_VEC_INIT),
3030
LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
3131
LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
3232
])

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,14 @@ mod ptr_offset_with_cast;
345345
mod pub_use;
346346
mod question_mark;
347347
mod ranges;
348+
mod rc_clone_in_vec_init;
348349
mod redundant_clone;
349350
mod redundant_closure_call;
350351
mod redundant_else;
351352
mod redundant_field_names;
352353
mod redundant_pub_crate;
353354
mod redundant_slicing;
354355
mod redundant_static_lifetimes;
355-
mod ref_clone_in_vec_init;
356356
mod ref_option_ref;
357357
mod reference;
358358
mod regex;
@@ -891,7 +891,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
891891
let max_include_file_size = conf.max_include_file_size;
892892
store.register_late_pass(move || Box::new(large_include_file::LargeIncludeFile::new(max_include_file_size)));
893893
store.register_late_pass(|| Box::new(strings::TrimSplitWhitespace));
894-
store.register_late_pass(|| Box::new(ref_clone_in_vec_init::RefCloneInVecInit));
894+
store.register_late_pass(|| Box::new(rc_clone_in_vec_init::RcCloneInVecInit));
895895
// add lints here, do not remove this comment, it's used in `new_lint`
896896
}
897897

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ declare_clippy_lint! {
3636
/// }
3737
/// ```
3838
#[clippy::version = "1.62.0"]
39-
pub REF_CLONE_IN_VEC_INIT,
39+
pub RC_CLONE_IN_VEC_INIT,
4040
suspicious,
4141
"initializing `Arc` or `Rc` in `vec![elem; len]`"
4242
}
43-
declare_lint_pass!(RefCloneInVecInit => [REF_CLONE_IN_VEC_INIT]);
43+
declare_lint_pass!(RcCloneInVecInit => [RC_CLONE_IN_VEC_INIT]);
4444

45-
impl LateLintPass<'_> for RefCloneInVecInit {
45+
impl LateLintPass<'_> for RcCloneInVecInit {
4646
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
4747
let Some(macro_call) = root_macro_call_first_node(cx, expr) else { return; };
4848
let Some(VecArgs::Repeat(elem, _)) = VecArgs::hir(cx, expr) else { return; };
@@ -57,7 +57,7 @@ fn emit_lint(cx: &LateContext<'_>, symbol: Symbol, macro_call: &MacroCall) {
5757

5858
span_lint_and_then(
5959
cx,
60-
REF_CLONE_IN_VEC_INIT,
60+
RC_CLONE_IN_VEC_INIT,
6161
macro_call.span,
6262
&format!("calling `{symbol_name}::new` in `vec![elem; len]`"),
6363
|diag| {

tests/ui/ref_clone_in_vec_init/arc/complex_case.rs renamed to tests/ui/rc_clone_in_vec_init/arc/complex_case.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::ref_clone_in_vec_init)]
1+
#![warn(clippy::rc_clone_in_vec_init)]
22
use std::sync::Mutex;
33

44
fn main() {

tests/ui/ref_clone_in_vec_init/arc/complex_case.stderr renamed to tests/ui/rc_clone_in_vec_init/arc/complex_case.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | | 2
1111
LL | | ];
1212
| |_____^
1313
|
14-
= note: `-D clippy::ref-clone-in-vec-init` implied by `-D warnings`
14+
= note: `-D clippy::rc-clone-in-vec-init` implied by `-D warnings`
1515
= note: each element will point to the same `Arc` instance
1616
= help: if this is intentional, consider extracting the `Arc` initialization to a variable
1717
= help: or if not, initilaize each element individually

tests/ui/ref_clone_in_vec_init/arc/custom_arc.rs renamed to tests/ui/rc_clone_in_vec_init/arc/custom_arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::ref_clone_in_vec_init)]
1+
#![warn(clippy::rc_clone_in_vec_init)]
22

33
#[derive(Clone)]
44
struct Arc;

tests/ui/ref_clone_in_vec_init/arc/simple_case.rs renamed to tests/ui/rc_clone_in_vec_init/arc/simple_case.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::ref_clone_in_vec_init)]
1+
#![warn(clippy::rc_clone_in_vec_init)]
22
use std::sync::Arc;
33

44
fn main() {

0 commit comments

Comments
 (0)