Skip to content

Commit bcff152

Browse files
committed
---
yaml --- r: 234823 b: refs/heads/tmp c: 885d224 h: refs/heads/master i: 234821: 26cba5e 234819: 1ea5e42 234815: 54aaff5 v: v3
1 parent 9df78ce commit bcff152

File tree

18 files changed

+100
-706
lines changed

18 files changed

+100
-706
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: ad82e0ac180deef65b5757a6e4d7fa79aab5521a
28+
refs/heads/tmp: 885d2242305e5523c3cc9b459180ef5ccc19cf85
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/mk/cfg/x86_64-unknown-netbsd.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# x86_64-unknown-netbsd configuration
2-
CROSS_PREFIX_x86_64-unknown-netbsd=x86_64-unknown-netbsd-
32
CC_x86_64-unknown-netbsd=$(CC)
43
CXX_x86_64-unknown-netbsd=$(CXX)
54
CPP_x86_64-unknown-netbsd=$(CPP)

branches/tmp/src/liblibc/lib.rs

Lines changed: 50 additions & 488 deletions
Large diffs are not rendered by default.

branches/tmp/src/librustc/middle/infer/equate.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use middle::ty::{self, Ty};
1717
use middle::ty::TyVar;
1818
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
1919

20-
/// Ensures `a` is made equal to `b`. Returns `a` on success.
2120
pub struct Equate<'a, 'tcx: 'a> {
2221
fields: CombineFields<'a, 'tcx>
2322
}
@@ -69,8 +68,7 @@ impl<'a, 'tcx> TypeRelation<'a,'tcx> for Equate<'a, 'tcx> {
6968
}
7069

7170
_ => {
72-
try!(combine::super_combine_tys(self.fields.infcx, self, a, b));
73-
Ok(a)
71+
combine::super_combine_tys(self.fields.infcx, self, a, b)
7472
}
7573
}
7674
}

branches/tmp/src/librustc/middle/infer/sub.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use middle::ty::TyVar;
1818
use middle::ty::relate::{Cause, Relate, RelateResult, TypeRelation};
1919
use std::mem;
2020

21-
/// Ensures `a` is made a subtype of `b`. Returns `a` on success.
21+
/// "Greatest lower bound" (common subtype)
2222
pub struct Sub<'a, 'tcx: 'a> {
2323
fields: CombineFields<'a, 'tcx>,
2424
}
@@ -90,8 +90,7 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Sub<'a, 'tcx> {
9090
}
9191

9292
_ => {
93-
try!(combine::super_combine_tys(self.fields.infcx, self, a, b));
94-
Ok(a)
93+
combine::super_combine_tys(self.fields.infcx, self, a, b)
9594
}
9695
}
9796
}

branches/tmp/src/librustc_privacy/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,12 @@ impl<'a, 'tcx> PrivacyVisitor<'a, 'tcx> {
847847
ty::ImplContainer(_) => {
848848
self.check_static_method(span, method_def_id, name)
849849
}
850-
// Trait methods are always accessible if the trait is in scope.
851-
ty::TraitContainer(_) => {}
850+
// Trait methods are always all public. The only controlling factor
851+
// is whether the trait itself is accessible or not.
852+
ty::TraitContainer(trait_def_id) => {
853+
self.report_error(self.ensure_public(span, trait_def_id,
854+
None, "source trait"));
855+
}
852856
}
853857
}
854858
}

branches/tmp/src/libstd/os/netbsd/raw.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! NetBSD-specific raw type definitions
11+
//! NetBSD/OpenBSD-specific raw type definitions
1212
1313
#![stable(feature = "raw_ext", since = "1.1.0")]
1414

@@ -17,7 +17,7 @@ use os::unix::raw::{uid_t, gid_t};
1717

