-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 cfg_match!
to cfg_select!
#137198
base: master
Are you sure you want to change the base?
Rename cfg_match!
to cfg_select!
#137198
Conversation
At [1] it was pointed out that `cfg_match!` syntax does not actually align well with match syntax, which is a possible source of confusion. The comment points out that usage is instead more similar to ecosystem `select!` macros. Rename `cfg_match!` to `cfg_select!` to match this. Tracking issue: rust-lang#115585 [1]: rust-lang#115585 (comment)
rustbot has assigned @Mark-Simulacrum. Use |
Some changes occurred in compiler/rustc_codegen_gcc Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
r? libs-api |
Nominating for discussion. |
Speaking for myself only: not in favor of this rename. |
☔ The latest upstream changes (presumably #137237) made this pull request unmergeable. Please resolve the merge conflicts. |
From the meeting notes, TC mentioned |
That is what I always called the macro myself, in my versions. It's probably the most correct PL theory name for the construct.
match () {
_ if predicate1 => ..,
_ if predicate2 => ..,
_ if predicate3 => ..,
_ => ..,
} (That is, as So it's in that sense that I think |
I don't have a strong opinion here only that having "match" in the name when it is notably different to |
@Nemo157 pointed out that
cfg_match!
syntax does not actually align well with match syntax, which is a possible source of confusion. The comment points out that usage is instead more similar to ecosystemselect!
macros. Renamecfg_match!
tocfg_select!
to match this.Tracking issue: #115585