Skip to content

Commit 23a073b

Browse files
committed
---
yaml --- r: 152435 b: refs/heads/try2 c: e0855bc h: refs/heads/master i: 152433: 8c6a4fe 152431: 7ed4ac0 v: v3
1 parent 1e1d902 commit 23a073b

File tree

128 files changed

+934
-1416
lines changed

Some content is hidden

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

128 files changed

+934
-1416
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: b1302f9c4f6619bf83fff39b305b990d8f628eb7
8+
refs/heads/try2: e0855bccd356d191074a83c2aeedabd88d2b7bab
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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ 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,
296295
}
297296
}
298297

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::dynamic_lib::DynamicLibrary;
14+
use std::unstable::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 synchronizes with this `Acquire`
187+
// decreasing of the reference count sychronizes 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/libarena/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,20 @@ fn test_arena_destructors() {
298298
}
299299
}
300300

301+
#[test]
302+
fn test_arena_alloc_nested() {
303+
struct Inner { value: uint }
304+
struct Outer<'a> { inner: &'a Inner }
305+
306+
let arena = Arena::new();
307+
308+
let result = arena.alloc(|| Outer {
309+
inner: arena.alloc(|| Inner { value: 10 })
310+
});
311+
312+
assert_eq!(result.inner.value, 10);
313+
}
314+
301315
#[test]
302316
#[should_fail]
303317
fn test_arena_destructors_fail() {

branches/try2/src/libcollections/bitv.rs

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

1515
use core::cmp;
16-
use core::default::Default;
1716
use core::fmt;
1817
use core::iter::{Enumerate, Repeat, Map, Zip};
1918
use core::ops;
@@ -699,11 +698,6 @@ pub struct BitvSet {
699698
bitv: BigBitv
700699
}
701700

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

branches/try2/src/libcollections/dlist.rs

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

2626
use alloc::owned::Box;
27-
use core::default::Default;
2827
use core::fmt;
2928
use core::iter;
3029
use core::mem;
@@ -263,11 +262,6 @@ impl<T> Deque<T> for DList<T> {
263262
}
264263
}
265264

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

branches/try2/src/libcollections/priority_queue.rs

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

1515
use core::prelude::*;
1616

17-
use core::default::Default;
1817
use core::mem::{zeroed, replace, swap};
1918
use core::ptr;
2019

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

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

branches/try2/src/libcollections/ringbuf.rs

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

1818
use core::cmp;
19-
use core::default::Default;
2019
use core::fmt;
2120
use core::iter::RandomAccessIterator;
2221

@@ -113,11 +112,6 @@ impl<T> Deque<T> for RingBuf<T> {
113112
}
114113
}
115114

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

branches/try2/src/libcollections/smallintmap.rs

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

1818
use core::prelude::*;
1919

20-
use core::default::Default;
2120
use core::fmt;
2221
use core::iter::{Enumerate, FilterMap};
2322
use core::mem::replace;
@@ -115,11 +114,6 @@ impl<V> MutableMap<uint, V> for SmallIntMap<V> {
115114
}
116115
}
117116

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

branches/try2/src/libcollections/treemap.rs

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

1717
use alloc::owned::Box;
18-
use core::default::Default;
1918
use core::fmt;
2019
use core::fmt::Show;
2120
use core::iter::Peekable;
@@ -136,11 +135,6 @@ impl<K: Ord, V> MutableMap<K, V> for TreeMap<K, V> {
136135
}
137136
}
138137

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

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

branches/try2/src/libcollections/trie.rs

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

1515
use alloc::owned::Box;
16-
use core::default::Default;
1716
use core::mem::zeroed;
1817
use core::mem;
1918
use core::uint;
@@ -106,11 +105,6 @@ impl<T> MutableMap<uint, T> for TrieMap<T> {
106105
}
107106
}
108107

109-
impl<T> Default for TrieMap<T> {
110-
#[inline]
111-
fn default() -> TrieMap<T> { TrieMap::new() }
112-
}
113-
114108
impl<T> TrieMap<T> {
115109
/// Create an empty TrieMap
116110
#[inline]
@@ -338,11 +332,6 @@ impl MutableSet<uint> for TrieSet {
338332
}
339333
}
340334

341-
impl Default for TrieSet {
342-
#[inline]
343-
fn default() -> TrieSet { TrieSet::new() }
344-
}
345-
346335
impl TrieSet {
347336
/// Create an empty TrieSet
348337
#[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 alignment is requested.
542+
/// afterwards depending on whether right or left alingment 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 whether an option is given at all or has a value.
166+
/// Describes wether 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use std::string::String;
4444
* pattern - see the `glob` function for more details.
4545
*/
4646
pub struct Paths {
47+
root: Path,
4748
dir_patterns: Vec<Pattern>,
4849
require_dir: bool,
4950
options: MatchOptions,
@@ -107,6 +108,7 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Paths {
107108
// FIXME: How do we want to handle verbatim paths? I'm inclined to return nothing,
108109
// since we can't very well find all UNC shares with a 1-letter server name.
109110
return Paths {
111+
root: root,
110112
dir_patterns: Vec::new(),
111113
require_dir: false,
112114
options: options,
@@ -132,6 +134,7 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Paths {
132134
}
133135

134136
Paths {
137+
root: root,
135138
dir_patterns: dir_patterns,
136139
require_dir: require_dir,
137140
options: options,

branches/try2/src/libgreen/context.rs

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

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

230-
// These registers are picked up by the regular context switch paths. These
229+
// These registers are picked up by the regulard context switch paths. These
231230
// will put us in "mostly the right context" except for frobbing all the
232231
// arguments to the right place. We have the small trampoline code inside of
233232
// 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 toggleable idle callback
85+
/// A togglable 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 because we don't want to spin here infinitely.
290+
// iteration becase 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 dependence on libstd.
294+
/// with libc. Basically Option, but without the dependance 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-
// Thankfully most of c95 is universally available and does not vary by OS
3500+
// Thankfull 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,7 +20,6 @@ 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)]
2423
pub struct WSADATA {
2524
pub wVersion: libc::WORD,
2625
pub wHighVersion: libc::WORD,
@@ -33,7 +32,6 @@ pub struct WSADATA {
3332

3433
pub type LPWSADATA = *mut WSADATA;
3534

36-
#[repr(C)]
3735
pub struct fd_set {
3836
fd_count: libc::c_uint,
3937
fd_array: [libc::SOCKET, ..FD_SETSIZE],
@@ -71,6 +69,7 @@ extern "system" {
7169
pub mod compat {
7270
use std::intrinsics::{atomic_store_relaxed, transmute};
7371
use libc::types::os::arch::extra::{LPCWSTR, HMODULE, LPCSTR, LPVOID};
72+
use std::os::win32::as_utf16_p;
7473

7574
extern "system" {
7675
fn GetModuleHandleW(lpModuleName: LPCWSTR) -> HMODULE;
@@ -81,11 +80,12 @@ pub mod compat {
8180
// This way, calling a function in this compatibility layer (after it's loaded) shouldn't
8281
// be any slower than a regular DLL call.
8382
unsafe fn store_func<T: Copy>(ptr: *mut T, module: &str, symbol: &str, fallback: T) {
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))
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+
})
8989
})
9090
}
9191

0 commit comments

Comments
 (0)