Look at adjusted types instead of fn signature types in ptr_arg#13313
Merged
bors merged 1 commit intorust-lang:masterfrom Sep 13, 2024
Merged
Look at adjusted types instead of fn signature types in ptr_arg#13313bors merged 1 commit intorust-lang:masterfrom
ptr_arg#13313bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
Contributor
|
☔ The latest upstream changes (presumably #13347) made this pull request unmergeable. Please resolve the merge conflicts. |
Centri3
approved these changes
Sep 13, 2024
Member
Centri3
left a comment
There was a problem hiding this comment.
Looks perfect, just one thing!
Member
|
Thanks! @bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
notmandatory
added a commit
to bitcoindevkit/bdk
that referenced
this pull request
Dec 16, 2024
notmandatory
added a commit
to bitcoindevkit/bdk
that referenced
this pull request
Dec 16, 2024
notmandatory
added a commit
to zoedberg/bdk
that referenced
this pull request
Jan 6, 2025
ubbabeck
pushed a commit
to ubbabeck/bdk
that referenced
this pull request
Jul 16, 2025
ubbabeck
pushed a commit
to ubbabeck/bdk
that referenced
this pull request
Jul 16, 2025
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.
This simplifies the implementation of the
ptr_arglint a bit and:Fixes #13308
Fixes #10612
Currently, the lint checks if e.g. a
&Stringparameter is only used in contexts where a&strcould work. Part of it worked by looking for path exprs to that parameter in function call position specifically, looking at the callee signature and checking if that parameter type without refs isString(or one of a bunch of other special cases).This simplified version removes the special casing of function calls and looking at the parameter type and instead just looks at the adjusted type, regardless of the expression it's in. This naturally also covers what the previous version was doing (if the expression is in a function call argument position expecting a
&str, then it will have that adjustment. If it requires a&Stringthen it won't have that adjustment and we won't lint).The linked issue was a FP that happened because the previous implementation simply didn't consider projection types in the signature type, but with this simplification we don't really need to consider that (because we aren't looking at function signatures at all anymore -- the
&mut Self::Ownedparameter type ofclone_intois the already-instantiated and normalized type&mut String).changelog: none