Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change naive_bytecount applicability to MaybeIncorrect #3984

Merged
merged 1 commit into from Apr 18, 2019

Conversation

Projects
None yet
3 participants
@phansch
Copy link
Collaborator

commented Apr 17, 2019

We can't use MachineApplicable here as applying the fix will cause
another error because bytecount would first have to be added to the
Cargo.toml.

Example:

error: You appear to be counting bytes the naive way
  --> $DIR/bytecount.rs:5:13
   |
LL |     let _ = x.iter().filter(|&&a| a == 0).count(); // naive byte count
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count(x, 0)`

Just replacing it with the suggestion is not enough.

cc #3630

Change naive_bytecount applicability MaybeIncorrect
We can't use `MachineApplicable` here as applying the fix will cause
another error because `bytecount` would first have to be added to the
Cargo.toml.

@phansch phansch changed the title Change naive_bytecount applicability MaybeIncorrect Change naive_bytecount applicability to MaybeIncorrect Apr 17, 2019

@phansch phansch referenced this pull request Apr 17, 2019

Open

Tracking Issue: Fixing broken lint suggestions #3630

30 of 39 tasks complete
@flip1995

This comment has been minimized.

Copy link
Collaborator

commented Apr 18, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

📌 Commit 01ea9bd has been approved by flip1995

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

⌛️ Testing commit 01ea9bd with merge b834dbb...

bors added a commit that referenced this pull request Apr 18, 2019

Auto merge of #3984 - phansch:bytecount_sugg, r=flip1995
Change naive_bytecount applicability to MaybeIncorrect

We can't use `MachineApplicable` here as applying the fix will cause
another error because `bytecount` would first have to be added to the
Cargo.toml.

Example:

```
error: You appear to be counting bytes the naive way
  --> $DIR/bytecount.rs:5:13
   |
LL |     let _ = x.iter().filter(|&&a| a == 0).count(); // naive byte count
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider using the bytecount crate: `bytecount::count(x, 0)`
```

Just replacing it with the suggestion is not enough.

cc #3630
@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing b834dbb to master...

@bors bors merged commit 01ea9bd into rust-lang:master Apr 18, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.