Skip to content

Conversation

@J-ZhengLi
Copy link

changelog: none

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

And also make pub fns const where the underlying saturating_*
fns became const in the meantime since the Saturating type was
created.
…nishearth,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#10277
Fixes rust-lang#5593
Fixes rust-lang#10263
Fixes rust-lang#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#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`.
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`
adjust `guidelines` lints configuration so that all configured function list will override existing ones;
move all configurable `guidelines` ui-toml tests into a single folder;

Signed-off-by: J-ZhengLi <[email protected]>
one false negative problem left to fix

Signed-off-by: J-ZhengLi <[email protected]>
and rewite using visitors for more in-depth detection

Signed-off-by: J-ZhengLi <[email protected]>
Signed-off-by: J-ZhengLi <[email protected]>
Signed-off-by: J-ZhengLi <[email protected]>
Signed-off-by: J-ZhengLi <[email protected]>
@J-ZhengLi J-ZhengLi closed this May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.