Use rustc-std-workspace-core like libc does.

This commit is contained in:
Dan Gohman
2021-11-03 16:03:54 -07:00
parent 31eaba2e0c
commit a54935c9e0
3 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ categories = ["external-ffi-bindings"]
exclude = ["gen"]
[dependencies]
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
rustc-std-workspace-core = { version = "1.0.0", optional = true }
compiler_builtins = { version = '0.1.49', optional = true }
[package.metadata.docs.rs]
@@ -35,4 +35,4 @@ v5_11 = []
default = ["std", "general", "errno"]
std = []
no_std = []
rustc-dep-of-std = ["core", "compiler_builtins", "no_std"]
rustc-dep-of-std = ["rustc-std-workspace-core", "compiler_builtins", "no_std"]
+1 -1
View File
@@ -242,7 +242,7 @@ fn main() {
writeln!(cargo_toml, "default = [\"std\", {}]", DEFAULT_FEATURES).unwrap();
writeln!(cargo_toml, "std = []").unwrap();
writeln!(cargo_toml, "no_std = []").unwrap();
writeln!(cargo_toml, "rustc-dep-of-std = [\"core\", \"compiler_builtins\", \"no_std\"]").unwrap();
writeln!(cargo_toml, "rustc-dep-of-std = [\"rustc-std-workspace-core\", \"compiler_builtins\", \"no_std\"]").unwrap();
// Reset the `linux` directory back to the original branch.
git_checkout(LINUX_VERSIONS[0]);
+3
View File
@@ -1,6 +1,9 @@
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "rustc-dep-of-std")]
extern crate rustc_std_workspace_core as core;
#[cfg(feature = "std")]
pub use std::os::raw as ctypes;