std: Remove internal definitions of cfg_if! macro#61720
std: Remove internal definitions of cfg_if! macro#61720bors merged 1 commit intorust-lang:masterfrom
cfg_if! macro#61720Conversation
|
r? @bluss (rust_highfive has picked a reviewer for you, use r? to override) |
src/libstd/lib.rs
Outdated
There was a problem hiding this comment.
Note that this is here because there's usage of a bare cfg_if! macro invocation in stdsimd. That needs to be updated to cfg_if::cfg_if! before this can be removed, but that can hopefully happen in parallel with this.
aa2766e to
9502d29
Compare
|
r? @sfackler |
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
This is duplicated in a few locations throughout the sysroot to work around issues with not exporting a macro in libstd but still wanting it available to sysroot crates to define blocks. Nowadays though we can simply depend on the `cfg-if` crate on crates.io, allowing us to use it from there!
9502d29 to
8eb7f36
Compare
|
@bors r+ |
|
📌 Commit 8eb7f36 has been approved by |
…fackler std: Remove internal definitions of `cfg_if!` macro This is duplicated in a few locations throughout the sysroot to work around issues with not exporting a macro in libstd but still wanting it available to sysroot crates to define blocks. Nowadays though we can simply depend on the `cfg-if` crate on crates.io, allowing us to use it from there!
…fackler std: Remove internal definitions of `cfg_if!` macro This is duplicated in a few locations throughout the sysroot to work around issues with not exporting a macro in libstd but still wanting it available to sysroot crates to define blocks. Nowadays though we can simply depend on the `cfg-if` crate on crates.io, allowing us to use it from there!
…fackler std: Remove internal definitions of `cfg_if!` macro This is duplicated in a few locations throughout the sysroot to work around issues with not exporting a macro in libstd but still wanting it available to sysroot crates to define blocks. Nowadays though we can simply depend on the `cfg-if` crate on crates.io, allowing us to use it from there!
Rollup of 5 pull requests Successful merges: - #61598 (Handle index out of bound errors during const eval without panic) - #61720 (std: Remove internal definitions of `cfg_if!` macro) - #61757 (Deprecate ONCE_INIT in future 1.38 release) - #61766 (submodules: update clippy from c0dbd34 to bd33a97) - #61791 (Small cleanup in `check_pat_path`) Failed merges: r? @ghost
|
@alexcrichton any idea why this might break building libstd with xargo? |
|
|
||
| [dependencies] | ||
| alloc = { path = "../liballoc" } | ||
| cfg-if = "0.1.8" |
There was a problem hiding this comment.
Shouldn't this enable the rustc-dep-of-std feature?
There was a problem hiding this comment.
Hm, that leads to a build failure?!?
error: failed to select a version for `cfg-if`.
... required by package `std v0.0.0 (/home/r/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd)`
... which is depended on by `sysroot v0.0.0 (/tmp/xargo.NWDhLbN6RoeP)`
versions that meet the requirements `^0.1.9` are: 0.1.9
the package `std` depends on `cfg-if`, with features: `rustc-dep-of-std` but `cfg-if` does not have these features.
failed to select a version for `cfg-if` which could resolve this conflict
But the feature is present since rust-lang/cfg-if@3e31141.
There was a problem hiding this comment.
Looks like the crates.io version differs from the GH version in that parts of the toml are commented out...??
# [dependencies]
# core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }
# compiler_builtins = { version = '0.1.2', optional = true }
#
# [features]
# rustc-dep-of-std = ['core', 'compiler_builtins']
make sure we use cfg-if as a std dependency xargo currently fails to build libstd because this feature is missing. My guess is that it works in rustc because the feature is enabled elsewhere, but that does not help for a libstd-only build. Miri is currently in a state where it is shipped but broken, which makes CI fail for projects that are tested in Miri. So this is kind of urgent. Cc @alexcrichton #61720
This is duplicated in a few locations throughout the sysroot to work
around issues with not exporting a macro in libstd but still wanting it
available to sysroot crates to define blocks. Nowadays though we can
simply depend on the
cfg-ifcrate on crates.io, allowing us to use itfrom there!