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

Clippy subtree update #116139

Merged
merged 123 commits into from
Sep 26, 2023
Merged

Clippy subtree update #116139

merged 123 commits into from
Sep 26, 2023

Conversation

flip1995
Copy link
Member

y21 and others added 30 commits September 2, 2023 22:55
Also stabilizes saturating_int_assign_impl, rust-langgh-92354.

And also make pub fns const where the underlying saturating_*
fns became const in the meantime since the Saturating type was
created.
…riddle,Manishearth,flip1995

Reuse rustdoc's doc comment handling in Clippy

Moves `source_span_for_markdown_range` and `span_of_attrs` (renamed to `span_of_fragments`) to `rustc_resolve::rustdoc` so it can be used in Clippy

Fixes rust-lang/rust-clippy#10277
Fixes rust-lang/rust-clippy#5593
Fixes rust-lang/rust-clippy#10263
Fixes rust-lang/rust-clippy#2581
new unnecessary_map_on_constructor lint

changelog: [`unnecessary_map_on_constructor`]: adds lint for cases in which map is not necessary. `Some(4).map(myfunction)` => `Some(myfunction(4))`

Closes rust-lang/rust-clippy#6472

Note that the case mentioned in the issue `Some(..).and_then(|..| Some(..))` is fixed by a chain of lint changes. This PR completes the last part of that chain.

By `bind_instead_of_map`[lint](https://rust-lang.github.io/rust-clippy/master/index.html#/bind_instead_of_map):
`Some(4).and_then(|x| Some(foo(4)))` => `Some(4).map(|x| foo)`

By `redundant_closure` [lint](https://rust-lang.github.io/rust-clippy/master/index.html#/redundant_closure):
`Some(4).map(|x| foo)` => `Some(4).map(fun)`

Finally by this PR `unnecessary_map_on_constructor`:
`Some(4).map(fun)` => `Some(fun(4))`

I'm not sure this is the desired behavior for clippy and if it should be addressed in another issue/PR. I'd be up to give it a try if that's the case.
…=dswij

Ignore span's parents in `collect_ast_format_args`/`find_format_args`

Fixes rust-lang#11470, covers some cases missed by rust-lang#10980

Can't have a test yet because of rust-lang#11126 but it works locally

changelog: none

r? `@dswij`
It is the last thing depending on syn 1.0 in clippy
[`len_without_is_empty`]: follow type alias to find inherent `is_empty` method

Fixes rust-lang#11165

When we see an `impl B` and `B` is a type alias to some type `A`, then we need to follow the type alias to look for an `is_empty` method on the aliased type `A`. Before this PR, it'd get the inherent impls of `B`, which there aren't any and so it would warn that there isn't an `is_empty` method even if there was one.
Passing the type alias `DefId` to `TyCtxt::type_of` gives us the aliased `DefId` (or simply return the type itself if it wasn't a type alias) so we can just use that

changelog: [`len_without_is_empty`]: follow type alias to find inherent `is_empty` method
Remove `derive_new` test dependency

It is the last thing depending on syn 1.0 in clippy

changelog: none
This fixes the changes brought to codegen tests when effect params are
added to libcore, by not attempting to monomorphize functions that get
the host param by being `const fn`.
…-obk

treat host effect params as erased in codegen

This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.

r? `@oli-obk`
bors and others added 16 commits September 23, 2023 04:41
…affleLapkin

Add a way to decouple the implementation and the declaration of a TyCtxt method.

properly addresses rust-lang#115819

accepted MCP: rust-lang/compiler-team#395
Add missing tests for configuration options

I noticed that a lot of lints didn't have test(s) for their configuration. This leads to issues like rust-lang#11481 where the lint just does nothing with it.

This PR adds tests for *almost*[^1] all of the lints with a configuration that didn't have a test in ui-toml.
The tests that I wrote here are usually two cases: one for where it's right above or under the limit set by the config where it shouldn't lint and another one for right above where it should.

changelog: none

[^1]: allow-one-hash-in-raw-strings is ignored by needless_raw_string_hashes
Co-authored-by: Timo <30553356+y21@users.noreply.github.com>
… r=y21

prevent ice when threshold is 0 and enum has no variants

changelog: [`enum_variant_names`]: prevent ice when threshold is 0 and enum has no variants

r? `@y21`

Fixes the same ice issue raised during review of rust-lang/rust-clippy#11496
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 25, 2023
@rustbot
Copy link
Collaborator

rustbot commented Sep 25, 2023

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 25, 2023

📌 Commit 6d331b7 has been approved by Manishearth

It is now in the queue for this repository.

@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 Sep 25, 2023
@bors
Copy link
Contributor

bors commented Sep 26, 2023

⌛ Testing commit 6d331b7 with merge d23062b...

@bors
Copy link
Contributor

bors commented Sep 26, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 26, 2023
@bors bors merged commit d23062b into rust-lang:master Sep 26, 2023
12 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 26, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d23062b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.8% [0.5%, 3.1%] 2
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-3.6%, -2.9%] 2
All ❌✅ (primary) 1.8% [0.5%, 3.1%] 2

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 632.394s -> 631.717s (-0.11%)
Artifact size: 317.19 MiB -> 317.30 MiB (0.04%)

@flip1995 flip1995 deleted the clippyup branch September 27, 2023 08:35
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.