Skip to content

Commit 10d7412

Browse files
committed
---
yaml --- r: 106219 b: refs/heads/auto c: e46e933 h: refs/heads/master i: 106217: 9a5f61a 106215: 19b9ff3 v: v3
1 parent e3a47d6 commit 10d7412

File tree

207 files changed

+4620
-2578
lines changed

Some content is hidden

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

207 files changed

+4620
-2578
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 841f31ecf942531b54c8ee991924aa969666ee72
16+
refs/heads/auto: e46e9332d9574790ccf41ae56ffa1010c4267ba1
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
337337
}
338338
}
339339

340-
if tool_path.is_empty() {
340+
if tool_path.equals(&~"") {
341341
fatal(~"cannot found android cross path");
342342
}
343343

@@ -452,7 +452,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
452452
let options_to_remove = [~"-O", ~"-g", ~"--debuginfo"];
453453
let new_options = split_maybe_args(options).move_iter()
454454
.filter(|x| !options_to_remove.contains(x))
455-
.collect::<~[~str]>()
455+
.to_owned_vec()
456456
.connect(" ");
457457
Some(new_options)
458458
}

branches/auto/src/doc/guide-tasks.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -493,14 +493,14 @@ Here is the function that implements the child task:
493493
~~~
494494
extern crate sync;
495495
# fn main() {
496-
fn stringifier(channel: &sync::DuplexStream<~str, uint>) {
497-
let mut value: uint;
498-
loop {
499-
value = channel.recv();
500-
channel.send(value.to_str());
501-
if value == 0 { break; }
496+
fn stringifier(channel: &sync::DuplexStream<~str, uint>) {
497+
let mut value: uint;
498+
loop {
499+
value = channel.recv();
500+
channel.send(value.to_str());
501+
if value == 0 { break; }
502+
}
502503
}
503-
}
504504
# }
505505
~~~~
506506

branches/auto/src/doc/rust.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ never invoking this behaviour or exposing an API making it possible for it to oc
10191019

10201020
* Data races
10211021
* Dereferencing a null/dangling raw pointer
1022-
* Mutating an immutable value/reference
1022+
* Mutating an immutable value/reference, if it is not marked as non-`Freeze`
10231023
* Reads of [undef](http://llvm.org/docs/LangRef.html#undefined-values) (uninitialized) memory
10241024
* Breaking the [pointer aliasing rules](http://llvm.org/docs/LangRef.html#pointer-aliasing-rules)
10251025
with raw pointers (a subset of the rules used by C)
@@ -3434,6 +3434,10 @@ call to the method `make_string`.
34343434
Types in Rust are categorized into kinds, based on various properties of the components of the type.
34353435
The kinds are:
34363436

3437+
`Freeze`
3438+
: Types of this kind are deeply immutable;
3439+
they contain no mutable memory locations
3440+
directly or indirectly via pointers.
34373441
`Send`
34383442
: Types of this kind can be safely sent between tasks.
34393443
This kind includes scalars, owning pointers, owned closures, and

branches/auto/src/doc/tutorial.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,6 +2099,10 @@ unless they contain managed boxes, managed closures, or references.
20992099
These are types that are safe to be used across several threads with access to
21002100
a `&T` pointer. `MutexArc` is an example of a *sharable* type with internal mutable data.
21012101
2102+
* `Freeze` - Constant (immutable) types.
2103+
These are types that do not contain anything intrinsically mutable.
2104+
Intrinsically mutable values include `Cell` in the standard library.
2105+
21022106
* `'static` - Non-borrowed types.
21032107
These are types that do not contain any data whose lifetime is bound to
21042108
a particular stack frame. These are types that do not contain any
@@ -2148,7 +2152,7 @@ We say that the `Printable` trait _provides_ a `print` method with the
21482152
given signature. This means that we can call `print` on an argument
21492153
of any type that implements the `Printable` trait.
21502154
2151-
Rust's built-in `Send` and `Share` types are examples of traits that
2155+
Rust's built-in `Send` and `Freeze` types are examples of traits that
21522156
don't provide any methods.
21532157
21542158
Traits may be implemented for specific types with [impls]. An impl for
@@ -2440,15 +2444,15 @@ Consequently, the trait objects themselves automatically fulfill their
24402444
respective kind bounds. However, this default behavior can be overridden by
24412445
specifying a list of bounds on the trait type, for example, by writing `~Trait:`
24422446
(which indicates that the contents of the owned trait need not fulfill any
2443-
bounds), or by writing `~Trait:Send+Share`, which indicates that in addition
2444-
to fulfilling `Send`, contents must also fulfill `Share`, and as a consequence,
2445-
the trait itself fulfills `Share`.
2447+
bounds), or by writing `~Trait:Send+Freeze`, which indicates that in addition
2448+
to fulfilling `Send`, contents must also fulfill `Freeze`, and as a consequence,
2449+
the trait itself fulfills `Freeze`.
24462450
24472451
* `~Trait:Send` is equivalent to `~Trait`.
24482452
* `&Trait:` is equivalent to `&Trait`.
24492453
24502454
Builtin kind bounds can also be specified on closure types in the same way (for
2451-
example, by writing `fn:Send()`), and the default behaviours are the same as
2455+
example, by writing `fn:Freeze()`), and the default behaviours are the same as
24522456
for traits of the same storage class.
24532457
24542458
## Trait inheritance

branches/auto/src/driver/driver.rs

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

11+
#[no_uv]; // remove this after stage0
12+
#[allow(attribute_usage)]; // remove this after stage0
13+
extern crate native; // remove this after stage0
14+
1115
#[cfg(rustdoc)]
1216
extern crate this = "rustdoc";
1317

branches/auto/src/libarena/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
html_root_url = "http://static.rust-lang.org/doc/master")];
2525
#[allow(missing_doc)];
2626
#[feature(managed_boxes)];
27+
#[allow(deprecated_owned_vector)]; // NOTE: remove after stage0
2728

