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

Update Clippy #81993

Merged
merged 99 commits into from
Feb 18, 2021
Merged

Update Clippy #81993

merged 99 commits into from
Feb 18, 2021

Conversation

flip1995
Copy link
Member

Biweekly Clippy update

r? @Manishearth

nahuakang and others added 30 commits February 1, 2021 16:49
This commit fixes the file names of the `flat_map_identity` test.
Previously, their names were started with `unnecessary_flat_map` even
though the lint rule name is `flat_map_identity`. This inconsistency
happened probably because the rule name was changed during the
discussion in the PR where this rule was introduced.

ref: rust-lang/rust-clippy#4231
Fix file names of flat_map_identity test

This patch fixes the file names of the `flat_map_identity` test.
Previously, their names were started with `unnecessary_flat_map` even though the lint rule name is `flat_map_identity`. This inconsistency happened probably because the rule name was changed during the discussion in the PR where this rule was introduced.

ref: rust-lang/rust-clippy#4231

changelog: none
…sults, r=flip1995

New Lint: Manual Flatten

This is a draft PR for [Issue 6564](rust-lang/rust-clippy#6564).

r? `@camsteffen`

- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`

---

*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: Add new lint [`manual_flatten`] to check for loops over a single `if let` expression with `Result` or `Option`.
In other words, support:

`disallowed_methods = ["alloc::vec::Vec::new"]` (a free function) in
addition to
`disallowed_methods = ["alloc::vec::Vec::leak"]` (a method).

Improve the documentation to clarify that users must specify the full
qualified path for each disallowed function, which can be confusing for
reexports. Include an example `clippy.toml`.

Simplify the actual lint pass so we can reuse `utils::fn_def_id`.
This will convert the path to the Rust repo to an absolute path. This is
important for the clippy_lints/Cargo.toml file. Otherwise if a relative
path is passed, rst-analyzer won't find the Rust repo, because it starts
the relative path search from the clippy_lints dir, not the
rust-clippy dir where the ra_setup command was run from.
Fix typo

This patch fixes a typo.

changelog: none
Use absolute path to Rust repo in ra_setup

This will convert the path to the Rust repo to an absolute path. This is
important for the clippy_lints/Cargo.toml file. Otherwise if a relative
path is passed, rst-analyzer won't find the Rust repo, because it starts
the relative path search from the clippy_lints dir, not the
rust-clippy dir where the ra_setup command was run from.

changelog: none
This fixes false positives and false negatives.
… inside the rustc repo.

Do not check if clippy version matches rustc version when runnning tests inside the rustc repo.
This makes sure that upstream rustc maintainers do not have to deal with our test failing/mismatching versions
when the rustc version bump is happening.
cc rust-lang#6683
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 11, 2021
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 11, 2021

📌 Commit d2e2f64 has been approved by Manishearth

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 11, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 16, 2021
Update Clippy

Biweekly Clippy update

r? ``@Manishearth``
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 16, 2021
Update Clippy

Biweekly Clippy update

r? ```@Manishearth```
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 17, 2021
Update Clippy

Biweekly Clippy update

r? ````@Manishearth````
@flip1995
Copy link
Member Author

This is stuck in q for almost a week now. Prioritize? @Manishearth

@Manishearth
Copy link
Member

@bors p=3

@bors
Copy link
Contributor

bors commented Feb 17, 2021

⌛ Testing commit d2e2f64 with merge 93f6a4b...

@bors
Copy link
Contributor

bors commented Feb 18, 2021

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 93f6a4b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 18, 2021
@bors bors merged commit 93f6a4b into rust-lang:master Feb 18, 2021
@rustbot rustbot added this to the 1.52.0 milestone Feb 18, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  CACHE_DOMAIN: ci-caches.rust-lang.org
  TOOLSTATE_REPO_ACCESS_TOKEN: ***
##[endgroup]
Cloning into 'rust-toolstate'...
/home/runner/work/rust/rust/src/tools/publish_toolstate.py:121: DeprecationWarning: 'U' mode is deprecated
📣 Toolstate changed by rust-lang/rust#81993!

Tested on commit rust-lang/rust@93f6a4b9d85b7eef71e17d95c113f5834238b574.
Direct link to PR: <https://github.com/rust-lang/rust/pull/81993>

💔 miri on windows: test-fail → build-fail (cc @RalfJung @oli-obk @eddyb).
💔 miri on linux: test-fail → build-fail (cc @RalfJung @oli-obk @eddyb).

  with open(path, 'rU') as f:
Traceback (most recent call last):
  File "/home/runner/work/rust/rust/src/tools/publish_toolstate.py", line 338, in <module>
    response = urllib2.urlopen(urllib2.Request(
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 522, in open
    req = meth(req)
  File "/usr/lib/python3.8/urllib/request.py", line 1281, in do_request_
    raise TypeError(msg)
TypeError: POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.
##[error]Process completed with exit code 1.

@flip1995 flip1995 deleted the clippyup branch February 18, 2021 08:44
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 25, 2021
Update Clippy

Biweekly Clippy update

r? `@Manishearth`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.