Skip to content

Commit 45a89b9

Browse files
committed
Rename lint unseparated_literal_suffix -> literal_suffix
1 parent 657cd62 commit 45a89b9

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2742,6 +2742,7 @@ Released 2018-09-13
27422742
[`let_underscore_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
27432743
[`let_unit_value`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
27442744
[`linkedlist`]: https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist
2745+
[`literal_suffix`]: https://rust-lang.github.io/rust-clippy/master/index.html#literal_suffix
27452746
[`logic_bug`]: https://rust-lang.github.io/rust-clippy/master/index.html#logic_bug
27462747
[`lossy_float_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#lossy_float_literal
27472748
[`macro_use_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#macro_use_imports
@@ -2997,7 +2998,6 @@ Released 2018-09-13
29972998
[`unsafe_derive_deserialize`]: https://rust-lang.github.io/rust-clippy/master/index.html#unsafe_derive_deserialize
29982999
[`unsafe_removed_from_name`]: https://rust-lang.github.io/rust-clippy/master/index.html#unsafe_removed_from_name
29993000
[`unsafe_vector_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#unsafe_vector_initialization
3000-
[`unseparated_literal_suffix`]: https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
30013001
[`unsound_collection_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#unsound_collection_transmute
30023002
[`unstable_as_mut_slice`]: https://rust-lang.github.io/rust-clippy/master/index.html#unstable_as_mut_slice
30033003
[`unstable_as_slice`]: https://rust-lang.github.io/rust-clippy/master/index.html#unstable_as_slice

clippy_lints/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -825,11 +825,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
825825
misc_early::BUILTIN_TYPE_SHADOW,
826826
misc_early::DOUBLE_NEG,
827827
misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
828+
misc_early::LITERAL_SUFFIX,
828829
misc_early::MIXED_CASE_HEX_LITERALS,
829830
misc_early::REDUNDANT_PATTERN,
830831
misc_early::UNNEEDED_FIELD_PATTERN,
831832
misc_early::UNNEEDED_WILDCARD_PATTERN,
832-
misc_early::UNSEPARATED_LITERAL_SUFFIX,
833833
misc_early::ZERO_PREFIXED_LITERAL,
834834
missing_const_for_fn::MISSING_CONST_FOR_FN,
835835
missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
@@ -1044,8 +1044,8 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10441044
LintId::of(methods::GET_UNWRAP),
10451045
LintId::of(methods::UNWRAP_USED),
10461046
LintId::of(misc::FLOAT_CMP_CONST),
1047+
LintId::of(misc_early::LITERAL_SUFFIX),
10471048
LintId::of(misc_early::UNNEEDED_FIELD_PATTERN),
1048-
LintId::of(misc_early::UNSEPARATED_LITERAL_SUFFIX),
10491049
LintId::of(missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS),
10501050
LintId::of(missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES),
10511051
LintId::of(missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS),

clippy_lints/src/misc_early/unseparated_literal_suffix.rs renamed to clippy_lints/src/misc_early/literal_suffix.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_ast::ast::Lit;
33
use rustc_errors::Applicability;
44
use rustc_lint::EarlyContext;
55

6-
use super::{LiteralSuffixStyle, UNSEPARATED_LITERAL_SUFFIX};
6+
use super::{LiteralSuffixStyle, LITERAL_SUFFIX};
77

88
pub(super) fn check(
99
cx: &EarlyContext<'_>,
@@ -32,7 +32,7 @@ pub(super) fn check(
3232
LiteralSuffixStyle::Separated if lit_snip.as_bytes()[maybe_last_sep_idx] != b'_' => {
3333
span_lint_and_sugg(
3434
cx,
35-
UNSEPARATED_LITERAL_SUFFIX,
35+
LITERAL_SUFFIX,
3636
lit.span,
3737
&format!("{} type suffix should be separated by an underscore", sugg_type),
3838
"add an underscore",
@@ -43,7 +43,7 @@ pub(super) fn check(
4343
LiteralSuffixStyle::Unseparated if lit_snip.as_bytes()[maybe_last_sep_idx] == b'_' => {
4444
span_lint_and_sugg(
4545
cx,
46-
UNSEPARATED_LITERAL_SUFFIX,
46+
LITERAL_SUFFIX,
4747
lit.span,
4848
&format!("{} type suffix should not be separated by an underscore", sugg_type),
4949
"remove the underscore",

clippy_lints/src/misc_early/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
mod builtin_type_shadow;
22
mod double_neg;
3+
mod literal_suffix;
34
mod mixed_case_hex_literals;
45
mod redundant_pattern;
56
mod unneeded_field_pattern;
67
mod unneeded_wildcard_pattern;
7-
mod unseparated_literal_suffix;
88
mod zero_prefixed_literal;
99

1010
use clippy_utils::diagnostics::span_lint;
@@ -142,7 +142,7 @@ declare_clippy_lint! {
142142
/// // Good
143143
/// let y = 123832i32;
144144
/// ```
145-
pub UNSEPARATED_LITERAL_SUFFIX,
145+
pub LITERAL_SUFFIX,
146146
restriction,
147147
"literals whose suffix is not separated by an underscore"
148148
}
@@ -279,7 +279,7 @@ impl_lint_pass!(MiscEarlyLints => [
279279
DUPLICATE_UNDERSCORE_ARGUMENT,
280280
DOUBLE_NEG,
281281
MIXED_CASE_HEX_LITERALS,
282-
UNSEPARATED_LITERAL_SUFFIX,
282+
LITERAL_SUFFIX,
283283
ZERO_PREFIXED_LITERAL,
284284
BUILTIN_TYPE_SHADOW,
285285
REDUNDANT_PATTERN,
@@ -369,7 +369,7 @@ impl MiscEarlyLints {
369369
LitIntType::Unsigned(ty) => ty.name_str(),
370370
LitIntType::Unsuffixed => "",
371371
};
372-
unseparated_literal_suffix::check(cx, lit, &lit_snip, suffix, "integer", self.literal_suffix_style);
372+
literal_suffix::check(cx, lit, &lit_snip, suffix, "integer", self.literal_suffix_style);
373373
if lit_snip.starts_with("0x") {
374374
mixed_case_hex_literals::check(cx, lit, suffix, &lit_snip);
375375
} else if lit_snip.starts_with("0b") || lit_snip.starts_with("0o") {
@@ -379,7 +379,7 @@ impl MiscEarlyLints {
379379
}
380380
} else if let LitKind::Float(_, LitFloatType::Suffixed(float_ty)) = lit.kind {
381381
let suffix = float_ty.name_str();
382-
unseparated_literal_suffix::check(cx, lit, &lit_snip, suffix, "float", self.literal_suffix_style);
382+
literal_suffix::check(cx, lit, &lit_snip, suffix, "float", self.literal_suffix_style);
383383
}
384384
}
385385
}

tests/ui-toml/separated_literal_suffix/literal_suffix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::unseparated_literal_suffix)]
1+
#![warn(clippy::literal_suffix)]
22

