Skip to content

Replace cfg_if! macro with cfg_select! fallback#740

Open
clarfonthey wants to merge 1 commit into
rust-lang:mainfrom
clarfonthey:cfg_select
Open

Replace cfg_if! macro with cfg_select! fallback#740
clarfonthey wants to merge 1 commit into
rust-lang:mainfrom
clarfonthey:cfg_select

Conversation

@clarfonthey

Copy link
Copy Markdown
Contributor

Note: I probably could have tried harder to make the macro work with the _ fallback syntax, but I didn't care enough.

The main benefit this gives is rustfmt support; cfg_select! is properly formatted, unlike cfg_if!. Additionally, it makes migrating when we eventually bump MSRV easier.

Comment thread src/macros.rs
}
};

// match if/else chains lacking a final `else`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We actually never used this branch, but I guess we wanted it for completeness.

@clarfonthey
clarfonthey force-pushed the cfg_select branch 2 times, most recently from 2d67e6d to 38ce1ef Compare July 17, 2026 17:35
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.

1 participant