-
Notifications
You must be signed in to change notification settings - Fork 13.7k
library: Migrate from cfg_if
to cfg_select
#145489
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
base: master
Are you sure you want to change the base?
Conversation
rustbot has assigned @Mark-Simulacrum. Use |
This comment was marked as outdated.
This comment was marked as outdated.
bc7d167
to
edeadb0
Compare
This comment has been minimized.
This comment has been minimized.
Migrate the standard library from using the external `cfg_if` crate to using the now-built-in `cfg_select` macro. This does not yet eliminate the dependency from `library/std/Cargo.toml`, because while the standard library itself no longer uses `cfg_if`, it also incorporates the `backtrace` crate, which does. Migration assisted by the following vim command (after selecting the full `cfg_if!` invocation): ``` '<,'>s/\(cfg_if::\)\?cfg_if/cfg_select/ | '<,'>s/^\( *\)} else {/\1}\r\1_ => {/c | '<,'>s/^\( *\)} else if #\[cfg(\(.*\))\] /\1}\r\1\2 => /e | '<,'>s/if #\[cfg(\(.*\))\] {/\1 => {/e ``` This is imperfect, but substantially accelerated the process. This prompts for confirmation on the `} else {` since that can also appear inside one of the arms. This also requires manual intervention to handle any multi-line conditions.
edeadb0
to
1ae4a0c
Compare
r? @Amanieu |
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.
r=me
The previous code inside `cfg_if!` wasn't indented, so the conversion to `cfg_select!` left it not indented. Indent it.
@bors r=Amanieu p=1 |
library: Migrate from `cfg_if` to `cfg_select` Migrate the standard library from using the external `cfg_if` crate to using the now-built-in `cfg_select` macro. This does not yet eliminate the dependency from `library/std/Cargo.toml`, because while the standard library itself no longer uses `cfg_if`, it also incorporates the `backtrace` crate, which does. Migration assisted by the following vim command (after selecting the full `cfg_if!` invocation): ``` '<,'>s/\(cfg_if::\)\?cfg_if/cfg_select/ | '<,'>s/^\( *\)} else {/\1}\r\1_ => {/c | '<,'>s/^\( *\)} else if #\[cfg(\(.*\))\] /\1}\r\1\2 => /e | '<,'>s/if #\[cfg(\(.*\))\] {/\1 => {/e ``` This is imperfect, but substantially accelerated the process. This prompts for confirmation on the `} else {` since that can also appear inside one of the arms. This also requires manual intervention to handle any multi-line conditions.
Rollup of 10 pull requests Successful merges: - #144476 (rustdoc-search: search backend with partitioned suffix tree) - #144838 (Fix outdated doc comment) - #145206 (Port `#[custom_mir(..)]` to the new attribute system) - #145208 (Implement declarative (`macro_rules!`) derive macros (RFC 3698)) - #145420 (cg_llvm: Use LLVM-C bindings for `LLVMSetTailCallKind`, `LLVMGetTypeKind`) - #145451 (Add static glibc to the nix dev shell) - #145460 (Speedup `copy_src_dirs` in bootstrap) - #145476 (Fix typo in doc for library/std/src/fs.rs#set_permissions) - #145485 (Fix deprecation attributes on foreign statics) - #145489 (library: Migrate from `cfg_if` to `cfg_select`) r? `@ghost` `@rustbot` modify labels: rollup
Failed in rollup: #145521 (comment) |
library: Migrate from `cfg_if` to `cfg_select` try-job: x86_64-gnu-llvm-19-3
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💔 Test for b3311ae failed: CI. Failed jobs:
|
@bors r=Amanieu rollup=iffy p=1 |
Migrate the standard library from using the external
cfg_if
crate to using the now-built-incfg_select
macro.This does not yet eliminate the dependency from
library/std/Cargo.toml
, because while the standard library itself no longer usescfg_if
, it also incorporates thebacktrace
crate, which does.Migration assisted by the following vim command (after selecting the full
cfg_if!
invocation):This is imperfect, but substantially accelerated the process. This prompts for confirmation on the
} else {
since that can also appear inside one of the arms. This also requires manual intervention to handle any multi-line conditions.