33
fn main() {
44
let _ = 123i32; // warns

tests/ui-toml/separated_literal_suffix/literal_suffix.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: integer type suffix should be separated by an underscore
44
LL | let _ = 123i32; // warns
55
| ^^^^^^ help: add an underscore: `123_i32`
66
|
7-
= note: `-D clippy::unseparated-literal-suffix` implied by `-D warnings`
7+
= note: `-D clippy::literal-suffix` implied by `-D warnings`
88

99
error: aborting due to previous error
1010

tests/ui-toml/unseparated_literal_suffix/literal_suffix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::unseparated_literal_suffix)]
1+
#![warn(clippy::literal_suffix)]
22

33
fn main() {
44
let _ = 123i32;

tests/ui-toml/unseparated_literal_suffix/literal_suffix.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: integer type suffix should not be separated by an underscore
44
LL | let _ = 123_i32; // warns
55
| ^^^^^^^ help: remove the underscore: `123_`
66
|
7-
= note: `-D clippy::unseparated-literal-suffix` implied by `-D warnings`
7+
= note: `-D clippy::literal-suffix` implied by `-D warnings`
88

99
error: aborting due to previous error
1010

tests/ui/literals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#![warn(clippy::mixed_case_hex_literals)]
44
#![warn(clippy::zero_prefixed_literal)]
5-
#![allow(clippy::unseparated_literal_suffix)]
5+
#![allow(clippy::literal_suffix)]
66
#![allow(dead_code)]
77

88
fn main() {

0 commit comments

Comments
 (0)