diff options
author | gnzlbg <gonzalobg88@gmail.com> | 2019-02-13 13:59:17 +0100 |
---|---|---|
committer | gnzlbg <gonzalobg88@gmail.com> | 2019-02-13 14:48:50 +0100 |
commit | 83298283c7b1d047208fcab4c0dea37b4e1ac855 (patch) | |
tree | 6d64cd3c88043f3e2deaf066574787d85d3beac4 /src/lib.rs | |
parent | 7ac0fe53ebb955bb8280e77169328db0b9a51ab7 (diff) | |
download | rust-libc-83298283c7b1d047208fcab4c0dea37b4e1ac855.tar.gz |
Generate a proper landing page for the master docs
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 163 |
1 files changed, 17 insertions, 146 deletions
diff --git a/src/lib.rs b/src/lib.rs index 5d8a097b79..8a7750acb0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,161 +7,32 @@ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. +//! libc - Raw FFI bindings to platforms' system libraries -//! Crate docs - -#![allow(bad_style, overflowing_literals, improper_ctypes, unknown_lints)] -#![crate_type = "rlib"] #![crate_name = "libc"] +#![crate_type = "rlib"] +#![cfg_attr(not(feature = "rustc-dep-of-std"), deny(warnings))] +#![allow(bad_style, overflowing_literals, improper_ctypes, unknown_lints)] #![cfg_attr(cross_platform_docs, feature(no_core, lang_items, const_fn))] #![cfg_attr(cross_platform_docs, no_core)] -#![doc( - html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", - html_favicon_url = "https://doc.rust-lang.org/favicon.ico" -)] -#![cfg_attr( - all(target_os = "linux", target_arch = "x86_64"), - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-linux-gnu" - ) -)] -#![cfg_attr( - all(target_os = "linux", target_arch = "x86"), - doc( - html_root_url = "https://rust-lang.github.io/libc/i686-unknown-linux-gnu" - ) -)] -#![cfg_attr( - all(target_os = "linux", target_arch = "arm"), - doc( - html_root_url = "https://rust-lang.github.io/libc/arm-unknown-linux-gnueabihf" - ) -)] -#![cfg_attr( - all(target_os = "linux", target_arch = "mips"), - doc( - html_root_url = "https://rust-lang.github.io/libc/mips-unknown-linux-gnu" - ) -)] -#![cfg_attr( - all(target_os = "linux", target_arch = "aarch64"), - doc( - html_root_url = "https://rust-lang.github.io/libc/aarch64-unknown-linux-gnu" - ) -)] -#![cfg_attr( - all(target_os = "linux", target_env = "musl"), - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-linux-musl" - ) -)] -#![cfg_attr( - all(target_os = "macos", target_arch = "x86_64"), - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-apple-darwin" - ) -)] -#![cfg_attr( - all(target_os = "macos", target_arch = "x86"), - doc(html_root_url = "https://rust-lang.github.io/libc/i686-apple-darwin") -)] -#![cfg_attr( - all(windows, target_arch = "x86_64", target_env = "gnu"), - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-pc-windows-gnu" - ) -)] -#![cfg_attr( - all(windows, target_arch = "x86", target_env = "gnu"), - doc( - html_root_url = "https://rust-lang.github.io/libc/i686-pc-windows-gnu" - ) -)] -#![cfg_attr( - all(windows, target_arch = "x86_64", target_env = "msvc"), - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-pc-windows-msvc" - ) -)] -#![cfg_attr( - all(windows, target_arch = "x86", target_env = "msvc"), - doc( - html_root_url = "https://rust-lang.github.io/libc/i686-pc-windows-msvc" - ) -)] -#![cfg_attr( - target_os = "android", - doc( - html_root_url = "https://rust-lang.github.io/libc/arm-linux-androideabi" - ) -)] -#![cfg_attr( - target_os = "freebsd", - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-freebsd" - ) -)] -#![cfg_attr( - target_os = "openbsd", - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-openbsd" - ) -)] -#![cfg_attr( - target_os = "bitrig", - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-bitrig" - ) -)] -#![cfg_attr( - target_os = "netbsd", - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-netbsd" - ) -)] -#![cfg_attr( - target_os = "dragonfly", - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-unknown-dragonfly" - ) -)] -#![cfg_attr( - target_os = "solaris", - doc( - html_root_url = "https://rust-lang.github.io/libc/x86_64-sun-solaris" - ) -)] -#![cfg_attr( - all(target_os = "emscripten", target_arch = "asmjs"), - doc( - html_root_url = "https://rust-lang.github.io/libc/asmjs-unknown-emscripten" - ) -)] -#![cfg_attr( - all(target_os = "emscripten", target_arch = "wasm32"), - doc( - html_root_url = "https://rust-lang.github.io/libc/wasm32-unknown-emscripten" - ) -)] -#![cfg_attr( - all(target_os = "linux", target_arch = "sparc64"), - doc( - html_root_url = "https://rust-lang.github.io/libc/sparc64-unknown-linux-gnu" - ) -)] // Attributes needed when building as part of the standard library -#![cfg_attr(feature = "rustc-dep-of-std", feature(cfg_target_vendor))] -#![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg))] -#![cfg_attr(feature = "rustc-dep-of-std", feature(no_core))] -#![cfg_attr(feature = "rustc-dep-of-std", no_core)] -#![cfg_attr(feature = "rustc-dep-of-std", allow(warnings))] #![cfg_attr( - not(any(feature = "use_std", feature = "rustc-dep-of-std")), - no_std + feature = "rustc-dep-of-std", + feature(cfg_target_vendor, link_cfg, no_core) )] -// Enable lints +// Enable extra lints: #![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))] #![deny(missing_copy_implementations, safe_packed_borrows)] +// Enable no_std: +#![cfg_attr( + not(any( + feature = "use_std", + feature = "rustc-dep-of-std", + cross_platform_docs + )), + no_std +)] + #[cfg(all(not(cross_platform_docs), feature = "use_std"))] extern crate std as core; |