about summary refs log tree commit diff
path: root/compiler/rustc_mir/src/transform/coverage/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-12-06 07:18:33 +0000
committerbors <bors@rust-lang.org>2020-12-06 07:18:33 +0000
commitc1664c50b27a51f7a78c93ba65558e7c33eabee6 (patch)
treeb23436d5768f212305ff9fab0392144ce3084d04 /compiler/rustc_mir/src/transform/coverage/mod.rs
parent8d678bcd2aea2f27bb005a567a2364b3bf74e9b1 (diff)
parent898b7c594cfdf1eb56d24a4c6fa02678cf5029a8 (diff)
downloadrust-c1664c50b27a51f7a78c93ba65558e7c33eabee6.tar.gz
rust-c1664c50b27a51f7a78c93ba65558e7c33eabee6.zip
Auto merge of #6421 - xFrednet:4176-unreadable-literal-lint-fractal-option, r=Manishearth
Added a lint-fraction-readability flag to the configuration

This adds an option to disable the `unreadable_literal` lint for floats with a longer fraction. This allows users to write `0.100200300` without getting a warning. Fixes #4176

I have some open questions about this PR:
1. I've named the option `lint-fraction-readability` is this a good name or should I rename it to something else?
2. What should the default configuration value be?
    * The current default value is `true` as this was also the previous default.
3. Do I have to document this new option somewhere else or will it be extracted from the code comment?
4. The current fix option will also rewrite the fraction if the integer part violates the `unreadable_literal` lint it would otherwise also trigger the `inconsistent_digit_grouping` lint. Is this also okay?
    * `1.100200300` will be unaffected by the fix function
    * `100200300.100200300` will be effected and fixed to `100_200_300.100_200_300`

---

The project needed some getting used to but I'm happy with the result. A big thank you to `@flip1995` for giving me some pointers for this implementation and to everyone for the great introduction documentation!

---

changelog: Added the `unreadable-literal-lint-fractions` configuration to disable the `unreadable_literal` lint for fractions
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions