Skip to content
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

Rename fn_args_layout -> fn_params_layout #5387

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

ytmimi
Copy link
Contributor

@ytmimi ytmimi commented Jun 16, 2022

fn_args_layout was renamed fn_params_layout to better communicate that it affects the layout of parameters in function signatures and not the layout of arguments in function calls.

Because the fn_args_layout is a stable option the renamed option is also stable, however users who set fn_args_layout will get a warning message letting them know that the option has been renamed.

Closes #4149

@ytmimi
Copy link
Contributor Author

ytmimi commented Jun 16, 2022

This would backport #4163

@ytmimi ytmimi force-pushed the fn_params_layout branch 3 times, most recently from cf5cb60 to d854403 Compare June 16, 2022 14:23
fn set_fn_args_layout(&mut self) {
if self.was_set().fn_args_layout() {
eprintln!(
"Warning: the `fn_args_layout` option was renamed to `fn_params_layout`."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also mention that the old option has been deprecated, similar to what we do for other such renames?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! I'll make sure to include those details.

@@ -645,7 +645,7 @@ trailing whitespaces.

## `fn_args_layout`

Control the layout of arguments in a function
This option has been renamed to `fn_params_layout` to better communicate that it affects the layout of parameters in function signatures.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also mention that the old option has been deprecated, similar to what we do for other such renames?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the docs to include the deprecation notice!

fn_args_layout is now deprecated.

This option was renamed to better communicate that it affects the layout
of parameters in function signatures and not the layout of arguments in
function calls.

Because the `fn_args_layout` is a stable option the renamed option is
also stable, however users who set `fn_args_layout` will get a warning
message letting them know that the option has been renamed.
@ytmimi ytmimi force-pushed the fn_params_layout branch from d854403 to e7eece3 Compare July 12, 2022 00:20
@calebcartwright
Copy link
Member

Do you think it would be helpful to include some textual description for each variant in the corresponding section on the config docs? The code snippets are fine, but I think a sentence or two that captures behavior which may be non-obvious (e.g. there must be 2+ params for...) would be helpful.

@ytmimi
Copy link
Contributor Author

ytmimi commented Jul 12, 2022

Good call! I'm all for updating the descriptions to include as much detail as possible. I'll make those tweak sometime later this week

@calebcartwright
Copy link
Member

Good call! I'm all for updating the descriptions to include as much detail as possible. I'll make those tweak sometime later this week

Excellent, thank you. I realize that was an add-on request to the original scope of this PR so I'm going to go ahead and merge. Feel free to submit a follow up with proposed doc enhancements

@calebcartwright calebcartwright added release-notes Needs an associated changelog entry and removed pr-waiting-on-author labels Jul 13, 2022
@calebcartwright calebcartwright merged commit 0cb294f into rust-lang:master Jul 13, 2022
@ytmimi ytmimi deleted the fn_params_layout branch August 7, 2022 15:25
@calebcartwright calebcartwright removed the release-notes Needs an associated changelog entry label Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename fn_args_layout config option
2 participants