Fix has_no_input_arg check and rename it to has_only_self_parameter#71270
Fix has_no_input_arg check and rename it to has_only_self_parameter#71270bors merged 1 commit intorust-lang:masterfrom
has_no_input_arg check and rename it to has_only_self_parameter#71270Conversation
|
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc_typeck/check/demand.rs
Outdated
There was a problem hiding this comment.
I am confusing about this comment, is this correct?
There was a problem hiding this comment.
It's a confusing comment. And the name of the function is also probably wrong. cc @estebank
There was a problem hiding this comment.
I think maybe the function actually wants to do is to check that the function only has a self arg and no other args.
There was a problem hiding this comment.
This code seems to only be used for suggestions to convert a type in a whitelist, so I think the "has no input arg" should be read/rewritten as "check that this associated item can be called without any additional arguments, like <&str>::to_string(self)". Feel free to rewrite the docstring and method name.
The code change seems correct, r=me on that.
61ac0dc to
8a32e51
Compare
Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> rename has_no_input_arg to has_only_self_parameter Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
8a32e51 to
7c28dfe
Compare
has_no_input_arg function has self checkhas_no_input_arg to has_only_self_parameter
has_no_input_arg to has_only_self_parameterhas_no_input_arg check and rename it to has_only_self_parameter
has_no_input_arg check and rename it to has_only_self_parameterhas_no_input_arg check and rename it to has_only_self_parameter
|
@bors r+ rollup |
|
📌 Commit 7c28dfe has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#71250 (Replace big JS dict with JSON parsing) - rust-lang#71270 (Fix `has_no_input_arg` check and rename it to `has_only_self_parameter`) - rust-lang#71284 (fix -Zast-json to output correct JSON form) - rust-lang#71328 (Stabilize PathBuf capacity methods) - rust-lang#71334 (Update pattern docs.) Failed merges: r? @ghost
Signed-off-by: Rustin-Liu rustin.liu@gmail.com
Fixes #70643 (comment).