Skip to content

Commit ccfc4d9

Browse files
authored
Fix publish to Artifactory crates registry (#1072)
* Remove aliases for crates rustc-std-workspace-core and rustc-std-workspace-alloc Those aliases causes problems in Artifactory crates registry and prevents rustix from being discovered (and as a result downloaded by cargo). This has been introduced in version 0.38.10 when the dep: syntax for Cargo.toml was first introduced. My guess is that the usage of the core and alloc keywords caused issues while uploading and indexing the crate. * Remove rustc-std-workspace-alloc dependency Trying to fix the breakage of the rustc-dep-of-std feature I have noticed that only the std feature uses the alloc feature. and the alloc feature was preventing from me to just remove the dep: syntax So I just deleted the rustc-std-alloc dep and it seems to work * Alias alloc in lib.rs instead of Cargo.toml The alias is only activated if the alloc feature is activated
1 parent d24267b commit ccfc4d9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ bitflags = { version = "2.4.0", default-features = false }
2020
itoa = { version = "1.0.1", default-features = false, optional = true }
2121

2222
# Special dependencies used in rustc-dep-of-std mode.
23-
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
24-
alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }
23+
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core"}
24+
rustc-std-workspace-alloc = { version = "1.0.0", optional = true} # not aliased here but in lib.rs casuse of name collision with the alloc feature
2525
compiler_builtins = { version = '0.1.49', optional = true }
2626

2727
# The procfs feature needs once_cell.
@@ -238,9 +238,9 @@ alloc = []
238238
# This is used in the port of std to rustix. This is experimental and not meant
239239
# for regular use.
240240
rustc-dep-of-std = [
241-
"dep:core",
242-
"dep:alloc",
243-
"dep:compiler_builtins",
241+
"core",
242+
"rustc-std-workspace-alloc",
243+
"compiler_builtins",
244244
"linux-raw-sys/rustc-dep-of-std",
245245
"bitflags/rustc-dep-of-std",
246246
"compiler_builtins?/rustc-dep-of-std",

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@
127127
allow(unused_imports)
128128
)]
129129

130+
#[cfg(all(feature = "rustc-dep-of-std", feature = "alloc"))]
131+
extern crate rustc_std_workspace_alloc as alloc;
132+
130133
#[cfg(all(feature = "alloc", not(feature = "rustc-dep-of-std")))]
131134
extern crate alloc;
132135

0 commit comments

Comments
 (0)