Skip to content

Commit bab1aed

Browse files
authored
Rollup merge of rust-lang#124050 - saethlin:less-sysroot-libc, r=ChrisDenton
Remove libc from MSVC targets ``@ChrisDenton`` started working on a project to remove libc from Windows MSVC targets. I'm completing that work here. The primary change is to cfg out the dependency in `library/`. And then there's a lot of test patching. Happy to separate this more if people want.
2 parents 6727130 + a408318 commit bab1aed

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

std/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ addr2line = { version = "0.21.0", optional = true, default-features = false }
3333
[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
3434
libc = { version = "0.2.153", default-features = false, features = ['rustc-dep-of-std'], public = true }
3535

36-
[target.'cfg(all(windows, target_env = "msvc"))'.dependencies]
37-
libc = { version = "0.2.153", default-features = false }
38-
3936
[target.'cfg(all(not(target_os = "aix"), not(all(windows, target_env = "msvc", not(target_vendor = "uwp")))))'.dependencies]
4037
object = { version = "0.32.0", default-features = false, optional = true, features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive'] }
4138

std/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ extern crate alloc as alloc_crate;
435435
// so include it here even if it's unused.
436436
#[doc(masked)]
437437
#[allow(unused_extern_crates)]
438+
#[cfg(not(all(windows, target_env = "msvc")))]
438439
extern crate libc;
439440

440441
// We always need an unwinder currently for backtraces

std/src/os/raw/tests.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg(not(all(windows, target_env = "msvc")))]
2+
13
use crate::any::TypeId;
24

35
macro_rules! ok {

0 commit comments

Comments
 (0)