Skip to content

Commit fa673ae

Browse files
committed
---
yaml --- r: 155563 b: refs/heads/try2 c: d5647a8 h: refs/heads/master i: 155561: 8e1b0b9 155559: 74d1263 v: v3
1 parent 01df444 commit fa673ae

File tree

8 files changed

+53
-57
lines changed

8 files changed

+53
-57
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1e0c7b682f1675e39085f1f0f928a37364bab9c7
8+
refs/heads/try2: d5647a8ea3932c8a44dad13699e128d3d3fee255
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/dynamic_lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl DynamicLibrary {
154154
}
155155
}
156156

157-
#[cfg(test, not(target_os = "ios"))]
157+
#[cfg(all(test, not(target_os = "ios")))]
158158
mod test {
159159
use super::*;
160160
use prelude::*;
@@ -189,10 +189,10 @@ mod test {
189189
}
190190

191191
#[test]
192-
#[cfg(target_os = "linux")]
193-
#[cfg(target_os = "macos")]
194-
#[cfg(target_os = "freebsd")]
195-
#[cfg(target_os = "dragonfly")]
192+
#[cfg(any(target_os = "linux",
193+
target_os = "macos",
194+
target_os = "freebsd",
195+
target_os = "dragonfly"))]
196196
fn test_errors_do_not_crash() {
197197
// Open /dev/null as a library to get an error, and make sure
198198
// that only causes an error, and not a crash.
@@ -204,12 +204,12 @@ mod test {
204204
}
205205
}
206206

