about summary refs log tree commit diff
path: root/clippy_lints/src/literal_representation.rs
AgeCommit message (Collapse)AuthorLines
2020-01-13Rustup to rust-lang/rust#68045Yuki Okushi-1/+2
2020-01-11Rustup to rust-lang/rust#67806Yuki Okushi-3/+2
2019-12-31Rustup to rust-lang/rust#67707Yuki Okushi-2/+2
2019-12-26Do not drop suffixes on `decimal_literal_representation`Yuki Okushi-1/+1
2019-12-24do minor cleanupsLzu Tao-1/+0
* ToString and AsRef are in prelude, no need to import them
2019-12-04Rustup to rust-lang/rust#66878Matthias Krüger-1/+2
2019-11-14literal repr: ignore more warnings in macrosMichael Wright-7/+17
2019-11-14literal representation: simplificationMichael Wright-1/+1
Simplify calculation in grouping. Add test case to ensure `count()` can't be zero in that branch.
2019-11-13literal representation restructure 12Michael Wright-7/+13
Export function for formatting literals and remove crate visibility from other items.
2019-11-13literal representation restructure 11Michael Wright-14/+14
Rename `grouping_hint` to `format` and use the term consistently.
2019-11-13literal representation restructure 10Michael Wright-21/+21
Rename DigitInfo to NumericLiteral
2019-11-13literal representation restructure 9Michael Wright-76/+85
Only store valid suffixes (and not mistyped suffixes) in DigitInfo. Check for mistyped suffixes later and not when DigitInfo is created. This opens the door to more sophisticated mistyped suffix checks later.
2019-11-13literal representation restructure 8Michael Wright-29/+37
Store the digit parts directly in DigitInfo since we need them anyway.
2019-11-13literal representation restructure 7Michael Wright-39/+28
Replace `do_lint` with `get_group_size`. Return `None` if there are no groups.
2019-11-13literal representation restructure 6Michael Wright-40/+35
Add `group_digits` helper function.
2019-11-13literal representation restructure 5Michael Wright-29/+14
Use `split_digit_parts` in `check_lit`.
2019-11-13literal representation restructure 4Michael Wright-64/+86
Simplify `grouping_hint` by splitting digits into parts and handling one at a time. Fixes #4762
2019-11-13literal representation restructure 3Michael Wright-9/+10
Move suffix check into `check_lit` so that it isn't done repeatedly.
2019-11-13literal representation restructure 2Michael Wright-46/+42
Consolidate warning handling using "poor man's try".
2019-11-13literal representation restructure 1Michael Wright-52/+48
Combine macro expansion checks. Indentation is a little strange to avoid rustfmt issue.
2019-11-10Fix `to_digit_is_some` dogfood errorsMichael Wright-3/+3
2019-11-07Auto merge of #4758 - mikerite:dec_lit_20191031, r=flip1995bors-6/+1
`DecimalLiteralRepresentation` simplification Remove recalculation of literal value. changelog: none
2019-11-07Rustup to rust-lang/rust#65884flip1995-1/+1
2019-10-31`DecimalLiteralRepresentation` simplificationMichael Wright-6/+1
Remove recalculation of literal value.
2019-10-15Add a new lint for unused selfJames Wang-2/+2
2019-10-14new lints around `#[must_use]` fnsAndre Bogus-0/+9
`must_use_unit` lints unit-returning functions with a `#[must_use]` attribute, suggesting to remove it. `double_must_use` lints functions with a plain `#[must_use]` attribute, but which return a type which is already `#[must_use]`, so the attribute has no benefit. `must_use_candidate` is a pedantic lint that lints functions and methods that return some non-unit type that is not already `#[must_use]` and suggests to add the annotation.
2019-10-03Correctly align doc of mistyped literal suffixesMatthias Seiffert-3/+3
2019-09-27Rustup to rust-lang/rust#64813flip1995-4/+4
2019-07-31Update all the code to pass the updated `use_self` lint.Jakub Wieczorek-7/+7
One struct required a temporary `#[allow(dead_code)]` annotation due to a bug in the Rust compiler: https://github.com/rust-lang/rust/issues/63151.
2019-05-15Add macro check for unreadable_literal lintflip1995-6/+7
Closes #4094
2019-04-17Use lint pass macrosMatthew Kraai-30/+12
Fixes #3917.
2019-04-10Refactor check_lit methodPhilipp Hansch-17/+13
2019-04-10Code formatting/cleanupPhilipp Hansch-4/+1
2019-04-08Fix ICE in decimal_literal_representation lintPhilipp Hansch-9/+13
Handling the integer parsing properly instead of just unwrapping. Note that the test is not catching the ICE because plain UI tests [currently hide ICEs][compiletest_issue]. Once that issue is fixed, this test would fail properly again. [compiletest_issue]: https://github.com/laumann/compiletest-rs/issues/169
2019-03-10Various cosmetic improvements.Alexander Regueiro-1/+1
2019-03-05fix or ignore failing doc testsAndy Russell-4/+4
2019-03-05move lint documentation into macro invocationsAndy Russell-64/+64
2019-01-27rustup https://github.com/rust-lang/rust/pull/57726Matthias Krüger-0/+8
2019-01-08Remove all copyright license headersPhilipp Hansch-9/+0
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
2018-12-29Remove crate:: prefixes from crate pathsKonrad Borowski-5/+5
This is somewhat misleading, as those are actually external crates, and don't need a crate:: prefix.
2018-12-01Downgrade large_digit_groups to pedanticDavid Tolnay-1/+1
I believe if the user already decided to put underscores in their literal, Clippy should be willing to believe that they put a number of underscores that they felt was readable.
2018-11-27Run rustfmt on clippy_lintsflip1995-3/+5
2018-11-27Change Applicability of MISTYPED_LITERAL_SUFFIXflip1995-1/+1
2018-11-27Add applicability level to (nearly) every span_lint_and_sugg functionflip1995-5/+5
2018-11-27Add Applicability::Unspecified to span_lint_and_sugg functionsflip1995-0/+6
2018-11-05Merge #3353bors[bot]-62/+94
3353: float support added for mistyped_literal_suffixes lint r=mikerite a=Maxgy I implemented the mistyped_literal_suffixes lint for float literals. ``` #![allow(unused_variables)] fn main() { let x = 1E2_32; let x = 75.22_64; } ``` Given the above, the additional check suggests the variables to be written as `let x = 1E2_f32` and `let x = 75.22_f64`. Fixes #3167 Co-authored-by: Maxwell Anderson <maxwell.brayden.anderson@gmail.com>
2018-11-04changed into_iter to iter and fixed a lint checkMaxwell Anderson-3/+3
2018-11-02Fix dogfood error.kennytm-3/+3
2018-11-01format codeMaxwell Anderson-2/+2
2018-11-01fix comment spacingMaxwell Anderson-2/+4