1818
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64;
1919
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u32;
20-
#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
20+
#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = i32;
2121
#[stable(feature = "raw_ext", since = "1.1.0")] pub type fflags_t = u32;
2222
#[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
2323
#[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u32;
@@ -55,10 +55,6 @@ pub struct stat {
5555
#[stable(feature = "raw_ext", since = "1.1.0")]
5656
pub st_ctime_nsec: c_long,
5757
#[stable(feature = "raw_ext", since = "1.1.0")]
58-
pub st_birthtime: time_t,
59-
#[stable(feature = "raw_ext", since = "1.1.0")]
60-
pub st_birthtime_nsec: c_long,
61-
#[stable(feature = "raw_ext", since = "1.1.0")]
6258
pub st_size: off_t,
6359
#[stable(feature = "raw_ext", since = "1.1.0")]
6460
pub st_blocks: blkcnt_t,
@@ -68,5 +64,8 @@ pub struct stat {
6864
pub st_flags: fflags_t,
6965
#[stable(feature = "raw_ext", since = "1.1.0")]
7066
pub st_gen: u32,
71-
st_spare: [u32; 2],
67+
#[stable(feature = "raw_ext", since = "1.1.0")]
68+
pub st_birthtime: time_t,
69+
#[stable(feature = "raw_ext", since = "1.1.0")]
70+
pub st_birthtime_nsec: c_long,
7271
}

branches/tmp/src/libstd/sys/common/unwind/mod.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,15 @@ pub unsafe fn try<F: FnOnce()>(f: F) -> Result<(), Box<Any + Send>> {
148148
// care of exposing correctly.
149149
unsafe fn inner_try(f: fn(*mut u8), data: *mut u8)
150150
-> Result<(), Box<Any + Send>> {
151-
PANICKING.with(|s| {
152-
let prev = s.get();
153-
s.set(false);
154-
let ep = intrinsics::try(f, data);
155-
s.set(prev);
156-
if ep.is_null() {
157-
Ok(())
158-
} else {
159-
Err(imp::cleanup(ep))
160-
}
161-
})
151+
let prev = PANICKING.with(|s| s.get());
152+
PANICKING.with(|s| s.set(false));
153+
let ep = intrinsics::try(f, data);
154+
PANICKING.with(|s| s.set(prev));
155+
if ep.is_null() {
156+
Ok(())
157+
} else {
158+
Err(imp::cleanup(ep))
159+
}
162160
}
163161

164162
fn try_fn<F: FnOnce()>(opt_closure: *mut u8) {

branches/tmp/src/libstd/sys/unix/c.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ pub const _SC_GETPW_R_SIZE_MAX: libc::c_int = 70;
6161
target_os = "dragonfly"))]
6262
pub const _SC_GETPW_R_SIZE_MAX: libc::c_int = 71;
6363
#[cfg(any(target_os = "bitrig",
64+
target_os = "netbsd",
6465
target_os = "openbsd"))]
6566
pub const _SC_GETPW_R_SIZE_MAX: libc::c_int = 101;
66-
#[cfg(target_os = "netbsd")]
67-
pub const _SC_GETPW_R_SIZE_MAX: libc::c_int = 48;
6867
#[cfg(target_os = "android")]
6968
pub const _SC_GETPW_R_SIZE_MAX: libc::c_int = 0x0048;
7069

@@ -132,31 +131,26 @@ extern {
132131

133132
pub fn raise(signum: libc::c_int) -> libc::c_int;
134133

135-
#[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")]
136134
pub fn sigaction(signum: libc::c_int,
137135
act: *const sigaction,
138136
oldact: *mut sigaction) -> libc::c_int;
139137

140-
#[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")]
141138
pub fn sigaltstack(ss: *const sigaltstack,
142139
oss: *mut sigaltstack) -> libc::c_int;
143140

144141
#[cfg(not(target_os = "android"))]
145-
#[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")]
146142
pub fn sigemptyset(set: *mut sigset_t) -> libc::c_int;
147143

148144
pub fn pthread_sigmask(how: libc::c_int, set: *const sigset_t,
149145
oldset: *mut sigset_t) -> libc::c_int;
150146

151147
#[cfg(not(target_os = "ios"))]
152-
#[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")]
153148
pub fn getpwuid_r(uid: libc::uid_t,
154149
pwd: *mut passwd,
155150
buf: *mut libc::c_char,
156151
buflen: libc::size_t,
157152
result: *mut *mut passwd) -> libc::c_int;
158153

159-
#[cfg_attr(target_os = "netbsd", link_name = "__utimes50")]
160154
pub fn utimes(filename: *const libc::c_char,
161155
times: *const libc::timeval) -> libc::c_int;
162156
pub fn gai_strerror(errcode: libc::c_int) -> *const libc::c_char;
@@ -353,12 +347,12 @@ mod signal_os {
353347
#[cfg(any(target_os = "macos",
354348
target_os = "ios"))]
355349
pub type sigset_t = u32;
356-
#[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd"))]
350+
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
357351
#[repr(C)]
358352
pub struct sigset_t {
359353
bits: [u32; 4],
360354
}
361-
#[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
355+
#[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
362356
pub type sigset_t = libc::c_uint;
363357

