-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
uplift clippy::clone_double_ref
as suspicious_double_ref_op
#110955
Conversation
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
9b5d0cd
to
5c99175
Compare
clippy::clone_double_ref
as suspicious_double_ref_ops
clippy::clone_double_ref
as suspicious_double_ref_op
This comment has been minimized.
This comment has been minimized.
r=me with that rustdoc fix |
This comment has been minimized.
This comment has been minimized.
0570950
to
e928067
Compare
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@bors r=compiler-errors |
compiler/rustc_lint/messages.ftl
Outdated
@@ -50,6 +50,9 @@ lint_deprecated_lint_name = | |||
lint_renamed_or_removed_lint = {$msg} | |||
.suggestion = use the new name | |||
|
|||
lint_suspicious_double_ref_op = | |||
using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op} the inner type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op} the inner type | |
using `.{$call}()` on a double reference, which returns `{$ty}` instead of {$op}, the inner type |
Correct me (a non-native speaker of english) if I'm wrong, but I think there needs to either be a comma, or it needs to be reodered instead of the inner type {$op}
. I think it's better to have the two types close to each other, so I prefer the variant with the comma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$op
is not a type. It is either "dereferencing", "borrowing", or "cloning" depending on the trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Those words should also be in the ftl file then however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right.. hmmmm. How should I do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose they don't have to? Since https://projectfluent.org/ shows that you can match on variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at the very least you should list it explicitly, so that translators know that there is only these options. From what I understand, the translation system was designed so that translators do not have to look at the source code at all.
{$op ->
*[should_not_happen] [{$op}]
[deref] dereferencing
[borrow] borrowing
[clone] cloning
}
How to pair that up with enums, I don't really know.
@bors r=compiler-errors |
…=compiler-errors uplift `clippy::clone_double_ref` as `suspicious_double_ref_op` Split from rust-lang#109842. r? `@compiler-errors`
Rollup of 7 pull requests Successful merges: - rust-lang#105076 (Refactor core::char::EscapeDefault and co. structures) - rust-lang#108161 (Add `ConstParamTy` trait) - rust-lang#108668 (Stabilize debugger_visualizer) - rust-lang#110512 (Fix elaboration with associated type bounds) - rust-lang#110895 (Remove `all` in target_thread_local cfg) - rust-lang#110955 (uplift `clippy::clone_double_ref` as `suspicious_double_ref_op`) - rust-lang#111048 (Mark`feature(return_position_impl_trait_in_trait)` and`feature(async_fn_in_trait)` as not incomplete) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…=compiler-errors uplift `clippy::clone_double_ref` as `suspicious_double_ref_op` Split from rust-lang#109842. r? ``@compiler-errors``
Split from #109842.
r? @compiler-errors