Rename rustc::pass_by_value lint as rustc::disallowed_pass_by_ref.#153029
Rename rustc::pass_by_value lint as rustc::disallowed_pass_by_ref.#153029nnethercote wants to merge 1 commit intorust-lang:mainfrom
rustc::pass_by_value lint as rustc::disallowed_pass_by_ref.#153029Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
pass_by_value lint as disallowed_pass_by_ref.rustc::pass_by_value lint as rustc::disallowed_pass_by_ref.
|
BTW, I'm not 100% certain about how I handled bootstrapping. It seems reasonable but I couldn't find any other examples in the code that looked quite the same as what I did. |
There was a problem hiding this comment.
Code looks fine.
Regarding the lint name in the face of our guidelines, and in particular rule 2, I'm wondering if it shouldn't be named: rustc::disallowed_pass_by_ref_types.
Though that seems a bit long, maybe we can just remove the pass part and have rustc::disallowed_by_ref_types. What do you think?
|
I think the |
|
I'm fine with that. |
|
@bors r+ rollup |
…, r=Urgau Rename `rustc::pass_by_value` lint as `rustc::disallowed_pass_by_ref`. The name `pass_by_value` is completely wrong. The lint actually checks for the use of pass by reference for types marked with `rustc_pass_by_value`. The hardest part of this was choosing the new name. The `disallowed_` part of the name closely matches the following clippy lints: - `disallowed_macros` - `disallowed_methods` - `disallowed_names` - `disallowed_script_idents` - `disallowed_types` The `pass_by_value` part of the name aligns with the following clippy lints: - `needless_pass_by_value` - `needless_pass_by_ref_mut` - `trivially_copy_pass_by_ref` - `large_types_passed_by_value` (less so) r? @Urgau
|
For the record: @Urgau and I had a private discussion about the names. We both liked |
Rollup of 8 pull requests Successful merges: - #149169 (ptr::replace: make calls on ZST null ptr not UB) - #150562 (Fix doc link used in suggestion for pinning self) - #152679 (rustc_expand: improve diagnostics for non-repeatable metavars) - #153017 (Implement debuginfo for unsafe binder types) - #152868 (delete some very old trivial `Box` tests) - #152922 (rustc_public: Make fields that shouldn't be exposed visible only in `rustc_public`) - #153029 (Rename `rustc::pass_by_value` lint as `rustc::disallowed_pass_by_ref`.) - #153051 (Migration of `LintDiagnostic` - part 3)
The name `pass_by_value` is completely wrong. The lint actually checks for the use of pass by reference for types marked with `rustc_pass_by_value`. The hardest part of this was choosing the new name. The `disallowed_` part of the name closely matches the following clippy lints: - `disallowed_macros` - `disallowed_methods` - `disallowed_names` - `disallowed_script_idents` - `disallowed_types` The `pass_by_value` part of the name aligns with the following clippy lints: - `needless_pass_by_value` - `needless_pass_by_ref_mut` - `trivially_copy_pass_by_ref` - `large_types_passed_by_value` (less so)
d60e15f to
8eed8bd
Compare
|
I added a temporary @bors r=Urgau |
The name
pass_by_valueis completely wrong. The lint actually checks for the use of pass by reference for types marked withrustc_pass_by_value.The hardest part of this was choosing the new name. The
disallowed_part of the name closely matches the following clippy lints:disallowed_macrosdisallowed_methodsdisallowed_namesdisallowed_script_identsdisallowed_typesThe
pass_by_valuepart of the name aligns with the following clippy lints:needless_pass_by_valueneedless_pass_by_ref_muttrivially_copy_pass_by_reflarge_types_passed_by_value(less so)r? @Urgau