364358
// This structure has more fields, but we're not all that interested in

branches/tmp/src/libstd/sys/unix/os.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
213213
::fs::read_link("/proc/curproc/file")
214214
}
215215

216-
#[cfg(target_os = "netbsd")]
217-
pub fn current_exe() -> io::Result<PathBuf> {
218-
::fs::read_link("/proc/curproc/exe")
219-
}
220-
221-
#[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
216+
#[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
222217
pub fn current_exe() -> io::Result<PathBuf> {
223218
use sync::StaticMutex;
224219
static LOCK: StaticMutex = StaticMutex::new();

branches/tmp/src/libstd/sys/unix/process.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ mod tests {
452452

453453
#[cfg(not(target_os = "android"))]
454454
extern {
455-
#[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")]
456455
fn sigaddset(set: *mut c::sigset_t, signum: libc::c_int) -> libc::c_int;
457456
}
458457

branches/tmp/src/libstd/sys/unix/sync.rs

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ extern {
4040
pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> libc::c_int;
4141
pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> libc::c_int;
4242
pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> libc::c_int;
43-
#[cfg_attr(target_os = "netbsd", link_name = "__gettimeofday50")]
4443
pub fn gettimeofday(tp: *mut libc::timeval,
4544
tz: *mut libc::c_void) -> libc::c_int;
4645

@@ -56,6 +55,7 @@ extern {
5655
#[cfg(any(target_os = "freebsd",
5756
target_os = "dragonfly",
5857
target_os = "bitrig",
58+
target_os = "netbsd",
5959
target_os = "openbsd"))]
6060
mod os {
6161
use libc;
@@ -249,67 +249,3 @@ mod os {
249249
};
250250
pub const PTHREAD_MUTEX_RECURSIVE: libc::c_int = 1;
251251
}
252-
253-
#[cfg(target_os = "netbsd")]
254-
mod os {
255-
use libc;
256-
257-
// size of the type minus width of the magic and alignment field
258-
#[cfg(target_arch = "x86_64")]
259-
const __PTHREAD_MUTEX_SIZE__: usize = 48 - 4 - 8;
260-
261-
#[cfg(target_arch = "x86_64")]
262-
const __PTHREAD_MUTEXATTR_SIZE__: usize = 16 - 8; // no magic field
263-
264-
#[cfg(target_arch = "x86_64")]
265-
const __PTHREAD_COND_SIZE__: usize = 40 - 4 - 8;
266-
267-
#[cfg(target_arch = "x86_64")]
268-
const __PTHREAD_RWLOCK_SIZE__: usize = 64 - 4 - 8;
269-
270-
const _PTHREAD_MUTEX_MAGIC_INIT: libc::c_uint = 0x33330003;
271-
const _PTHREAD_COND_MAGIC_INIT: libc::c_uint = 0x55550005;
272-
const _PTHREAD_RWLOCK_MAGIC_INIT: libc::c_uint = 0x99990009;
273-
274-
#[repr(C)]
275-
pub struct pthread_mutex_t {
276-
__magic: libc::c_uint,
277-
__opaque: [u8; __PTHREAD_MUTEX_SIZE__],
278-
__align: libc::c_longlong,
279-
}
280-
#[repr(C)]
281-
pub struct pthread_mutexattr_t {
282-
__opaque: [u8; __PTHREAD_MUTEXATTR_SIZE__],
283-
__align: libc::c_longlong,
284-
}
285-
#[repr(C)]
286-
pub struct pthread_cond_t {
287-
__magic: libc::c_uint,
288-
__opaque: [u8; __PTHREAD_COND_SIZE__],
289-
__align: libc::c_longlong,
290-
}
291-
#[repr(C)]
292-
pub struct pthread_rwlock_t {
293-
__magic: libc::c_uint,
294-
__opaque: [u8; __PTHREAD_RWLOCK_SIZE__],
295-
__align: libc::c_longlong,
296-
}
297-
298-
pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t {
299-
__magic: _PTHREAD_MUTEX_MAGIC_INIT,
300-
__opaque: [0; __PTHREAD_MUTEX_SIZE__],
301-
__align: 0,
302-
};
303-
pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t {
304-
__magic: _PTHREAD_COND_MAGIC_INIT,
305-
__opaque: [0; __PTHREAD_COND_SIZE__],
306-
__align: 0,
307-
};
308-
pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
309-
__magic: _PTHREAD_RWLOCK_MAGIC_INIT,
310-
__opaque: [0; __PTHREAD_RWLOCK_SIZE__],
311-
__align: 0,
312-
};
313-
314-
pub const PTHREAD_MUTEX_RECURSIVE: libc::c_int = 2;
315-
}

