@@ -5908,19 +5908,19 @@ cfg_if! {
5908
5908
}
5909
5909
5910
5910
// These require a dependency on `libiconv`, and including this when built as
5911
- // part of `std` means every Rust program gets it. Ideally we would have a link
5912
- // modifier to only include these if they are used, but we do not .
5913
- # [ cfg_attr ( not ( feature = "rustc-dep-of-std" ) , link ( name = "iconv" ) ) ]
5914
- extern "C" {
5915
- pub fn iconv_open ( tocode : * const :: c_char , fromcode : * const :: c_char ) -> iconv_t ;
5916
- pub fn iconv (
5917
- cd : iconv_t ,
5918
- inbuf : * mut * mut :: c_char ,
5919
- inbytesleft : * mut :: size_t ,
5920
- outbuf : * mut * mut :: c_char ,
5921
- outbytesleft : * mut :: size_t ,
5922
- ) -> :: size_t ;
5923
- pub fn iconv_close ( cd : iconv_t ) -> :: c_int ;
5911
+ // part of `std` means every Rust program gets it. Additionally, when not built
5912
+ // as part of `std`, merely using `libc` on an Apple target will pull in `libiconv` .
5913
+ //
5914
+ // Therefore, due to these functions very low usage numbers on the platform, we hide it
5915
+ // behind a feature flag.
5916
+ //
5917
+ // Ideally we would have a link modifier to only include these if they are used, but we do not.
5918
+ cfg_if ! {
5919
+ if # [ cfg ( feature = "iconv-apple" ) ] {
5920
+ # [ link ( name = "iconv" ) ]
5921
+ mod iconv ;
5922
+ pub use self :: iconv :: * ;
5923
+ }
5924
5924
}
5925
5925
5926
5926
cfg_if ! {
0 commit comments