Skip to content

Commit 6a65476

Browse files
committed
rename lint to ref_clone_in_vec_init
1 parent 3190e93 commit 6a65476

20 files changed

+24
-24
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3434,7 +3434,6 @@ Released 2018-09-13
34343434
[`ifs_same_cond`]: https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond
34353435
[`implicit_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
34363436
[`implicit_hasher`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher
3437-
[`implicit_reference_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_reference_clone
34383437
[`implicit_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
34393438
[`implicit_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
34403439
[`imprecise_flops`]: https://rust-lang.github.io/rust-clippy/master/index.html#imprecise_flops
@@ -3659,6 +3658,7 @@ Released 2018-09-13
36593658
[`redundant_slicing`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing
36603659
[`redundant_static_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
36613660
[`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
@@ -94,7 +94,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
9494
LintId::of(get_last_with_len::GET_LAST_WITH_LEN),
9595
LintId::of(identity_op::IDENTITY_OP),
9696
LintId::of(if_let_mutex::IF_LET_MUTEX),
97-
LintId::of(implicit_reference_clone::IMPLICIT_REFERENCE_CLONE),
9897
LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING),
9998
LintId::of(infinite_iter::INFINITE_ITER),
10099
LintId::of(inherent_to_string::INHERENT_TO_STRING),
@@ -269,6 +268,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
269268
LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES),
270269
LintId::of(redundant_slicing::REDUNDANT_SLICING),
271270
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
@@ -189,7 +189,6 @@ store.register_lints(&[
189189
if_not_else::IF_NOT_ELSE,
190190
if_then_some_else_none::IF_THEN_SOME_ELSE_NONE,
191191
implicit_hasher::IMPLICIT_HASHER,
192-
implicit_reference_clone::IMPLICIT_REFERENCE_CLONE,
193192
implicit_return::IMPLICIT_RETURN,
194193
implicit_saturating_sub::IMPLICIT_SATURATING_SUB,
195194
inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR,
@@ -455,6 +454,7 @@ store.register_lints(&[
455454
redundant_slicing::DEREF_BY_SLICING,
456455
redundant_slicing::REDUNDANT_SLICING,
457456
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
@@ -20,13 +20,13 @@ store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec!
2020
LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
2121
LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING),
2222
LintId::of(formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
23-
LintId::of(implicit_reference_clone::IMPLICIT_REFERENCE_CLONE),
2423
LintId::of(loops::EMPTY_LOOP),
2524
LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES),
2625
LintId::of(loops::MUT_RANGE_BOUND),
2726
LintId::of(methods::SUSPICIOUS_MAP),
2827
LintId::of(mut_key::MUTABLE_KEY_TYPE),
2928
LintId::of(octal_escapes::OCTAL_ESCAPES),
29+
LintId::of(ref_clone_in_vec_init::REF_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
@@ -247,7 +247,6 @@ mod if_let_mutex;
247247
mod if_not_else;
248248
mod if_then_some_else_none;
249249
mod implicit_hasher;
250-
mod implicit_reference_clone;
251250
mod implicit_return;
252251
mod implicit_saturating_sub;
253252
mod inconsistent_struct_constructor;
@@ -353,6 +352,7 @@ mod redundant_field_names;
353352
mod redundant_pub_crate;
354353
mod redundant_slicing;
355354
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(implicit_reference_clone::ImplicitReferenceClone));
894+
store.register_late_pass(|| Box::new(ref_clone_in_vec_init::RefCloneInVecInit));
895895
// add lints here, do not remove this comment, it's used in `new_lint`
896896
}
897897

clippy_lints/src/implicit_reference_clone.rs renamed to clippy_lints/src/ref_clone_in_vec_init.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ declare_clippy_lint! {
2626
/// let v = vec![data; 100];
2727
/// ```
2828
#[clippy::version = "1.62.0"]
29-
pub IMPLICIT_REFERENCE_CLONE,
29+
pub REF_CLONE_IN_VEC_INIT,
3030
suspicious,
3131
"initializing `Arc` or `Rc` in `vec![elem; len]`"
3232
}
33-
declare_lint_pass!(ImplicitReferenceClone => [IMPLICIT_REFERENCE_CLONE]);
33+
declare_lint_pass!(RefCloneInVecInit => [REF_CLONE_IN_VEC_INIT]);
3434

35-
impl LateLintPass<'_> for ImplicitReferenceClone {
35+
impl LateLintPass<'_> for RefCloneInVecInit {
3636
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
3737
let Some(macro_call) = root_macro_call_first_node(cx, expr) else { return; };
3838
let Some(VecArgs::Repeat(elem, _)) = VecArgs::hir(cx, expr) else { return; };
@@ -47,7 +47,7 @@ fn yield_lint(cx: &LateContext<'_>, symbol: Symbol, macro_call: &MacroCall) {
4747

4848
span_lint_and_then(
4949
cx,
50-
IMPLICIT_REFERENCE_CLONE,
50+
REF_CLONE_IN_VEC_INIT,
5151
macro_call.span,
5252
&format!("calling `{symbol_name}::new` in `vec![elem; len]`"),
5353
|diag| {

tests/ui/implicit_reference_clone/arc/complex_case.rs renamed to tests/ui/ref_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::implicit_reference_clone)]
1+
#![warn(clippy::ref_clone_in_vec_init)]
22
use std::sync::Mutex;
33

44
fn main() {

tests/ui/implicit_reference_clone/arc/complex_case.stderr renamed to tests/ui/ref_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::implicit-reference-clone` implied by `-D warnings`
14+
= note: `-D clippy::ref-clone-in-vec-init` implied by `-D warnings`
1515
= note: each `Arc` will point to the same allocation
1616
= help: if this is intentional, consider extracting the `Arc` initialization to a variable
1717

tests/ui/implicit_reference_clone/arc/custom_arc_strucrt.rs renamed to tests/ui/ref_clone_in_vec_init/arc/custom_arc_strucrt.rs

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

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

tests/ui/implicit_reference_clone/arc/simple_case.rs renamed to tests/ui/ref_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::implicit_reference_clone)]
1+
#![warn(clippy::ref_clone_in_vec_init)]
22
use std::sync::Arc;
33

44
fn main() {

0 commit comments

Comments
 (0)