Skip to content

Commit 7e04a3d

Browse files
committed
Revert "Rename lint unseparated_literal_suffix -> literal_suffix"
This reverts commit f8f47e108790c0fbc3274544494fa2c3231a76d7.
1 parent 5a51745 commit 7e04a3d

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2799,7 +2799,6 @@ Released 2018-09-13
27992799
[`let_underscore_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
28002800
[`let_unit_value`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
28012801
[`linkedlist`]: https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist
2802-
[`literal_suffix`]: https://rust-lang.github.io/rust-clippy/master/index.html#literal_suffix
28032802
[`logic_bug`]: https://rust-lang.github.io/rust-clippy/master/index.html#logic_bug
28042803
[`lossy_float_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#lossy_float_literal
28052804
[`macro_use_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#macro_use_imports
@@ -3057,6 +3056,7 @@ Released 2018-09-13
30573056
[`unsafe_derive_deserialize`]: https://rust-lang.github.io/rust-clippy/master/index.html#unsafe_derive_deserialize
30583057
[`unsafe_removed_from_name`]: https://rust-lang.github.io/rust-clippy/master/index.html#unsafe_removed_from_name
30593058
[`unsafe_vector_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#unsafe_vector_initialization
3059+
[`unseparated_literal_suffix`]: https://rust-lang.github.io/rust-clippy/master/index.html#unseparated_literal_suffix
30603060
[`unsound_collection_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#unsound_collection_transmute
30613061
[`unstable_as_mut_slice`]: https://rust-lang.github.io/rust-clippy/master/index.html#unstable_as_mut_slice
30623062
[`unstable_as_slice`]: https://rust-lang.github.io/rust-clippy/master/index.html#unstable_as_slice

clippy_lints/src/misc_early/mod.rs

Lines changed: 5 additions & 5 deletions
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;
43
mod mixed_case_hex_literals;
54
mod redundant_pattern;
65
mod unneeded_field_pattern;
76
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 LITERAL_SUFFIX,
145+
pub UNSEPARATED_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-
LITERAL_SUFFIX,
282+
UNSEPARATED_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-
literal_suffix::check(cx, lit, &lit_snip, suffix, "integer", self.literal_suffix_style);
372+
unseparated_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-
literal_suffix::check(cx, lit, &lit_snip, suffix, "float", self.literal_suffix_style);
382+
unseparated_literal_suffix::check(cx, lit, &lit_snip, suffix, "float", self.literal_suffix_style);
383383
}
384384
}
385385
}

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

Lines changed: 3 additions & 3 deletions
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, LITERAL_SUFFIX};
6+
use super::{LiteralSuffixStyle, UNSEPARATED_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-
LITERAL_SUFFIX,
35+
UNSEPARATED_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-
LITERAL_SUFFIX,
46+
UNSEPARATED_LITERAL_SUFFIX,
4747
lit.span,
4848
&format!("{} type suffix should not be separated by an underscore", sugg_type),
4949
"remove the underscore",

tests/ui-toml/separated_literal_suffix/literal_suffix.rs

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

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

tests/ui-toml/separated_literal_suffix/literal_suffix.stderr

Lines changed: 1 addition & 1 deletion
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::literal-suffix` implied by `-D warnings`
7+
= note: `-D clippy::unseparated-literal-suffix` implied by `-D warnings`
88

99
error: aborting due to previous error
1010

tests/ui-toml/unseparated_literal_suffix/literal_suffix.rs

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

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

tests/ui-toml/unseparated_literal_suffix/literal_suffix.stderr

Lines changed: 1 addition & 1 deletion
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::literal-suffix` implied by `-D warnings`
7+
= note: `-D clippy::unseparated-literal-suffix` implied by `-D warnings`
88

99
error: aborting due to previous error
1010

tests/ui/literals.rs

Lines changed: 1 addition & 1 deletion
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::literal_suffix)]
5+
#![allow(clippy::unseparated_literal_suffix)]
66
#![allow(dead_code)]
77

88
fn main() {

0 commit comments

Comments
 (0)