about summary refs log tree commit diff
path: root/src/libstd/sys/unix/process/process_unix.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-05-31 18:01:40 +0000
committerbors <bors@rust-lang.org>2020-05-31 18:01:40 +0000
commit9fdcb13edb4026d1058c793a553f1798c044870c (patch)
tree63b47bf0efd2943bba7bf6d0f4e31386015b7db3 /src/libstd/sys/unix/process/process_unix.rs
parentfcc3ed2cdc442b4d3b8f1cb2be5ef7686ff89b3c (diff)
parent77dd0ea62aa6a2af70da4c5e05de064eee182a6c (diff)
downloadrust-9fdcb13edb4026d1058c793a553f1798c044870c.tar.gz
rust-9fdcb13edb4026d1058c793a553f1798c044870c.zip
Auto merge of #4455 - flip1995:unit_arg_appl, r=phansch
Rework suggestion generation of `unit_arg` lint

Found this bug while running `cargo fix --clippy` on quite a big codebase:

This would replace something like:
```rust
Some(fn_that_actually_does_something(&a, b))
```
with
```rust
Some(())
```
which obviously suppresses side effects.

Since pretty much every expression could have side effects, I think making this suggestion `MaybeIncorrect` is the best thing to do here.

A correct suggestion would be:

```rust
fn_that_actually_does_something(&a, b);
Some(())
```

Somehow the suggestion is not correctly applied to the arguments, when more than one argument is a unit value. I have to look into this a little more, though.

changelog: Fixes suggestion of `unit_arg` lint, so that it suggests semantic equivalent code

Fixes #4741
Diffstat (limited to 'src/libstd/sys/unix/process/process_unix.rs')
0 files changed, 0 insertions, 0 deletions