Skip to content

Commit 0f9f591

Browse files
committed
Rename lint
1 parent 60da4c9 commit 0f9f591

7 files changed

+22
-22
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3021,7 +3021,7 @@ Released 2018-09-13
30213021
[`too_many_arguments`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
30223022
[`too_many_lines`]: https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
30233023
[`toplevel_ref_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg
3024-
[`trailing_zero_sized_array_without_repr`]: https://rust-lang.github.io/rust-clippy/master/index.html#trailing_zero_sized_array_without_repr
3024+
[`trailing_empty_array`]: https://rust-lang.github.io/rust-clippy/master/index.html#trailing_empty_array
30253025
[`trait_duplication_in_bounds`]: https://rust-lang.github.io/rust-clippy/master/index.html#trait_duplication_in_bounds
30263026
[`transmute_bytes_to_str`]: https://rust-lang.github.io/rust-clippy/master/index.html#transmute_bytes_to_str
30273027
[`transmute_float_to_int`]: https://rust-lang.github.io/rust-clippy/master/index.html#transmute_float_to_int

clippy_lints/src/lib.register_lints.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ store.register_lints(&[
443443
temporary_assignment::TEMPORARY_ASSIGNMENT,
444444
to_digit_is_some::TO_DIGIT_IS_SOME,
445445
to_string_in_display::TO_STRING_IN_DISPLAY,
446-
trailing_zero_sized_array_without_repr::TRAILING_ZERO_SIZED_ARRAY_WITHOUT_REPR,
446+
trailing_empty_array::TRAILING_EMPTY_ARRAY,
447447
trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS,
448448
trait_bounds::TYPE_REPETITION_IN_BOUNDS,
449449
transmute::CROSSPOINTER_TRANSMUTE,

clippy_lints/src/lib.register_nursery.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
2525
LintId::of(regex::TRIVIAL_REGEX),
2626
LintId::of(strings::STRING_LIT_AS_BYTES),
2727
LintId::of(suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS),
28-
LintId::of(trailing_zero_sized_array_without_repr::TRAILING_ZERO_SIZED_ARRAY_WITHOUT_REPR),
28+
LintId::of(trailing_empty_array::TRAILING_EMPTY_ARRAY),
2929
LintId::of(transmute::USELESS_TRANSMUTE),
3030
LintId::of(use_self::USE_SELF),
3131
])

clippy_lints/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ mod tabs_in_doc_comments;
355355
mod temporary_assignment;
356356
mod to_digit_is_some;
357357
mod to_string_in_display;
358-
mod trailing_zero_sized_array_without_repr;
358+
mod trailing_empty_array;
359359
mod trait_bounds;
360360
mod transmute;
361361
mod transmuting_null;
@@ -778,7 +778,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
778778
store.register_late_pass(move || Box::new(undocumented_unsafe_blocks::UndocumentedUnsafeBlocks::default()));
779779
store.register_late_pass(|| Box::new(match_str_case_mismatch::MatchStrCaseMismatch));
780780
store.register_late_pass(move || Box::new(format_args::FormatArgs));
781-
store.register_late_pass(|| Box::new(trailing_zero_sized_array_without_repr::TrailingZeroSizedArrayWithoutRepr));
781+
store.register_late_pass(|| Box::new(trailing_empty_array::TrailingEmptyArray));
782782

783783
}
784784

clippy_lints/src/trailing_zero_sized_array_without_repr.rs renamed to clippy_lints/src/trailing_empty_array.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ declare_clippy_lint! {
2828
/// last: [u32; 0],
2929
/// }
3030
/// ```
31-
pub TRAILING_ZERO_SIZED_ARRAY_WITHOUT_REPR,
31+
pub TRAILING_EMPTY_ARRAY,
3232
nursery,
3333
"struct with a trailing zero-sized array but without `#[repr(C)]` or another `repr` attribute"
3434
}
35-
declare_lint_pass!(TrailingZeroSizedArrayWithoutRepr => [TRAILING_ZERO_SIZED_ARRAY_WITHOUT_REPR]);
35+
declare_lint_pass!(TrailingEmptyArray => [TRAILING_EMPTY_ARRAY]);
3636

37-
impl<'tcx> LateLintPass<'tcx> for TrailingZeroSizedArrayWithoutRepr {
37+
impl<'tcx> LateLintPass<'tcx> for TrailingEmptyArray {
3838
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
3939
if is_struct_with_trailing_zero_sized_array(cx, item) && !has_repr_attr(cx, item.hir_id()) {
4040
span_lint_and_help(
4141
cx,
42-
TRAILING_ZERO_SIZED_ARRAY_WITHOUT_REPR,
42+
TRAILING_EMPTY_ARRAY,
4343
item.span,
4444
"trailing zero-sized array in a struct which is not marked with a `repr` attribute",
4545
None,

tests/ui/trailing_zero_sized_array_without_repr.rs renamed to tests/ui/trailing_empty_array.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::trailing_zero_sized_array_without_repr)]
1+
#![warn(clippy::trailing_empty_array)]
22
#![feature(const_generics_defaults)]
33

44
// Do lint:

tests/ui/trailing_zero_sized_array_without_repr.stderr renamed to tests/ui/trailing_empty_array.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
2-
--> $DIR/trailing_zero_sized_array_without_repr.rs:6:1
2+
--> $DIR/trailing_empty_array.rs:6:1
33
|
44
LL | / struct RarelyUseful {
55
LL | | field: i32,
66
LL | | last: [usize; 0],
77
LL | | }
88
| |_^
99
|
10-
= note: `-D clippy::trailing-zero-sized-array-without-repr` implied by `-D warnings`
10+
= note: `-D clippy::trailing-empty-array` implied by `-D warnings`
1111
= help: consider annotating `RarelyUseful` with `#[repr(C)]` or another `repr` attribute
1212

1313
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
14-
--> $DIR/trailing_zero_sized_array_without_repr.rs:11:1
14+
--> $DIR/trailing_empty_array.rs:11:1
1515
|
1616
LL | / struct OnlyField {
1717
LL | | first_and_last: [usize; 0],
@@ -21,7 +21,7 @@ LL | | }
2121
= help: consider annotating `OnlyField` with `#[repr(C)]` or another `repr` attribute
2222

2323
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
24-
--> $DIR/trailing_zero_sized_array_without_repr.rs:15:1
24+
--> $DIR/trailing_empty_array.rs:15:1
2525
|
2626
LL | / struct GenericArrayType<T> {
2727
LL | | field: i32,
@@ -32,7 +32,7 @@ LL | | }
3232
= help: consider annotating `GenericArrayType` with `#[repr(C)]` or another `repr` attribute
3333

3434
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
35-
--> $DIR/trailing_zero_sized_array_without_repr.rs:21:1
35+
--> $DIR/trailing_empty_array.rs:21:1
3636
|
3737
LL | / struct OnlyAnotherAttribute {
3838
LL | | field: i32,
@@ -43,7 +43,7 @@ LL | | }
4343
= help: consider annotating `OnlyAnotherAttribute` with `#[repr(C)]` or another `repr` attribute
4444

4545
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
46-
--> $DIR/trailing_zero_sized_array_without_repr.rs:29:1
46+
--> $DIR/trailing_empty_array.rs:27:1
4747
|
4848
LL | / struct OnlyADeriveAttribute {
4949
LL | | field: i32,
@@ -54,7 +54,7 @@ LL | | }
5454
= help: consider annotating `OnlyADeriveAttribute` with `#[repr(C)]` or another `repr` attribute
5555

5656
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
57-
--> $DIR/trailing_zero_sized_array_without_repr.rs:35:1
57+
--> $DIR/trailing_empty_array.rs:33:1
5858
|
5959
LL | / struct ZeroSizedWithConst {
6060
LL | | field: i32,
@@ -65,7 +65,7 @@ LL | | }
6565
= help: consider annotating `ZeroSizedWithConst` with `#[repr(C)]` or another `repr` attribute
6666

6767
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
68-
--> $DIR/trailing_zero_sized_array_without_repr.rs:44:1
68+
--> $DIR/trailing_empty_array.rs:42:1
6969
|
7070
LL | / struct ZeroSizedWithConstFunction {
7171
LL | | field: i32,
@@ -76,7 +76,7 @@ LL | | }
7676
= help: consider annotating `ZeroSizedWithConstFunction` with `#[repr(C)]` or another `repr` attribute
7777

7878
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
79-
--> $DIR/trailing_zero_sized_array_without_repr.rs:52:1
79+
--> $DIR/trailing_empty_array.rs:50:1
8080
|
8181
LL | / struct ZeroSizedWithConstFunction2 {
8282
LL | | field: i32,
@@ -87,23 +87,23 @@ LL | | }
8787
= help: consider annotating `ZeroSizedWithConstFunction2` with `#[repr(C)]` or another `repr` attribute
8888

8989
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
90-
--> $DIR/trailing_zero_sized_array_without_repr.rs:57:1
90+
--> $DIR/trailing_empty_array.rs:55:1
9191
|
9292
LL | struct ZeroSizedArrayWrapper([usize; 0]);
9393
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9494
|
9595
= help: consider annotating `ZeroSizedArrayWrapper` with `#[repr(C)]` or another `repr` attribute
9696

9797
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
98-
--> $DIR/trailing_zero_sized_array_without_repr.rs:59:1
98+
--> $DIR/trailing_empty_array.rs:57:1
9999
|
100100
LL | struct TupleStruct(i32, [usize; 0]);
101101
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102102
|
103103
= help: consider annotating `TupleStruct` with `#[repr(C)]` or another `repr` attribute
104104

105105
error: trailing zero-sized array in a struct which is not marked with a `repr` attribute
106-
--> $DIR/trailing_zero_sized_array_without_repr.rs:61:1
106+
--> $DIR/trailing_empty_array.rs:59:1
107107
|
108108
LL | / struct LotsOfFields {
109109
LL | | f1: u32,

0 commit comments

Comments
 (0)