2829
extern crate collections;
2930

@@ -36,6 +37,7 @@ use std::mem;
3637
use std::ptr::read;
3738
use std::cmp;
3839
use std::num;
40+
use std::kinds::marker;
3941
use std::rc::Rc;
4042
use std::rt::global_heap;
4143
use std::intrinsics::{TyDesc, get_tydesc};
@@ -52,11 +54,11 @@ struct Chunk {
5254
}
5355
impl Chunk {
5456
fn capacity(&self) -> uint {
55-
self.data.borrow().capacity()
57+
self.data.deref().borrow().get().capacity()
5658
}
5759

5860
unsafe fn as_ptr(&self) -> *u8 {
59-
self.data.borrow().as_ptr()
61+
self.data.deref().borrow().get().as_ptr()
6062
}
6163
}
6264

@@ -88,6 +90,7 @@ pub struct Arena {
8890
priv head: Chunk,
8991
priv pod_head: Chunk,
9092
priv chunks: RefCell<@List<Chunk>>,
93+
priv no_freeze: marker::NoFreeze,
9194
}
9295

9396
impl Arena {
@@ -100,6 +103,7 @@ impl Arena {
100103
head: chunk(initial_size, false),
101104
pod_head: chunk(initial_size, true),
102105
chunks: RefCell::new(@Nil),
106+
no_freeze: marker::NoFreeze,
103107
}
104108
}
105109
}

