Skip to content

Commit

Permalink
Require rust >= 1.25 and drop libc_align conditional
Browse files Browse the repository at this point in the history
This is mostly taken from Josh's work at [1], I just updated to account
for conflicts and new uses of `libc_align`.

[1]: rust-lang#2845

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
  • Loading branch information
tgross35 and joshtriplett committed Nov 16, 2024
1 parent 5a43dd2 commit 9d4cd15
Show file tree
Hide file tree
Showing 112 changed files with 1,839 additions and 2,867 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,13 @@ rustc-std-workspace-core = { version = "1.0.0", optional = true }
[features]
default = ["std"]
std = []
align = []
rustc-dep-of-std = ['align', 'rustc-std-workspace-core']
extra_traits = []
const-extern-fn = []

# `align` is deprecated and no longer does anything
align = []

# use_std is deprecated, use `std` instead
use_std = ['std']

Expand Down
7 changes: 0 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const ALLOWED_CFGS: &'static [&'static str] = &[
"freebsd13",
"freebsd14",
"freebsd15",
"libc_align",
"libc_cfg_target_vendor",
"libc_const_extern_fn",
"libc_const_extern_fn_unstable",
Expand Down Expand Up @@ -51,7 +50,6 @@ fn main() {

let (rustc_minor_ver, is_nightly) = rustc_minor_nightly();
let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok();
let align_cargo_feature = env::var("CARGO_FEATURE_ALIGN").is_ok();
let const_extern_fn_cargo_feature = env::var("CARGO_FEATURE_CONST_EXTERN_FN").is_ok();
let libc_ci = env::var("LIBC_CI").is_ok();
let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok() || rustc_minor_ver >= 80;
Expand Down Expand Up @@ -96,11 +94,6 @@ fn main() {
set_cfg("libc_deny_warnings");
}

// Rust >= 1.25 supports repr(align):
if rustc_minor_ver >= 25 || rustc_dep_of_std || align_cargo_feature {
set_cfg("libc_align");
}

// Rust >= 1.26 supports i128 and u128:
if rustc_minor_ver >= 26 || rustc_dep_of_std {
set_cfg("libc_int128");
Expand Down
7 changes: 1 addition & 6 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,7 @@ fn do_ctest() {

fn ctest_cfg() -> ctest::TestGenerator {
let mut cfg = ctest::TestGenerator::new();
let libc_cfgs = [
"libc_align",
"libc_core_cvoid",
"libc_packedN",
"libc_thread_local",
];
let libc_cfgs = ["libc_core_cvoid", "libc_packedN", "libc_thread_local"];
for f in &libc_cfgs {
cfg.cfg(f, None);
}
Expand Down
142 changes: 0 additions & 142 deletions src/fuchsia/align.rs

This file was deleted.

Loading

0 comments on commit 9d4cd15

Please sign in to comment.