diff options
| author | Philipp Krones <hello@philkrones.com> | 2020-04-08 15:50:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-08 15:50:16 +0200 |
| commit | 935b45db61e9906c8371718af3fca101dc3ce376 (patch) | |
| tree | 61c1f691821dbc9518d25fd18d55f2a78d391810 /src/rustllvm/CoverageMappingWrapper.cpp | |
| parent | 46337cb6a8bfe37474f4b7ef7bd0a99b36ce0b80 (diff) | |
| parent | adcaa1b86ddbf51659d5f7e4e7471427682649ba (diff) | |
| download | rust-935b45db61e9906c8371718af3fca101dc3ce376.tar.gz rust-935b45db61e9906c8371718af3fca101dc3ce376.zip | |
Rollup merge of #5409 - dtolnay:letunit, r=flip1995
Downgrade let_unit_value to pedantic
Given that the false positive in #1502 is marked E-hard and I don't have much hope of it getting fixed, I think it would be wise to disable this lint by default. I have had to suppress this lint in every substantial codebase (\>100k line) I have worked in. Any time this lint is being triggered, it's always the false positive case.
The motivation for this lint is documented as:
> A unit value cannot usefully be used anywhere. So binding one is kind of pointless.
with this example:
> ```rust
> let x = {
> 1;
> };
> ```
Sure, but the author would find this out via an unused_variable warning or from `x` not being the type that they need further down. If there ends up being a type error on `x`, clippy's advice isn't going to help get the code compiling because it can only run if the code already compiles.
changelog: Remove let_unit_value from default set of enabled lints
Diffstat (limited to 'src/rustllvm/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
