Skip to content

Commit bccae49

Browse files
committed
---
yaml --- r: 68463 b: refs/heads/auto c: 2bdc88b h: refs/heads/master i: 68461: 7064d0f 68459: 248743d 68455: 9ffcdba 68447: 207805d v: v3
1 parent b16896f commit bccae49

File tree

200 files changed

+1958
-3516
lines changed

Some content is hidden

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

200 files changed

+1958
-3516
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 5d2e565bb1f4566bdaab053876bacad72c57f582
17+
refs/heads/auto: 2bdc88b6526f806156a6342ae75a80d99ea6e378
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/Makefile.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ endif
141141
CFG_GIT_DIR := $(CFG_SRC_DIR).git
142142
CFG_RELEASE = 0.7-pre
143143
CFG_VERSION = $(CFG_RELEASE)
144-
# windows exe's need numeric versions - don't use anything but
145-
# numbers and dots here
146-
CFG_VERSION_WIN = 0.7
147144

148145
ifneq ($(wildcard $(CFG_GIT)),)
149146
ifneq ($(wildcard $(CFG_GIT_DIR)),)
@@ -314,7 +311,6 @@ $(foreach host,$(CFG_HOST_TRIPLES), \
314311
export CFG_SRC_DIR
315312
export CFG_BUILD_DIR
316313
export CFG_VERSION
317-
export CFG_VERSION_WIN
318314
export CFG_BUILD_TRIPLE
319315
export CFG_LLVM_ROOT
320316
export CFG_ENABLE_MINGW_CROSS

branches/auto/doc/rust.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2862,13 +2862,13 @@ call to the method `make_string`.
28622862
Types in Rust are categorized into kinds, based on various properties of the components of the type.
28632863
The kinds are:
28642864

2865-
`Freeze`
2865+
`Const`
28662866
: Types of this kind are deeply immutable;
28672867
they contain no mutable memory locations directly or indirectly via pointers.
2868-
`Send`
2868+
`Owned`
28692869
: Types of this kind can be safely sent between tasks.
28702870
This kind includes scalars, owning pointers, owned closures, and
2871-
structural types containing only other owned types. All `Send` types are `Static`.
2871+
structural types containing only other owned types. All `Owned` types are `Static`.
28722872
`Static`
28732873
: Types of this kind do not contain any borrowed pointers;
28742874
this can be a useful guarantee for code that breaks borrowing assumptions using [`unsafe` operations](#unsafe-functions).
@@ -2882,7 +2882,7 @@ The kinds are:
28822882
trait provides a single method `finalize` that takes no parameters, and is run
28832883
when values of the type are dropped. Such a method is called a "destructor",
28842884
and are always executed in "top-down" order: a value is completely destroyed
2885-
before any of the values it owns run their destructors. Only `Send` types
2885+
before any of the values it owns run their destructors. Only `Owned` types
28862886
that do not implement `Copy` can implement `Drop`.
28872887

28882888
> **Note:** The `finalize` method may be renamed in future versions of Rust.
@@ -2968,10 +2968,10 @@ frame they are allocated within.
29682968
A task owns all memory it can *safely* reach through local variables,
29692969
as well as managed, owning and borrowed pointers.
29702970

2971-
When a task sends a value that has the `Send` trait to another task,
2971+
When a task sends a value that has the `Owned` trait to another task,
29722972
it loses ownership of the value sent and can no longer refer to it.
29732973
This is statically guaranteed by the combined use of "move semantics",
2974-
and the compiler-checked _meaning_ of the `Send` trait:
2974+
and the compiler-checked _meaning_ of the `Owned` trait:
29752975
it is only instantiated for (transitively) sendable kinds of data constructor and pointers,
29762976
never including managed or borrowed pointers.
29772977

@@ -3116,7 +3116,7 @@ These include:
31163116
- read-only and read-write shared variables with various safe mutual exclusion patterns
31173117
- simple locks and semaphores
31183118

3119-
When such facilities carry values, the values are restricted to the [`Send` type-kind](#type-kinds).
3119+
When such facilities carry values, the values are restricted to the [`Owned` type-kind](#type-kinds).
31203120
Restricting communication interfaces to this kind ensures that no borrowed or managed pointers move between tasks.
31213121
Thus access to an entire data structure can be mediated through its owning "root" value;
31223122
no further locking or copying is required to avoid data races within the substructure of such a value.

branches/auto/doc/tutorial-ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub struct Unique<T> {
159159
priv ptr: *mut T
160160
}
161161
162-
impl<T: Send> Unique<T> {
162+
impl<T: Owned> Unique<T> {
163163
pub fn new(value: T) -> Unique<T> {
164164
unsafe {
165165
let ptr = malloc(std::sys::size_of::<T>() as size_t) as *mut T;
@@ -182,7 +182,7 @@ impl<T: Send> Unique<T> {
182182
}
183183
184184
#[unsafe_destructor]
185-
impl<T: Send> Drop for Unique<T> {
185+
impl<T: Owned> Drop for Unique<T> {
186186
fn drop(&self) {
187187
unsafe {
188188
let x = intrinsics::init(); // dummy value to swap in

branches/auto/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,9 +1281,9 @@ let your_crayons = ~[BananaMania, Beaver, Bittersweet];
12811281
// Add two vectors to create a new one
12821282
let our_crayons = my_crayons + your_crayons;
12831283
1284-
// .push_all() will append to a vector, provided it lives in a mutable slot
1284+
// += will append to a vector, provided it lives in a mutable slot
12851285
let mut my_crayons = my_crayons;
1286-
my_crayons.push_all(your_crayons);
1286+
my_crayons += your_crayons;
12871287
~~~~
12881288
12891289
> ***Note:*** The above examples of vector addition use owned

branches/auto/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT
5757
cp $< $@
5858

5959
$(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \
60-
$(PKG_FILES) $(CSREQ3_T_$(CFG_BUILD_TRIPLE)_H_$(CFG_BUILD_TRIPLE))
60+
$(PKG_FILES) all rustc-stage3
6161
@$(call E, ISCC: $@)
6262
$(Q)"$(CFG_ISCC)" $<
6363
endif

branches/auto/mk/tools.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ $(foreach host,$(CFG_HOST_TRIPLES), \
191191
$(foreach target,$(CFG_TARGET_TRIPLES), \
192192
$(eval $(call TOOLS_STAGE_N_TARGET,0,1,$(host),$(target))) \
193193
$(eval $(call TOOLS_STAGE_N_TARGET,1,2,$(host),$(target))) \
194-
$(eval $(call TOOLS_STAGE_N_TARGET,2,3,$(host),$(target))) \
195-
$(eval $(call TOOLS_STAGE_N_TARGET,3,bogus,$(host),$(target)))))
194+
$(eval $(call TOOLS_STAGE_N_TARGET,2,3,$(host),$(target)))))
196195

197196
$(foreach host,$(CFG_HOST_TRIPLES), \
198197
$(eval $(call TOOLS_STAGE_N_HOST,0,1,$(host),$(host))) \

branches/auto/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn load_errors(testfile: &Path) -> ~[ExpectedError] {
2121
let mut line_num = 1u;
2222
while !rdr.eof() {
2323
let ln = rdr.read_line();
24-
error_patterns.push_all_move(parse_expected(line_num, ln));
24+
error_patterns += parse_expected(line_num, ln);
2525
line_num += 1u;
2626
}
2727
return error_patterns;

branches/auto/src/compiletest/runtest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ actual:\n\
226226
~"-L", config.build_base.to_str(),
227227
~"-L",
228228
aux_output_dir_name(config, testfile).to_str()];
229-
args.push_all_move(split_maybe_args(&config.rustcflags));
230-
args.push_all_move(split_maybe_args(&props.compile_flags));
229+
args += split_maybe_args(&config.rustcflags);
230+
args += split_maybe_args(&props.compile_flags);
231231
return ProcArgs {prog: config.rustc_path.to_str(), args: args};
232232
}
233233
}
@@ -581,8 +581,8 @@ fn make_compile_args(config: &config, props: &TestProps, extras: ~[~str],
581581
~"-o", xform(config, testfile).to_str(),
582582
~"-L", config.build_base.to_str()]
583583
+ extras;
584-
args.push_all_move(split_maybe_args(&config.rustcflags));
585-
args.push_all_move(split_maybe_args(&props.compile_flags));
584+
args += split_maybe_args(&config.rustcflags);
585+
args += split_maybe_args(&props.compile_flags);
586586
return ProcArgs {prog: config.rustc_path.to_str(), args: args};
587587
}
588588

branches/auto/src/etc/pkg/rust.iss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#define CFG_VERSION GetEnv("CFG_VERSION")
2-
#define CFG_VERSION_WIN GetEnv("CFG_VERSION_WIN")
32

43
[Setup]
54

@@ -9,7 +8,7 @@ AppVersion={#CFG_VERSION}
98
AppCopyright=Copyright (C) 2006-2013 Mozilla Foundation, MIT license
109
AppPublisher=Mozilla Foundation
1110
AppPublisherURL=http://www.rust-lang.org
12-
VersionInfoVersion={#CFG_VERSION_WIN}
11+
VersionInfoVersion={#CFG_VERSION}
1312
LicenseFile=LICENSE.txt
1413

1514
DisableWelcomePage=true

branches/auto/src/libextra/arc.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ impl<'self> Condvar<'self> {
112112
pub struct ARC<T> { x: UnsafeAtomicRcBox<T> }
113113

114114
/// Create an atomically reference counted wrapper.
115-
pub fn ARC<T:Freeze + Send>(data: T) -> ARC<T> {
115+
pub fn ARC<T:Const + Owned>(data: T) -> ARC<T> {
116116
ARC { x: UnsafeAtomicRcBox::new(data) }
117117
}
118118

119119
/**
120120
* Access the underlying data in an atomically reference counted
121121
* wrapper.
122122
*/
123-
impl<T:Freeze+Send> ARC<T> {
123+
impl<T:Const+Owned> ARC<T> {
124124
pub fn get<'a>(&'a self) -> &'a T {
125125
unsafe { &*self.x.get_immut() }
126126
}
@@ -133,7 +133,7 @@ impl<T:Freeze+Send> ARC<T> {
133133
* object. However, one of the `arc` objects can be sent to another task,
134134
* allowing them to share the underlying data.
135135
*/
136-
impl<T:Freeze + Send> Clone for ARC<T> {
136+
impl<T:Const + Owned> Clone for ARC<T> {
137137
fn clone(&self) -> ARC<T> {
138138
ARC { x: self.x.clone() }
139139
}
@@ -149,22 +149,22 @@ struct MutexARCInner<T> { lock: Mutex, failed: bool, data: T }
149149
struct MutexARC<T> { x: UnsafeAtomicRcBox<MutexARCInner<T>> }
150150

151151
/// Create a mutex-protected ARC with the supplied data.
152-
pub fn MutexARC<T:Send>(user_data: T) -> MutexARC<T> {
152+
pub fn MutexARC<T:Owned>(user_data: T) -> MutexARC<T> {
153153
mutex_arc_with_condvars(user_data, 1)
154154
}
155155
/**
156156
* Create a mutex-protected ARC with the supplied data and a specified number
157157
* of condvars (as sync::mutex_with_condvars).
158158
*/
159-
pub fn mutex_arc_with_condvars<T:Send>(user_data: T,
159+
pub fn mutex_arc_with_condvars<T:Owned>(user_data: T,
160160
num_condvars: uint) -> MutexARC<T> {
161161
let data =
162162
MutexARCInner { lock: mutex_with_condvars(num_condvars),
163163
failed: false, data: user_data };
164164
MutexARC { x: UnsafeAtomicRcBox::new(data) }
165165
}
166166

167-
impl<T:Send> Clone for MutexARC<T> {
167+
impl<T:Owned> Clone for MutexARC<T> {
168168
/// Duplicate a mutex-protected ARC, as arc::clone.
169169
fn clone(&self) -> MutexARC<T> {
170170
// NB: Cloning the underlying mutex is not necessary. Its reference
@@ -173,7 +173,7 @@ impl<T:Send> Clone for MutexARC<T> {
173173
}
174174
}
175175

176-
impl<T:Send> MutexARC<T> {
176+
impl<T:Owned> MutexARC<T> {
177177

178178
/**
179179
* Access the underlying mutable data with mutual exclusion from other
@@ -282,14 +282,14 @@ struct RWARC<T> {
282282
}
283283

284284
/// Create a reader/writer ARC with the supplied data.
285-
pub fn RWARC<T:Freeze + Send>(user_data: T) -> RWARC<T> {
285+
pub fn RWARC<T:Const + Owned>(user_data: T) -> RWARC<T> {
286286
rw_arc_with_condvars(user_data, 1)
287287
}
288288
/**
289289
* Create a reader/writer ARC with the supplied data and a specified number
290290
* of condvars (as sync::rwlock_with_condvars).
291291
*/
292-
pub fn rw_arc_with_condvars<T:Freeze + Send>(
292+
pub fn rw_arc_with_condvars<T:Const + Owned>(
293293
user_data: T,
294294
num_condvars: uint) -> RWARC<T>
295295
{
@@ -299,7 +299,7 @@ pub fn rw_arc_with_condvars<T:Freeze + Send>(
299299
RWARC { x: UnsafeAtomicRcBox::new(data), }
300300
}
301301

302-
impl<T:Freeze + Send> RWARC<T> {
302+
impl<T:Const + Owned> RWARC<T> {
303303
/// Duplicate a rwlock-protected ARC, as arc::clone.
304304
pub fn clone(&self) -> RWARC<T> {
305305
RWARC {
@@ -309,7 +309,7 @@ impl<T:Freeze + Send> RWARC<T> {
309309

310310
}
311311

312-
impl<T:Freeze + Send> RWARC<T> {
312+
impl<T:Const + Owned> RWARC<T> {
313313
/**
314314
* Access the underlying data mutably. Locks the rwlock in write mode;
315315
* other readers and writers will block.
@@ -435,7 +435,7 @@ impl<T:Freeze + Send> RWARC<T> {
435435
// lock it. This wraps the unsafety, with the justification that the 'lock'
436436
// field is never overwritten; only 'failed' and 'data'.
437437
#[doc(hidden)]
438-
fn borrow_rwlock<T:Freeze + Send>(state: *const RWARCInner<T>) -> *RWlock {
438+
fn borrow_rwlock<T:Const + Owned>(state: *const RWARCInner<T>) -> *RWlock {
439439
unsafe { cast::transmute(&const (*state).lock) }
440440
}
441441

@@ -452,7 +452,7 @@ pub struct RWReadMode<'self, T> {
452452
token: sync::RWlockReadMode<'self>,
453453
}
454454

455-
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
455+
impl<'self, T:Const + Owned> RWWriteMode<'self, T> {
456456
/// Access the pre-downgrade RWARC in write mode.
457457
pub fn write<U>(&mut self, blk: &fn(x: &mut T) -> U) -> U {
458458
match *self {
@@ -493,7 +493,7 @@ impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
493493
}
494494
}
495495

496-
impl<'self, T:Freeze + Send> RWReadMode<'self, T> {
496+
impl<'self, T:Const + Owned> RWReadMode<'self, T> {
497497
/// Access the post-downgrade rwlock in read mode.
498498
pub fn read<U>(&self, blk: &fn(x: &T) -> U) -> U {
499499
match *self {

branches/auto/src/libextra/arena.rs

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,20 @@ impl Arena {
186186
#[inline]
187187
fn alloc_pod_inner(&mut self, n_bytes: uint, align: uint) -> *u8 {
188188
unsafe {
189-
let this = transmute_mut_region(self);
190-
let start = round_up_to(this.pod_head.fill, align);
189+
// XXX: Borrow check
190+
let head = transmute_mut_region(&mut self.pod_head);
191+
192+
let start = round_up_to(head.fill, align);
191193
let end = start + n_bytes;
192-
if end > at_vec::capacity(this.pod_head.data) {
193-
return this.alloc_pod_grow(n_bytes, align);
194+
if end > at_vec::capacity(head.data) {
195+
return self.alloc_pod_grow(n_bytes, align);
194196
}
195-
this.pod_head.fill = end;
197+
head.fill = end;
196198

197199
//debug!("idx = %u, size = %u, align = %u, fill = %u",
198200
// start, n_bytes, align, head.fill);
199201

200-
ptr::offset(vec::raw::to_ptr(this.pod_head.data), start)
202+
ptr::offset(vec::raw::to_ptr(head.data), start)
201203
}
202204
}
203205

@@ -229,31 +231,21 @@ impl Arena {
229231
fn alloc_nonpod_inner(&mut self, n_bytes: uint, align: uint)
230232
-> (*u8, *u8) {
231233
unsafe {
232-
let start;
233-
let end;
234-
let tydesc_start;
235-
let after_tydesc;
236-
237-
{
238-
let head = transmute_mut_region(&mut self.head);
239-
240-
tydesc_start = head.fill;
241-
after_tydesc = head.fill + sys::size_of::<*TyDesc>();
242-
start = round_up_to(after_tydesc, align);
243-
end = start + n_bytes;
244-
}
234+
let head = transmute_mut_region(&mut self.head);
245235

246-
if end > at_vec::capacity(self.head.data) {
236+
let tydesc_start = head.fill;
237+
let after_tydesc = head.fill + sys::size_of::<*TyDesc>();
238+
let start = round_up_to(after_tydesc, align);
239+
let end = start + n_bytes;
240+
if end > at_vec::capacity(head.data) {
247241
return self.alloc_nonpod_grow(n_bytes, align);
248242
}
249-
250-
let head = transmute_mut_region(&mut self.head);
251243
head.fill = round_up_to(end, sys::pref_align_of::<*TyDesc>());
252244

253245
//debug!("idx = %u, size = %u, align = %u, fill = %u",
254246
// start, n_bytes, align, head.fill);
255247

256-
let buf = vec::raw::to_ptr(self.head.data);
248+
let buf = vec::raw::to_ptr(head.data);
257249
return (ptr::offset(buf, tydesc_start), ptr::offset(buf, start));
258250
}
259251
}

branches/auto/src/libextra/bitv.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,9 @@ impl Bitv {
476476
* character is either '0' or '1'.
477477
*/
478478
pub fn to_str(&self) -> ~str {
479-
let mut rs = ~"";
480-
for self.each() |i| {
481-
if i {
482-
rs.push_char('1');
483-
} else {
484-
rs.push_char('0');
485-
}
486-
};
487-
rs
479+
let mut rs = ~"";
480+
for self.each() |i| { if i { rs += "1"; } else { rs += "0"; } };
481+
rs
488482
}
489483

490484

0 commit comments

Comments
 (0)