fix(useless_conversion): ignore From::from in generated code - #17583
Open
NicDevTV wants to merge 1 commit into
Open
fix(useless_conversion): ignore From::from in generated code#17583NicDevTV wants to merge 1 commit into
NicDevTV wants to merge 1 commit into
Conversation
Collaborator
|
Thanks for the pull request, and welcome! You should hear from one of our reviewers after this PR gets at least 2 reviews from the community. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
CommanderStorm
suggested changes
Aug 17, 2026
CommanderStorm
approved these changes
Aug 17, 2026
NicDevTV
force-pushed
the
fix/useless-conversion-generated-code
branch
from
August 17, 2026 20:57
12684da to
1e9b5e4
Compare
Author
|
like this @CommanderStorm ? |
Contributor
|
yes, tnx |
Member
|
Hello @NicDevTV, seems that an LLM assisted in this PR, we require disclosure as per the LLM policy |
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
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.
Summary
useless_conversionreported false positives for redundantFrom::fromcalls inside#[automatically_derived]implementations involving generic associated types.This change skips that specific lint case for automatically derived code while preserving the existing behavior for regular code and other conversion methods. A regression UI test based on #17083 was added.
Testing
cargo fmt --all -- --checkgit diff --checkuseless_conversionUI testsui-tomltest suiteThe complete
cargo testsuite could not be run locally because some dependencies were unavailable in the offline environment.changelog: [
useless_conversion]: Avoid linting redundantFrom::fromconversions in automatically derived implementations.fixes #17083