Skip to content

Commit c033532

Browse files
committed
---
yaml --- r: 152438 b: refs/heads/try2 c: f92a8fa h: refs/heads/master v: v3
1 parent 713b5f4 commit c033532

File tree

127 files changed

+1416
-920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1416
-920
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: 47b72e388d6f2207c977fb6b06399717bca96a77
8+
refs/heads/try2: f92a8facf90b40a483032cedb98decc8c41bde51
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
292292
save_metrics: config.save_metrics.clone(),
293293
test_shard: config.test_shard.clone(),
294294
nocapture: false,
295+
color: test::AutoColor,
295296
}
296297
}
297298

branches/try2/src/compiletest/procsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::os;
1212
use std::str;
1313
use std::io::process::{ProcessExit, Command, Process, ProcessOutput};
14-
use std::unstable::dynamic_lib::DynamicLibrary;
14+
use std::dynamic_lib::DynamicLibrary;
1515

1616
fn target_env(lib_path: &str, prog: &str) -> Vec<(String, String)> {
1717
let prog = if cfg!(windows) {prog.slice_to(prog.len() - 4)} else {prog};

branches/try2/src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<T: Share + Send> Drop for Arc<T> {
184184

185185
// This fence is needed to prevent reordering of use of the data and
186186
// deletion of the data. Because it is marked `Release`, the
187-
// decreasing of the reference count sychronizes with this `Acquire`
187+
// decreasing of the reference count synchronizes with this `Acquire`
188188
// fence. This means that use of the data happens before decreasing
189189
// the refernce count, which happens before this fence, which
190190
// happens before the deletion of the data.

branches/try2/src/libcollections/bitv.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use core::prelude::*;
1414

1515
use core::cmp;
16+
use core::default::Default;
1617
use core::fmt;
1718
use core::iter::{Enumerate, Repeat, Map, Zip};
1819
use core::ops;
@@ -698,6 +699,11 @@ pub struct BitvSet {
698699
bitv: BigBitv
699700
}
700701

702+
impl Default for BitvSet {
703+
#[inline]
704+
fn default() -> BitvSet { BitvSet::new() }
705+
}
706+
701707
impl BitvSet {
702708
/// Creates a new bit vector set with initially no contents
703709
pub fn new() -> BitvSet {

branches/try2/src/libcollections/dlist.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use core::prelude::*;
2525

2626
use alloc::owned::Box;
27+
use core::default::Default;
2728
use core::fmt;
2829
use core::iter;
2930
use core::mem;
@@ -262,6 +263,11 @@ impl<T> Deque<T> for DList<T> {
262263
}
263264
}
264265

266+
impl<T> Default for DList<T> {
267+
#[inline]
268+
fn default() -> DList<T> { DList::new() }
269+
}
270+
265271
impl<T> DList<T> {
266272
/// Create an empty DList
267273
#[inline]

branches/try2/src/libcollections/priority_queue.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use core::prelude::*;
1616

17+
use core::default::Default;
1718
use core::mem::{zeroed, replace, swap};
1819
use core::ptr;
1920

@@ -37,6 +38,11 @@ impl<T: Ord> Mutable for PriorityQueue<T> {
3738
fn clear(&mut self) { self.data.truncate(0) }
3839
}
3940

41+
impl<T: Ord> Default for PriorityQueue<T> {
42+
#[inline]
43+
fn default() -> PriorityQueue<T> { PriorityQueue::new() }
44+
}
45+
4046
impl<T: Ord> PriorityQueue<T> {
4147
/// An iterator visiting all values in underlying vector, in
4248
/// arbitrary order.

branches/try2/src/libcollections/ringbuf.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use core::prelude::*;
1717

1818
use core::cmp;
19+
use core::default::Default;
1920
use core::fmt;
2021
use core::iter::RandomAccessIterator;
2122

@@ -112,6 +113,11 @@ impl<T> Deque<T> for RingBuf<T> {
112113
}
113114
}
114115

116+
impl<T> Default for RingBuf<T> {
117+
#[inline]
118+
fn default() -> RingBuf<T> { RingBuf::new() }
119+
}
120+
115121
impl<T> RingBuf<T> {
116122
/// Create an empty RingBuf
117123
pub fn new() -> RingBuf<T> {

branches/try2/src/libcollections/smallintmap.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
use core::prelude::*;
1919

20+
use core::default::Default;
2021
use core::fmt;
2122
use core::iter::{Enumerate, FilterMap};
2223
use core::mem::replace;
@@ -114,6 +115,11 @@ impl<V> MutableMap<uint, V> for SmallIntMap<V> {
114115
}
115116
}
116117

118+
impl<V> Default for SmallIntMap<V> {
119+
#[inline]
120+
fn default() -> SmallIntMap<V> { SmallIntMap::new() }
121+
}
122+
117123
impl<V> SmallIntMap<V> {
118124
/// Create an empty SmallIntMap
119125
pub fn new() -> SmallIntMap<V> { SmallIntMap{v: vec!()} }

branches/try2/src/libcollections/treemap.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use core::prelude::*;
1616

1717
use alloc::owned::Box;
18+
use core::default::Default;
1819
use core::fmt;
1920
use core::fmt::Show;
2021
use core::iter::Peekable;
@@ -135,6 +136,11 @@ impl<K: Ord, V> MutableMap<K, V> for TreeMap<K, V> {
135136
}
136137
}
137138

139+
impl<K: Ord, V> Default for TreeMap<K,V> {
140+
#[inline]
141+
fn default() -> TreeMap<K, V> { TreeMap::new() }
142+
}
143+
138144
impl<K: Ord, V> TreeMap<K, V> {
139145
/// Create an empty TreeMap
140146
pub fn new() -> TreeMap<K, V> { TreeMap{root: None, length: 0} }
@@ -633,6 +639,11 @@ impl<T: Ord> MutableSet<T> for TreeSet<T> {
633639
fn remove(&mut self, value: &T) -> bool { self.map.remove(value) }
634640
}
635641

642+
impl<T: Ord> Default for TreeSet<T> {
643+
#[inline]
644+
fn default() -> TreeSet<T> { TreeSet::new() }
645+
}
646+
636647
impl<T: Ord> TreeSet<T> {
637648
/// Create an empty TreeSet
638649
#[inline]

branches/try2/src/libcollections/trie.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use core::prelude::*;
1414

1515
use alloc::owned::Box;
16+
use core::default::Default;
1617
use core::mem::zeroed;
1718
use core::mem;
1819
use core::uint;
@@ -105,6 +106,11 @@ impl<T> MutableMap<uint, T> for TrieMap<T> {
105106
}
106107
}
107108

109+
impl<T> Default for TrieMap<T> {
110+
#[inline]
111+
fn default() -> TrieMap<T> { TrieMap::new() }
112+
}
113+
108114
impl<T> TrieMap<T> {
109115
/// Create an empty TrieMap
110116
#[inline]
@@ -332,6 +338,11 @@ impl MutableSet<uint> for TrieSet {
332338
}
333339
}
334340

341+
impl Default for TrieSet {
342+
#[inline]
343+
fn default() -> TrieSet { TrieSet::new() }
344+
}
345+
335346
impl TrieSet {
336347
/// Create an empty TrieSet
337348
#[inline]

branches/try2/src/libcore/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ impl<'a> Formatter<'a> {
539539
}
540540

541541
/// Runs a callback, emitting the correct padding either before or
542-
/// afterwards depending on whether right or left alingment is requested.
542+
/// afterwards depending on whether right or left alignment is requested.
543543
fn with_padding(&mut self,
544544
padding: uint,
545545
default: rt::Alignment,

branches/try2/src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
//! *Note: The actual definition of `Writer` uses `IoResult`, which
106106
//! is just a synonym for `Result<T, IoError>`.*
107107
//!
108-
//! This method doesn`t produce a value, but the write may
108+
//! This method doesn't produce a value, but the write may
109109
//! fail. It's crucial to handle the error case, and *not* write
110110
//! something like this:
111111
//!

branches/try2/src/libgetopts/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub struct OptGroup {
163163
pub occur: Occur
164164
}
165165

166-
/// Describes wether an option is given at all or has a value.
166+
/// Describes whether an option is given at all or has a value.
167167
#[deriving(Clone, PartialEq)]
168168
enum Optval {
169169
Val(String),

branches/try2/src/libglob/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use std::string::String;
4444
* pattern - see the `glob` function for more details.
4545
*/
4646
pub struct Paths {
47-
root: Path,
4847
dir_patterns: Vec<Pattern>,
4948
require_dir: bool,
5049
options: MatchOptions,
@@ -108,7 +107,6 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Paths {
108107
// FIXME: How do we want to handle verbatim paths? I'm inclined to return nothing,
109108
// since we can't very well find all UNC shares with a 1-letter server name.
110109
return Paths {
111-
root: root,
112110
dir_patterns: Vec::new(),
113111
require_dir: false,
114112
options: options,
@@ -134,7 +132,6 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Paths {
134132
}
135133

136134
Paths {
137-
root: root,
138135
dir_patterns: dir_patterns,
139136
require_dir: require_dir,
140137
options: options,

branches/try2/src/libgreen/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ extern {
143143
// stacks are disabled.
144144

145145
#[cfg(target_arch = "x86")]
146+
#[repr(C)]
146147
struct Registers {
147148
eax: u32, ebx: u32, ecx: u32, edx: u32,
148149
ebp: u32, esi: u32, edi: u32, esp: u32,
@@ -226,7 +227,7 @@ fn initialize_call_frame(regs: &mut Registers, fptr: InitFn, arg: uint,
226227
regs[RUSTRT_R14] = procedure.env as uint;
227228
regs[RUSTRT_R15] = fptr as uint;
228229

229-
// These registers are picked up by the regulard context switch paths. These
230+
// These registers are picked up by the regular context switch paths. These
230231
// will put us in "mostly the right context" except for frobbing all the
231232
// arguments to the right place. We have the small trampoline code inside of
232233
// rust_bootstrap_green_task to do that.

branches/try2/src/libgreen/sched.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub struct Scheduler {
8282
run_anything: bool,
8383
/// A fast XorShift rng for scheduler use
8484
rng: XorShiftRng,
85-
/// A togglable idle callback
85+
/// A toggleable idle callback
8686
idle_callback: Option<Box<PausableIdleCallback:Send>>,
8787
/// A countdown that starts at a random value and is decremented
8888
/// every time a yield check is performed. When it hits 0 a task
@@ -287,7 +287,7 @@ impl Scheduler {
287287

288288
// After processing a message, we consider doing some more work on the
289289
// event loop. The "keep going" condition changes after the first
290-
// iteration becase we don't want to spin here infinitely.
290+
// iteration because we don't want to spin here infinitely.
291291
//
292292
// Once we start doing work we can keep doing work so long as the
293293
// iteration does something. Note that we don't want to starve the

branches/try2/src/liblibc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ pub use types::os::arch::extra::{mach_timebase_info};
291291
extern {}
292292

293293
/// A wrapper for a nullable pointer. Don't use this except for interacting
294-
/// with libc. Basically Option, but without the dependance on libstd.
294+
/// with libc. Basically Option, but without the dependence on libstd.
295295
// If/when libprim happens, this can be removed in favor of that
296296
pub enum Nullable<T> {
297297
Null,
@@ -3497,7 +3497,7 @@ pub mod consts {
34973497

34983498

34993499
pub mod funcs {
3500-
// Thankfull most of c95 is universally available and does not vary by OS
3500+
// Thankfully most of c95 is universally available and does not vary by OS
35013501
// or anything. The same is not true of POSIX.
35023502

35033503
pub mod c95 {

branches/try2/src/libnative/io/c_win32.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub static FIONBIO: libc::c_long = 0x8004667e;
2020
static FD_SETSIZE: uint = 64;
2121
pub static MSG_DONTWAIT: libc::c_int = 0;
2222

23+
#[repr(C)]
2324
pub struct WSADATA {
2425
pub wVersion: libc::WORD,
2526
pub wHighVersion: libc::WORD,
@@ -32,6 +33,7 @@ pub struct WSADATA {
3233

3334
pub type LPWSADATA = *mut WSADATA;
3435

36+
#[repr(C)]
3537
pub struct fd_set {
3638
fd_count: libc::c_uint,
3739
fd_array: [libc::SOCKET, ..FD_SETSIZE],
@@ -69,7 +71,6 @@ extern "system" {
6971
pub mod compat {
7072
use std::intrinsics::{atomic_store_relaxed, transmute};
7173
use libc::types::os::arch::extra::{LPCWSTR, HMODULE, LPCSTR, LPVOID};
72-
use std::os::win32::as_utf16_p;
7374

7475
extern "system" {
7576
fn GetModuleHandleW(lpModuleName: LPCWSTR) -> HMODULE;
@@ -80,12 +81,11 @@ pub mod compat {
8081
// This way, calling a function in this compatibility layer (after it's loaded) shouldn't
8182
// be any slower than a regular DLL call.
8283
unsafe fn store_func<T: Copy>(ptr: *mut T, module: &str, symbol: &str, fallback: T) {
83-
as_utf16_p(module, |module| {
84-
symbol.with_c_str(|symbol| {
85-
let handle = GetModuleHandleW(module);
86-
let func: Option<T> = transmute(GetProcAddress(handle, symbol));
87-
atomic_store_relaxed(ptr, func.unwrap_or(fallback))
88-
})
84+
let module = module.to_utf16().append_one(0);
85+
symbol.with_c_str(|symbol| {
86+
let handle = GetModuleHandleW(module.as_ptr());
87+
let func: Option<T> = transmute(GetProcAddress(handle, symbol));
88+
atomic_store_relaxed(ptr, func.unwrap_or(fallback))
8989
})
9090
}
9191

0 commit comments

Comments
 (0)