forked from rust-lang/rust-clippy
-
Notifications
You must be signed in to change notification settings - Fork 2
Update 1.74 custom lints #37
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
Closed
J-ZhengLi
wants to merge
181
commits into
open-rust-initiative:master
from
J-ZhengLi:update_1.74_custom_lints
Closed
Update 1.74 custom lints #37
J-ZhengLi
wants to merge
181
commits into
open-rust-initiative:master
from
J-ZhengLi:update_1.74_custom_lints
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Update Clippy r? `@Manishearth`
[`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]>
Signed-off-by: J-ZhengLi <[email protected]>
Signed-off-by: J-ZhengLi <[email protected]>
Signed-off-by: J-ZhengLi <[email protected]>
…ui test Signed-off-by: J-ZhengLi <[email protected]>
Signed-off-by: J-ZhengLi <[email protected]>
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]>
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]>
Signed-off-by: J-ZhengLi <[email protected]>
…_dereference`]; 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]>
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]>
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]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
changelog: none