207-
#[cfg(target_os = "linux")]
208-
#[cfg(target_os = "android")]
209-
#[cfg(target_os = "macos")]
210-
#[cfg(target_os = "ios")]
211-
#[cfg(target_os = "freebsd")]
212-
#[cfg(target_os = "dragonfly")]
207+
#[cfg(any(target_os = "linux",
208+
target_os = "android",
209+
target_os = "macos",
210+
target_os = "ios",
211+
target_os = "freebsd",
212+
target_os = "dragonfly"))]
213213
pub mod dl {
214214

215215
use c_str::{CString, ToCStr};

branches/try2/src/libstd/io/net/addrinfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ fn lookup(hostname: Option<&str>, servname: Option<&str>, hint: Option<Hint>)
123123

124124
// Ignored on android since we cannot give tcp/ip
125125
// permission without help of apk
126-
#[cfg(test, not(target_os = "android"))]
126+
#[cfg(all(test, not(target_os = "android")))]
127127
mod test {
128128
iotest!(fn dns_smoke_test() {
129129
let ipaddrs = get_host_addresses("localhost").unwrap();

branches/try2/src/libstd/io/process.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ mod tests {
693693
drop(p.wait().clone());
694694
})
695695

696-
#[cfg(unix, not(target_os="android"))]
696+
#[cfg(all(unix, not(target_os="android")))]
697697
iotest!(fn signal_reported_right() {
698698
let p = Command::new("/bin/sh").arg("-c").arg("kill -1 $$").spawn();
699699
assert!(p.is_ok());
@@ -725,7 +725,7 @@ mod tests {
725725
assert_eq!(run_output(cmd), "foobar\n".to_string());
726726
})
727727

728-
#[cfg(unix, not(target_os="android"))]
728+
#[cfg(all(unix, not(target_os="android")))]
729729
iotest!(fn set_cwd_works() {
730730
let mut cmd = Command::new("/bin/sh");
731731
cmd.arg("-c").arg("pwd")
@@ -734,7 +734,7 @@ mod tests {
734734
assert_eq!(run_output(cmd), "/\n".to_string());
735735
})
736736

737-
#[cfg(unix, not(target_os="android"))]
737+
#[cfg(all(unix, not(target_os="android")))]
738738
iotest!(fn stdin_works() {
739739
let mut p = Command::new("/bin/sh")
740740
.arg("-c").arg("read line; echo $line")
@@ -759,7 +759,7 @@ mod tests {
759759
assert!(Command::new("test").uid(10).spawn().is_err());
760760
})
761761

762-
#[cfg(unix, not(target_os="android"))]
762+
#[cfg(all(unix, not(target_os="android")))]
763763
iotest!(fn uid_works() {
764764
use libc;
765765
let mut p = Command::new("/bin/sh")
@@ -770,7 +770,7 @@ mod tests {
770770
assert!(p.wait().unwrap().success());
771771
})
772772

773-
#[cfg(unix, not(target_os="android"))]
773+
#[cfg(all(unix, not(target_os="android")))]
774774
iotest!(fn uid_to_root_fails() {
775775
use libc;
776776

@@ -847,7 +847,7 @@ mod tests {
847847
}
848848
})
849849

850-
#[cfg(unix,not(target_os="android"))]
850+
#[cfg(all(unix, not(target_os="android")))]
851851
pub fn pwd_cmd() -> Command {
852852
Command::new("pwd")
853853
}
@@ -897,7 +897,7 @@ mod tests {
897897
assert_eq!(parent_stat.unstable.inode, child_stat.unstable.inode);
898898
})
899899

900-
#[cfg(unix,not(target_os="android"))]
900+
#[cfg(all(unix, not(target_os="android")))]
901901
pub fn env_cmd() -> Command {
902902
Command::new("env")
903903
}

branches/try2/src/libstd/io/signal.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl Listener {
160160
}
161161
}
162162

163-
#[cfg(test, unix)]
163+
#[cfg(all(test, unix))]
164164
mod test_unix {
165165
use prelude::*;
166166
use libc;
@@ -218,7 +218,7 @@ mod test_unix {
218218
}
219219
}
220220

221-
#[cfg(test, windows)]
221+
#[cfg(all(test, windows))]
222222
mod test_windows {
223223
use super::{User1, Listener};
224224
use result::{Ok, Err};

branches/try2/src/libstd/os.rs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,7 @@ pub fn dll_filename(base: &str) -> String {
653653
/// ```
654654
pub fn self_exe_name() -> Option<Path> {
655655

656-
#[cfg(target_os = "freebsd")]
657-
#[cfg(target_os = "dragonfly")]
656+
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
658657
fn load_self() -> Option<Vec<u8>> {
659658
unsafe {
660659
use libc::funcs::bsd44::*;
@@ -680,8 +679,7 @@ pub fn self_exe_name() -> Option<Path> {
680679
}
681680
}
682681

683-
#[cfg(target_os = "linux")]
684-
#[cfg(target_os = "android")]
682+
#[cfg(any(target_os = "linux", target_os = "android"))]
685683
fn load_self() -> Option<Vec<u8>> {
686684
use std::io;
687685

@@ -691,8 +689,7 @@ pub fn self_exe_name() -> Option<Path> {
691689
}
692690
}
693691

694-
#[cfg(target_os = "macos")]
695-
#[cfg(target_os = "ios")]
692+
#[cfg(any(target_os = "macos", target_os = "ios"))]
696693
fn load_self() -> Option<Vec<u8>> {
697694
unsafe {
698695
use libc::funcs::extra::_NSGetExecutablePath;
@@ -909,9 +906,9 @@ pub fn change_dir(p: &Path) -> bool {
909906
#[cfg(unix)]
910907
/// Returns the platform-specific value of errno
911908
pub fn errno() -> int {
912-
#[cfg(target_os = "macos")]
913-
#[cfg(target_os = "ios")]
914-
#[cfg(target_os = "freebsd")]
909+
#[cfg(any(target_os = "macos",
910+
target_os = "ios",
911+
target_os = "freebsd"))]
915912
fn errno_location() -> *const c_int {
916913
extern {
917914
fn __error() -> *const c_int;
@@ -931,8 +928,7 @@ pub fn errno() -> int {
931928
}
932929
}
933930

934-
#[cfg(target_os = "linux")]
935-
#[cfg(target_os = "android")]
931+
#[cfg(any(target_os = "linux", target_os = "android"))]
936932
fn errno_location() -> *const c_int {
937933
extern {
938934
fn __errno_location() -> *const c_int;
@@ -975,11 +971,11 @@ pub fn error_string(errnum: uint) -> String {
975971

976972
#[cfg(unix)]
977973
fn strerror(errnum: uint) -> String {
978-
#[cfg(target_os = "macos")]
979-
#[cfg(target_os = "ios")]
980-
#[cfg(target_os = "android")]
981-
#[cfg(target_os = "freebsd")]
982-
#[cfg(target_os = "dragonfly")]
974+
#[cfg(any(target_os = "macos",
975+
target_os = "ios",
976+
target_os = "android",
977+
target_os = "freebsd",
978+
target_os = "dragonfly"))]
983979
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t)
984980
-> c_int {
985981
extern {
@@ -1180,10 +1176,10 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> {
11801176
res
11811177
}
11821178

1183-
#[cfg(target_os = "linux")]
1184-
#[cfg(target_os = "android")]
1185-
#[cfg(target_os = "freebsd")]
1186-
#[cfg(target_os = "dragonfly")]
1179+
#[cfg(any(target_os = "linux",
1180+
target_os = "android",
1181+
target_os = "freebsd",
1182+
target_os = "dragonfly"))]
11871183
fn real_args_as_bytes() -> Vec<Vec<u8>> {
11881184
use rt;
11891185

branches/try2/src/libstd/rand/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
pub use self::imp::OsRng;
1515

16-
#[cfg(unix, not(target_os = "ios"))]
16+
#[cfg(all(unix, not(target_os = "ios")))]
1717
mod imp {
1818
use io::{IoResult, File};
1919
use path::Path;

branches/try2/src/libstd/rt/backtrace.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ mod imp {
253253
/// play well with green threads, so while it is extremely nice
254254
/// and simple to use it should be used only on iOS devices as the
255255
/// only viable option.
256-
#[cfg(target_os = "ios", target_arch = "arm")]
256+
#[cfg(all(target_os = "ios", target_arch = "arm"))]
257257
#[inline(never)]
258258
pub fn write(w: &mut Writer) -> IoResult<()> {
259259
use iter::{Iterator, range};
@@ -284,7 +284,7 @@ mod imp {
284284
result::fold(iter, (), |_, _| ())
285285
}
286286

287-
#[cfg(not(target_os = "ios", target_arch = "arm"))]
287+
#[cfg(not(all(target_os = "ios", target_arch = "arm")))]
288288
#[inline(never)] // if we know this is a function call, we can skip it when
289289
// tracing
290290
pub fn write(w: &mut Writer) -> IoResult<()> {
@@ -365,8 +365,7 @@ mod imp {
365365
}
366366
}
367367

368-
#[cfg(target_os = "macos")]
369-
#[cfg(target_os = "ios")]
368+
#[cfg(any(target_os = "macos", target_os = "ios"))]
370369
fn print(w: &mut Writer, idx: int, addr: *mut libc::c_void) -> IoResult<()> {
371370
use intrinsics;
372371
#[repr(C)]
@@ -391,7 +390,7 @@ mod imp {
391390
}
392391
}
393392

394-
#[cfg(not(target_os = "macos"), not(target_os = "ios"))]
393+
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
395394
fn print(w: &mut Writer, idx: int, addr: *mut libc::c_void) -> IoResult<()> {
396395
use collections::Collection;
397396
use iter::Iterator;
@@ -571,25 +570,26 @@ mod imp {
571570

572571
extern {
573572
// No native _Unwind_Backtrace on iOS
574-
#[cfg(not(target_os = "ios", target_arch = "arm"))]
573+
#[cfg(not(all(target_os = "ios", target_arch = "arm")))]
575574
pub fn _Unwind_Backtrace(trace: _Unwind_Trace_Fn,
576575
trace_argument: *mut libc::c_void)
577576
-> _Unwind_Reason_Code;
578577

579-
#[cfg(not(target_os = "android"),
580-
not(target_os = "linux", target_arch = "arm"))]
578+
#[cfg(all(not(target_os = "android"),
579+
not(all(target_os = "linux", target_arch = "arm"))))]
581580
pub fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t;
582-
#[cfg(not(target_os = "android"),
583-
not(target_os = "linux", target_arch = "arm"))]
581+
582+
#[cfg(all(not(target_os = "android"),
583+
not(all(target_os = "linux", target_arch = "arm"))))]
584584
pub fn _Unwind_FindEnclosingFunction(pc: *mut libc::c_void)
585585
-> *mut libc::c_void;
586586
}
587587

588588
// On android, the function _Unwind_GetIP is a macro, and this is the
589589
// expansion of the macro. This is all copy/pasted directly from the
590590
// header file with the definition of _Unwind_GetIP.
591-
#[cfg(target_os = "android")]
592-
#[cfg(target_os = "linux", target_arch = "arm")]
591+
#[cfg(any(target_os = "android",
592+
all(target_os = "linux", target_arch = "arm")))]
593593
pub unsafe fn _Unwind_GetIP(ctx: *mut _Unwind_Context) -> libc::uintptr_t {
594594
#[repr(C)]
595595
enum _Unwind_VRS_Result {
@@ -634,8 +634,8 @@ mod imp {
634634

635635
// This function also doesn't exist on Android or ARM/Linux, so make it
636636
// a no-op
637-
#[cfg(target_os = "android")]
638-
#[cfg(target_os = "linux", target_arch = "arm")]
637+
#[cfg(any(target_os = "android",
638+
all(target_os = "linux", target_arch = "arm")))]
639639
pub unsafe fn _Unwind_FindEnclosingFunction(pc: *mut libc::c_void)
640640
-> *mut libc::c_void
641641
{

0 commit comments

Comments
 (0)