branches/tmp/src/libstd/sys/unix/thread.rs

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ impl Thread {
102102
#[cfg(any(target_os = "freebsd",
103103
target_os = "dragonfly",
104104
target_os = "bitrig",
105+
target_os = "netbsd",
105106
target_os = "openbsd"))]
106107
pub fn set_name(name: &str) {
107108
extern {
@@ -125,21 +126,6 @@ impl Thread {
125126
}
126127
}
127128

128-
#[cfg(target_os = "netbsd")]
129-
pub fn set_name(name: &str) {
130-
extern {
131-
fn pthread_setname_np(thread: libc::pthread_t,
132-
name: *const libc::c_char,
133-
arg: *mut libc::c_void) -> libc::c_int;
134-
}
135-
let cname = CString::new(&b"%s"[..]).unwrap();
136-
let carg = CString::new(name).unwrap();
137-
unsafe {
138-
pthread_setname_np(pthread_self(), cname.as_ptr(),
139-
carg.as_ptr() as *mut libc::c_void);
140-
}
141-
}
142-
143129
pub fn sleep(dur: Duration) {
144130
let mut ts = libc::timespec {
145131
tv_sec: dur.as_secs() as libc::time_t,
@@ -205,12 +191,13 @@ pub mod guard {
205191

206192
#[cfg(any(target_os = "macos",
207193
target_os = "bitrig",
194+
target_os = "netbsd",
208195
target_os = "openbsd"))]
209196
unsafe fn get_stack_start() -> Option<*mut libc::c_void> {
210197
current().map(|s| s as *mut libc::c_void)
211198
}
212199

213-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "netbsd"))]
200+
#[cfg(any(target_os = "linux", target_os = "android"))]
214201
unsafe fn get_stack_start() -> Option<*mut libc::c_void> {
215202
use super::pthread_attr_init;
216203

@@ -276,7 +263,7 @@ pub mod guard {
276263
pthread_get_stacksize_np(pthread_self())) as usize)
277264
}
278265

279-
#[cfg(any(target_os = "openbsd", target_os = "bitrig"))]
266+
#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "bitrig"))]
280267
pub unsafe fn current() -> Option<usize> {
281268
#[repr(C)]
282269
struct stack_t {
@@ -303,7 +290,7 @@ pub mod guard {
303290
})
304291
}
305292

306-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "netbsd"))]
293+
#[cfg(any(target_os = "linux", target_os = "android"))]
307294
pub unsafe fn current() -> Option<usize> {
308295
use super::pthread_attr_init;
309296

@@ -320,17 +307,13 @@ pub mod guard {
320307
let mut size = 0;
321308
assert_eq!(pthread_attr_getstack(&attr, &mut stackaddr, &mut size), 0);
322309

323-
ret = if cfg!(target_os = "netbsd") {
324-
Some(stackaddr as usize)
325-
} else {
326-
Some(stackaddr as usize + guardsize as usize)
327-
};
310+
ret = Some(stackaddr as usize + guardsize as usize);
328311
}
329312
assert_eq!(pthread_attr_destroy(&mut attr), 0);
330313
ret
331314
}
332315

333-
#[cfg(any(target_os = "linux", target_os = "android", target_os = "netbsd"))]
316+
#[cfg(any(target_os = "linux", target_os = "android"))]
334317
extern {
335318
fn pthread_getattr_np(native: libc::pthread_t,
336319
attr: *mut libc::pthread_attr_t) -> libc::c_int;

branches/tmp/src/libstd/sys/unix/time.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ mod inner {
8686
#[link(name = "rt")]
8787
extern {}
8888

89-
9089
extern {
91-
#[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")]
9290
fn clock_gettime(clk_id: libc::c_int, tp: *mut libc::timespec) -> libc::c_int;
9391
}
9492

0 commit comments

Comments
 (0)