Skip to content

Commit 2b6dc0c

Browse files
committed
rename lint to implicit_reference_clone
1 parent 8c8014d commit 2b6dc0c

20 files changed

+25
-25
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3278,7 +3278,6 @@ Released 2018-09-13
32783278
[`allow_attributes_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason
32793279
[`almost_swapped`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_swapped
32803280
[`approx_constant`]: https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant
3281-
[`arc_new_in_vec_from_elem`]: https://rust-lang.github.io/rust-clippy/master/index.html#arc_new_in_vec_from_elem
32823281
[`as_conversions`]: https://rust-lang.github.io/rust-clippy/master/index.html#as_conversions
32833282
[`assertions_on_constants`]: https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants
32843283
[`assign_op_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
@@ -3435,6 +3434,7 @@ Released 2018-09-13
34353434
[`ifs_same_cond`]: https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond
34363435
[`implicit_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
34373436
[`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
34383438
[`implicit_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_return
34393439
[`implicit_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
34403440
[`imprecise_flops`]: https://rust-lang.github.io/rust-clippy/master/index.html#imprecise_flops

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

Lines changed: 5 additions & 5 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 ARC_NEW_IN_VEC_FROM_ELEM,
29+
pub IMPLICIT_REFERENCE_CLONE,
3030
suspicious,
31-
"calling `Arc::new` in `vec![elem; len]`"
31+
"initializing `Arc` or `Rc` in `vec![elem; len]`"
3232
}
33-
declare_lint_pass!(ArcNewInVecFromElem => [ARC_NEW_IN_VEC_FROM_ELEM]);
33+
declare_lint_pass!(ImplicitReferenceClone => [IMPLICIT_REFERENCE_CLONE]);
3434

35-
impl LateLintPass<'_> for ArcNewInVecFromElem {
35+
impl LateLintPass<'_> for ImplicitReferenceClone {
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

@@ -49,7 +49,7 @@ fn yield_lint(cx: &LateContext<'_>, symbol: Symbol, macro_call: &MacroCall) {
4949

5050
span_lint_and_then(
5151
cx,
52-
ARC_NEW_IN_VEC_FROM_ELEM,
52+
IMPLICIT_REFERENCE_CLONE,
5353
macro_call.span,
5454
&format!("calling `{symbol_name}::new` in `vec![elem; len]`"),
5555
|diag| {

clippy_lints/src/lib.register_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
store.register_group(true, "clippy::all", Some("clippy_all"), vec![
66
LintId::of(absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS),
77
LintId::of(approx_const::APPROX_CONSTANT),
8-
LintId::of(arc_new_in_vec_from_elem::ARC_NEW_IN_VEC_FROM_ELEM),
98
LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
109
LintId::of(assign_ops::ASSIGN_OP_PATTERN),
1110
LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP),
@@ -95,6 +94,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
9594
LintId::of(get_last_with_len::GET_LAST_WITH_LEN),
9695
LintId::of(identity_op::IDENTITY_OP),
9796
LintId::of(if_let_mutex::IF_LET_MUTEX),
97+
LintId::of(implicit_reference_clone::IMPLICIT_REFERENCE_CLONE),
9898
LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING),
9999
LintId::of(infinite_iter::INFINITE_ITER),
100100
LintId::of(inherent_to_string::INHERENT_TO_STRING),

clippy_lints/src/lib.register_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ store.register_lints(&[
3535
utils::internal_lints::UNNECESSARY_SYMBOL_STR,
3636
absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS,
3737
approx_const::APPROX_CONSTANT,
38-
arc_new_in_vec_from_elem::ARC_NEW_IN_VEC_FROM_ELEM,
3938
arithmetic::FLOAT_ARITHMETIC,
4039
arithmetic::INTEGER_ARITHMETIC,
4140
as_conversions::AS_CONVERSIONS,
@@ -190,6 +189,7 @@ store.register_lints(&[
190189
if_not_else::IF_NOT_ELSE,
191190
if_then_some_else_none::IF_THEN_SOME_ELSE_NONE,
192191
implicit_hasher::IMPLICIT_HASHER,
192+
implicit_reference_clone::IMPLICIT_REFERENCE_CLONE,
193193
implicit_return::IMPLICIT_RETURN,
194194
implicit_saturating_sub::IMPLICIT_SATURATING_SUB,
195195
inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR,

clippy_lints/src/lib.register_suspicious.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Manual edits will be overwritten.
44

55
store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec![
6-
LintId::of(arc_new_in_vec_from_elem::ARC_NEW_IN_VEC_FROM_ELEM),
76
LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP),
87
LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
98
LintId::of(await_holding_invalid::AWAIT_HOLDING_INVALID_TYPE),
@@ -21,6 +20,7 @@ store.register_group(true, "clippy::suspicious", Some("clippy_suspicious"), vec!
2120
LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
2221
LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING),
2322
LintId::of(formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
23+
LintId::of(implicit_reference_clone::IMPLICIT_REFERENCE_CLONE),
2424
LintId::of(loops::EMPTY_LOOP),
2525
LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES),
2626
LintId::of(loops::MUT_RANGE_BOUND),

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ mod renamed_lints;
168168
// begin lints modules, do not remove this comment, it’s used in `update_lints`
169169
mod absurd_extreme_comparisons;
170170
mod approx_const;
171-
mod arc_new_in_vec_from_elem;
172171
mod arithmetic;
173172
mod as_conversions;
174173
mod asm_syntax;
@@ -248,6 +247,7 @@ mod if_let_mutex;
248247
mod if_not_else;
249248
mod if_then_some_else_none;
250249
mod implicit_hasher;
250+
mod implicit_reference_clone;
251251
mod implicit_return;
252252
mod implicit_saturating_sub;
253253
mod inconsistent_struct_constructor;
@@ -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(arc_new_in_vec_from_elem::ArcNewInVecFromElem));
894+
store.register_late_pass(|| Box::new(implicit_reference_clone::ImplicitReferenceClone));
895895
// add lints here, do not remove this comment, it's used in `new_lint`
896896
}
897897

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

44
fn main() {

tests/ui/arc_new_in_vec_from_elem/arc/complex_case.stderr renamed to tests/ui/implicit_reference_clone/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::arc-new-in-vec-from-elem` implied by `-D warnings`
14+
= note: `-D clippy::implicit-reference-clone` 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/arc_new_in_vec_from_elem/arc/custom_arc_strucrt.rs renamed to tests/ui/implicit_reference_clone/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::arc_new_in_vec_from_elem)]
1+
#![warn(clippy::implicit_reference_clone)]
22

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

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

44
fn main() {

0 commit comments

Comments
 (0)