branches/auto/src/libcollections/btree.rs

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for BTree<K, V> {
9494

9595
impl<K: TotalOrd, V: TotalEq> Eq for BTree<K, V> {
9696
fn eq(&self, other: &BTree<K, V>) -> bool {
97-
self.root.cmp(&other.root) == Equal
97+
self.equals(other)
9898
}
9999
}
100100

101-
impl<K: TotalOrd, V: TotalEq> TotalEq for BTree<K, V> {}
101+
impl<K: TotalOrd, V: TotalEq> TotalEq for BTree<K, V> {
102+
///Testing equality on BTrees by comparing the root.
103+
fn equals(&self, other: &BTree<K, V>) -> bool {
104+
self.root.cmp(&other.root) == Equal
105+
}
106+
}
102107

103108
impl<K: TotalOrd, V: TotalEq> Ord for BTree<K, V> {
104109
fn lt(&self, other: &BTree<K, V>) -> bool {
@@ -199,6 +204,14 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Node<K, V> {
199204

200205
impl<K: TotalOrd, V: TotalEq> Eq for Node<K, V> {
201206
fn eq(&self, other: &Node<K, V>) -> bool {
207+
self.equals(other)
208+
}
209+
}
210+
211+
impl<K: TotalOrd, V: TotalEq> TotalEq for Node<K, V> {
212+
///Returns whether two nodes are equal based on the keys of each element.
213+
///Two nodes are equal if all of their keys are the same.
214+
fn equals(&self, other: &Node<K, V>) -> bool{
202215
match *self{
203216
BranchNode(ref branch) => {
204217
if other.is_leaf() {
@@ -219,8 +232,6 @@ impl<K: TotalOrd, V: TotalEq> Eq for Node<K, V> {
219232
}
220233
}
221234

222-
impl<K: TotalOrd, V: TotalEq> TotalEq for Node<K, V> {}
223-
224235
impl<K: TotalOrd, V: TotalEq> Ord for Node<K, V> {
225236
fn lt(&self, other: &Node<K, V>) -> bool {
226237
self.cmp(other) == Less
@@ -394,11 +405,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Leaf<K, V> {
394405

395406
impl<K: TotalOrd, V: TotalEq> Eq for Leaf<K, V> {
396407
fn eq(&self, other: &Leaf<K, V>) -> bool {
397-
self.elts == other.elts
408+
self.equals(other)
398409
}
399410
}
400411

401-
impl<K: TotalOrd, V: TotalEq> TotalEq for Leaf<K, V> {}
412+
impl<K: TotalOrd, V: TotalEq> TotalEq for Leaf<K, V> {
413+
///Implementation of equals function for leaves that compares LeafElts.
414+
fn equals(&self, other: &Leaf<K, V>) -> bool {
415+
self.elts.equals(&other.elts)
416+
}
417+
}
402418

403419
impl<K: TotalOrd, V: TotalEq> Ord for Leaf<K, V> {
404420
fn lt(&self, other: &Leaf<K, V>) -> bool {
@@ -623,11 +639,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for Branch<K, V> {
623639

624640
impl<K: TotalOrd, V: TotalEq> Eq for Branch<K, V> {
625641
fn eq(&self, other: &Branch<K, V>) -> bool {
626-
self.elts == other.elts
642+
self.equals(other)
627643
}
628644
}
629645

630-
impl<K: TotalOrd, V: TotalEq> TotalEq for Branch<K, V> {}
646+
impl<K: TotalOrd, V: TotalEq> TotalEq for Branch<K, V> {
647+
///Equals function for Branches--compares all the elements in each branch
648+
fn equals(&self, other: &Branch<K, V>) -> bool {
649+
self.elts.equals(&other.elts)
650+
}
651+
}
631652

632653
impl<K: TotalOrd, V: TotalEq> Ord for Branch<K, V> {
633654
fn lt(&self, other: &Branch<K, V>) -> bool {
@@ -691,11 +712,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for LeafElt<K, V> {
691712

692713
impl<K: TotalOrd, V: TotalEq> Eq for LeafElt<K, V> {
693714
fn eq(&self, other: &LeafElt<K, V>) -> bool {
694-
self.key == other.key && self.value == other.value
715+
self.equals(other)
695716
}
696717
}
697718

698-
impl<K: TotalOrd, V: TotalEq> TotalEq for LeafElt<K, V> {}
719+
impl<K: TotalOrd, V: TotalEq> TotalEq for LeafElt<K, V> {
720+
///TotalEq for LeafElts
721+
fn equals(&self, other: &LeafElt<K, V>) -> bool {
722+
self.key.equals(&other.key) && self.value.equals(&other.value)
723+
}
724+
}
699725

700726
impl<K: TotalOrd, V: TotalEq> Ord for LeafElt<K, V> {
701727
fn lt(&self, other: &LeafElt<K, V>) -> bool {
@@ -740,11 +766,16 @@ impl<K: Clone + TotalOrd, V: Clone> Clone for BranchElt<K, V> {
740766

741767
impl<K: TotalOrd, V: TotalEq> Eq for BranchElt<K, V>{
742768
fn eq(&self, other: &BranchElt<K, V>) -> bool {
743-
self.key == other.key && self.value == other.value
769+
self.equals(other)
744770
}
745771
}
746772

747-
impl<K: TotalOrd, V: TotalEq> TotalEq for BranchElt<K, V>{}
773+
impl<K: TotalOrd, V: TotalEq> TotalEq for BranchElt<K, V>{
774+
///TotalEq for BranchElts
775+
fn equals(&self, other: &BranchElt<K, V>) -> bool {
776+
self.key.equals(&other.key)&&self.value.equals(&other.value)
777+
}
778+
}
748779

749780
impl<K: TotalOrd, V: TotalEq> Ord for BranchElt<K, V> {
750781
fn lt(&self, other: &BranchElt<K, V>) -> bool {
@@ -869,7 +900,7 @@ mod test_btree {
869900
fn btree_clone_test() {
870901
let b = BTree::new(1, ~"abc", 2);
871902
let b2 = b.clone();
872-
assert!(b.root == b2.root)
903+
assert!(b.root.equals(&b2.root))
873904
}
874905
875906
//Tests the BTree's cmp() method when one node is "less than" another.

branches/auto/src/libcollections/enum_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
use std::num::Bitwise;
1717

18-
#[deriving(Clone, Eq, TotalEq, Hash, Show)]
18+
#[deriving(Clone, Eq, Hash, Show)]
1919
/// A specialized Set implementation to use enum types.
2020
pub struct EnumSet<E> {
2121
// We must maintain the invariant that no bits are set

0 commit comments

Comments
 (0)