Skip to content

Commit

Permalink
std: Remove cfg(cargobuild) annotations
Browse files Browse the repository at this point in the history
These are all now no longer needed that we've only got rustbuild in tree.
  • Loading branch information
alexcrichton committed Feb 6, 2017
1 parent b27c0b3 commit c42d470
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 97 deletions.
1 change: 0 additions & 1 deletion src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use std::process::Command;
use build_helper::{run, rerun_if_changed_anything_in_dir, up_to_date};

fn main() {
println!("cargo:rustc-cfg=cargobuild");
println!("cargo:rerun-if-changed=build.rs");

let target = env::var("TARGET").expect("TARGET was not set");
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,6 @@ mod panicking;
mod rand;
mod memchr;

// This module just defines per-platform native library dependencies
mod rtdeps;

// The runtime entry point and a few unstable public functions used by the
// compiler
pub mod rt;
Expand Down
6 changes: 3 additions & 3 deletions src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ impl<'a> Location<'a> {
}

fn default_hook(info: &PanicInfo) {
#[cfg(any(not(cargobuild), feature = "backtrace"))]
#[cfg(feature = "backtrace")]
use sys_common::backtrace;

// If this is a double panic, make sure that we print a backtrace
// for this panic. Otherwise only print it if logging is enabled.
#[cfg(any(not(cargobuild), feature = "backtrace"))]
#[cfg(feature = "backtrace")]
let log_backtrace = {
let panics = update_panic_count(0);

Expand All @@ -341,7 +341,7 @@ fn default_hook(info: &PanicInfo) {
let _ = writeln!(err, "thread '{}' panicked at '{}', {}:{}",
name, msg, file, line);

#[cfg(any(not(cargobuild), feature = "backtrace"))]
#[cfg(feature = "backtrace")]
{
use sync::atomic::{AtomicBool, Ordering};

Expand Down
68 changes: 0 additions & 68 deletions src/rtdeps.rs

This file was deleted.

5 changes: 0 additions & 5 deletions src/sys/unix/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ mod imp {
fn objc_msgSend_ul(obj: NsId, sel: Sel, ...) -> NsId;
}

#[link(name = "Foundation", kind = "framework")]
#[link(name = "objc")]
#[cfg(not(cargobuild))]
extern {}

type Sel = *const libc::c_void;
type NsId = *const libc::c_void;

Expand Down
2 changes: 1 addition & 1 deletion src/sys/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub mod weak;

pub mod args;
pub mod android;
#[cfg(any(not(cargobuild), feature = "backtrace"))]
#[cfg(feature = "backtrace")]
pub mod backtrace;
pub mod condvar;
pub mod env;
Expand Down
4 changes: 0 additions & 4 deletions src/sys/unix/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,6 @@ mod imp {
#[allow(non_upper_case_globals)]
const kSecRandomDefault: *const SecRandom = ptr::null();

#[link(name = "Security", kind = "framework")]
#[cfg(not(cargobuild))]
extern {}

extern {
fn SecRandomCopyBytes(rnd: *const SecRandom,
count: size_t, bytes: *mut u8) -> c_int;
Expand Down
7 changes: 0 additions & 7 deletions src/sys/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,13 +833,6 @@ pub struct CONSOLE_READCONSOLE_CONTROL {
}
pub type PCONSOLE_READCONSOLE_CONTROL = *mut CONSOLE_READCONSOLE_CONTROL;

#[link(name = "ws2_32")]
#[link(name = "userenv")]
#[link(name = "shell32")]
#[link(name = "advapi32")]
#[cfg(not(cargobuild))]
extern {}

extern "system" {
pub fn WSAStartup(wVersionRequested: WORD,
lpWSAData: LPWSADATA) -> c_int;
Expand Down
3 changes: 0 additions & 3 deletions src/sys_common/gnu/libbacktrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ pub fn print(w: &mut Write, idx: isize, addr: *mut libc::c_void,
msg: *const libc::c_char,
errnum: libc::c_int);
enum backtrace_state {}
#[link(name = "backtrace", kind = "static")]
#[cfg(all(not(test), not(cargobuild)))]
extern {}

extern {
fn backtrace_create_state(filename: *const libc::c_char,
Expand Down
4 changes: 2 additions & 2 deletions src/sys_common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use sync::Once;
use sys;

pub mod at_exit_imp;
#[cfg(any(not(cargobuild), feature = "backtrace"))]
#[cfg(feature = "backtrace")]
pub mod backtrace;
pub mod condvar;
pub mod io;
Expand All @@ -50,7 +50,7 @@ pub use sys::net;
#[cfg(not(target_os = "redox"))]
pub mod net;

#[cfg(any(not(cargobuild), feature = "backtrace"))]
#[cfg(feature = "backtrace")]
#[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios", target_os = "emscripten"))),
all(windows, target_env = "gnu")))]
pub mod gnu;
Expand Down

0 comments on commit c42d470

Please sign in to comment.