Skip to content

Commit d59458d

Browse files
authored
Unrolled build for rust-lang#114521
Rollup merge of rust-lang#114521 - devnexen:std_fbsd_13_upd, r=cuviper std: freebsd build update. since freebsd 11 had been removed, minimum is now 12.
2 parents 45a45c6 + f479142 commit d59458d

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

library/std/build.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@ use std::env;
33
fn main() {
44
println!("cargo:rerun-if-changed=build.rs");
55
let target = env::var("TARGET").expect("TARGET was not set");
6-
if target.contains("freebsd") {
7-
if env::var("RUST_STD_FREEBSD_12_ABI").is_ok() {
8-
println!("cargo:rustc-cfg=freebsd12");
9-
} else if env::var("RUST_STD_FREEBSD_13_ABI").is_ok() {
10-
println!("cargo:rustc-cfg=freebsd12");
11-
println!("cargo:rustc-cfg=freebsd13");
12-
}
13-
} else if target.contains("linux")
6+
if target.contains("linux")
147
|| target.contains("netbsd")
158
|| target.contains("dragonfly")
169
|| target.contains("openbsd")
10+
|| target.contains("freebsd")
1711
|| target.contains("solaris")
1812
|| target.contains("illumos")
1913
|| target.contains("apple-darwin")

library/std/src/os/freebsd/fs.rs

-10
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,7 @@ impl MetadataExt for Metadata {
7676
fn as_raw_stat(&self) -> &raw::stat {
7777
// The methods below use libc::stat, so they work fine when libc is built with FreeBSD 12 ABI.
7878
// This method would just return nonsense.
79-
#[cfg(freebsd12)]
8079
panic!("as_raw_stat not supported with FreeBSD 12 ABI");
81-
#[cfg(not(freebsd12))]
82-
unsafe {
83-
&*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat)
84-
}
8580
}
8681
fn st_dev(&self) -> u64 {
8782
self.as_inner().as_inner().st_dev as u64
@@ -143,12 +138,7 @@ impl MetadataExt for Metadata {
143138
fn st_flags(&self) -> u32 {
144139
self.as_inner().as_inner().st_flags as u32
145140
}
146-
#[cfg(freebsd12)]
147141
fn st_lspare(&self) -> u32 {
148142
panic!("st_lspare not supported with FreeBSD 12 ABI");
149143
}
150-
#[cfg(not(freebsd12))]
151-
fn st_lspare(&self) -> u32 {
152-
self.as_inner().as_inner().st_lspare as u32
153-
}
154144
}

0 commit comments

Comments
 (0)