Skip to content

Commit 3e5e91f

Browse files
author
Jakub Bukaj
committed
---
yaml --- r: 160063 b: refs/heads/try c: 1214409 h: refs/heads/master i: 160061: 9c7150a 160059: fcc8427 160055: 0fa92ef 160047: ffe1e2c 160031: 2382216 159999: 13d4cc4 v: v3
1 parent 55a7544 commit 3e5e91f

File tree

39 files changed

+428
-250
lines changed

39 files changed

+428
-250
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e09d98603e608c9e47d4c89f7b4dca87a4b56da3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
5-
refs/heads/try: 94169353eca74c3683b06cea2609a4350ed36c45
5+
refs/heads/try: 12144098eb0946fa925f7a0fbf52b2e4a701bf25
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/guide-pointers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ pass-by-reference. Basically, languages can make two choices (this is made
133133
up syntax, it's not Rust):
134134

135135
```{notrust,ignore}
136-
fn foo(x) {
136+
func foo(x) {
137137
x = 5
138138
}
139139
140-
fn main() {
140+
func main() {
141141
i = 1
142142
foo(i)
143143
// what is the value of i here?
@@ -153,11 +153,11 @@ So what do pointers have to do with this? Well, since pointers point to a
153153
location in memory...
154154

155155
```{notrust,ignore}
156-
fn foo(&int x) {
156+
func foo(&int x) {
157157
*x = 5
158158
}
159159
160-
fn main() {
160+
func main() {
161161
i = 1
162162
foo(&i)
163163
// what is the value of i here?
@@ -192,13 +192,13 @@ When you combine pointers and functions, it's easy to accidentally invalidate
192192
the memory the pointer is pointing to. For example:
193193

194194
```{notrust,ignore}
195-
fn make_pointer(): &int {
195+
func make_pointer(): &int {
196196
x = 5;
197197
198198
return &x;
199199
}
200200
201-
fn main() {
201+
func main() {
202202
&int i = make_pointer();
203203
*i = 5; // uh oh!
204204
}
@@ -214,11 +214,11 @@ issue. Two pointers are said to alias when they point at the same location
214214
in memory. Like this:
215215

216216
```{notrust,ignore}
217-
fn mutate(&int i, int j) {
217+
func mutate(&int i, int j) {
218218
*i = j;
219219
}
220220
221-
fn main() {
221+
func main() {
222222
x = 5;
223223
y = &x;
224224
z = &x; //y and z are aliased

branches/try/src/doc/po4a.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
[type: text] src/doc/guide-tasks.md $lang:doc/l10n/$lang/guide-tasks.md
2020
[type: text] src/doc/guide-testing.md $lang:doc/l10n/$lang/guide-testing.md
2121
[type: text] src/doc/guide-unsafe.md $lang:doc/l10n/$lang/guide-unsafe.md
22-
[type: text] src/doc/guide-unsafe.md $lang:doc/l10n/$lang/guide-crates.md
22+
[type: text] src/doc/guide-crates.md $lang:doc/l10n/$lang/guide-crates.md
2323
[type: text] src/doc/guide.md $lang:doc/l10n/$lang/guide.md
2424
[type: text] src/doc/index.md $lang:doc/l10n/$lang/index.md
2525
[type: text] src/doc/intro.md $lang:doc/l10n/$lang/intro.md

branches/try/src/doc/reference.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,9 +2653,10 @@ An expression may have two roles: it always produces a *value*, and it may have
26532653
value, and has effects during *evaluation*. Many expressions contain
26542654
sub-expressions (operands). The meaning of each kind of expression dictates
26552655
several things:
2656-
* Whether or not to evaluate the sub-expressions when evaluating the
2657-
* expression The order in which to evaluate the sub-expressions How to
2658-
* combine the sub-expressions' values to obtain the value of the expression.
2656+
2657+
* Whether or not to evaluate the sub-expressions when evaluating the expression
2658+
* The order in which to evaluate the sub-expressions
2659+
* How to combine the sub-expressions' values to obtain the value of the expression
26592660

26602661
In this way, the structure of expressions dictates the structure of execution.
26612662
Blocks are just another kind of expression, so blocks, statements, expressions,

branches/try/src/etc/snapshot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ def full_snapshot_name(date, rev, platform, hsh):
7575

7676

7777
def get_kernel(triple):
78-
os_name = triple.split('-')[2]
78+
t = triple.split('-')
79+
if len(t) == 2:
80+
os_name = t[1]
81+
else:
82+
os_name = t[2]
7983
if os_name == "windows":
8084
return "winnt"
8185
if os_name == "darwin":

branches/try/src/libcollections/bit.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ impl Bitv {
258258

259259
/// Retrieves the value at index `i`.
260260
///
261-
/// # Failure
261+
/// # Panics
262262
///
263-
/// Fails if `i` is out of bounds.
263+
/// Panics if `i` is out of bounds.
264264
///
265265
/// # Example
266266
///
@@ -285,9 +285,9 @@ impl Bitv {
285285

286286
/// Sets the value of a bit at a index `i`.
287287
///
288-
/// # Failure
288+
/// # Panics
289289
///
290-
/// Fails if `i` is out of bounds.
290+
/// Panics if `i` is out of bounds.
291291
///
292292
/// # Example
293293
///
@@ -353,9 +353,9 @@ impl Bitv {
353353
/// Sets `self` to the union of `self` and `other`. Both bitvectors must be
354354
/// the same length. Returns `true` if `self` changed.
355355
///
356-
/// # Failure
356+
/// # Panics
357357
///
358-
/// Fails if the bitvectors are of different lengths.
358+
/// Panics if the bitvectors are of different lengths.
359359
///
360360
/// # Example
361361
///
@@ -383,9 +383,9 @@ impl Bitv {
383383
/// Sets `self` to the intersection of `self` and `other`. Both bitvectors
384384
/// must be the same length. Returns `true` if `self` changed.
385385
///
386-
/// # Failure
386+
/// # Panics
387387
///
388-
/// Fails if the bitvectors are of different lengths.
388+
/// Panics if the bitvectors are of different lengths.
389389
///
390390
/// # Example
391391
///
@@ -413,9 +413,9 @@ impl Bitv {
413413
/// element of `other` at the same index. Both bitvectors must be the same
414414
/// length. Returns `true` if `self` changed.
415415
///
416-
/// # Failure
416+
/// # Panics
417417
///
418-
/// Fails if the bitvectors are of different length.
418+
/// Panics if the bitvectors are of different length.
419419
///
420420
/// # Example
421421
///
@@ -580,9 +580,9 @@ impl Bitv {
580580
/// Compares a `Bitv` to a slice of `bool`s.
581581
/// Both the `Bitv` and slice must have the same length.
582582
///
583-
/// # Failure
583+
/// # Panics
584584
///
585-
/// Fails if the the `Bitv` and slice are of different length.
585+
/// Panics if the the `Bitv` and slice are of different length.
586586
///
587587
/// # Example
588588
///
@@ -718,7 +718,7 @@ impl Bitv {
718718

719719
/// Shortens by one element and returns the removed element.
720720
///
721-
/// # Failure
721+
/// # Panics
722722
///
723723
/// Assert if empty.
724724
///

branches/try/src/libcollections/string.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,9 @@ impl String {
498498

499499
/// Shortens a string to the specified length.
500500
///
501-
/// # Failure
501+
/// # Panics
502502
///
503-
/// Fails if `new_len` > current length,
503+
/// Panics if `new_len` > current length,
504504
/// or if `new_len` is not a character boundary.
505505
///
506506
/// # Example

branches/try/src/libcollections/tree/set.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ impl<T: Ord> TreeSet<T> {
504504
/// # Example
505505
///
506506
/// ```
507-
/// use std::collections::BTreeSet;
507+
/// use std::collections::TreeSet;
508508
///
509-
/// let mut set = BTreeSet::new();
509+
/// let mut set = TreeSet::new();
510510
///
511511
/// assert_eq!(set.insert(2i), true);
512512
/// assert_eq!(set.insert(2i), false);
@@ -522,9 +522,9 @@ impl<T: Ord> TreeSet<T> {
522522
/// # Example
523523
///
524524
/// ```
525-
/// use std::collections::BTreeSet;
525+
/// use std::collections::TreeSet;
526526
///
527-
/// let mut set = BTreeSet::new();
527+
/// let mut set = TreeSet::new();
528528
///
529529
/// set.insert(2i);
530530
/// assert_eq!(set.remove(&2), true);

branches/try/src/libcollections/vec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,9 +941,9 @@ impl<T> Vec<T> {
941941

942942
/// Appends an element to the back of a collection.
943943
///
944-
/// # Failure
944+
/// # Panics
945945
///
946-
/// Fails if the number of elements in the vector overflows a `uint`.
946+
/// Panics if the number of elements in the vector overflows a `uint`.
947947
///
948948
/// # Example
949949
///
@@ -1462,9 +1462,9 @@ impl<T> Vec<T> {
14621462
/// Converts a `Vec<T>` to a `Vec<U>` where `T` and `U` have the same
14631463
/// size and in case they are not zero-sized the same minimal alignment.
14641464
///
1465-
/// # Failure
1465+
/// # Panics
14661466
///
1467-
/// Fails if `T` and `U` have differing sizes or are not zero-sized and
1467+
/// Panics if `T` and `U` have differing sizes or are not zero-sized and
14681468
/// have differing minimal alignments.
14691469
///
14701470
/// # Example

branches/try/src/libcore/atomic.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,19 @@ impl AtomicBool {
102102

103103
/// Load the value
104104
///
105-
/// # Failure
105+
/// # Panics
106106
///
107-
/// Fails if `order` is `Release` or `AcqRel`.
107+
/// Panics if `order` is `Release` or `AcqRel`.
108108
#[inline]
109109
pub fn load(&self, order: Ordering) -> bool {
110110
unsafe { atomic_load(self.v.get() as *const uint, order) > 0 }
111111
}
112112

113113
/// Store the value
114114
///
115-
/// # Failure
115+
/// # Panics
116116
///
117-
/// Fails if `order` is `Acquire` or `AcqRel`.
117+
/// Panics if `order` is `Acquire` or `AcqRel`.
118118
#[inline]
119119
pub fn store(&self, val: bool, order: Ordering) {
120120
let val = if val { UINT_TRUE } else { 0 };
@@ -313,19 +313,19 @@ impl AtomicInt {
313313

314314
/// Load the value
315315
///
316-
/// # Failure
316+
/// # Panics
317317
///
318-
/// Fails if `order` is `Release` or `AcqRel`.
318+
/// Panics if `order` is `Release` or `AcqRel`.
319319
#[inline]
320320
pub fn load(&self, order: Ordering) -> int {
321321
unsafe { atomic_load(self.v.get() as *const int, order) }
322322
}
323323

324324
/// Store the value
325325
///
326-
/// # Failure
326+
/// # Panics
327327
///
328-
/// Fails if `order` is `Acquire` or `AcqRel`.
328+
/// Panics if `order` is `Acquire` or `AcqRel`.
329329
#[inline]
330330
pub fn store(&self, val: int, order: Ordering) {
331331
unsafe { atomic_store(self.v.get(), val, order); }
@@ -435,19 +435,19 @@ impl AtomicUint {
435435

436436
/// Load the value
437437
///
438-
/// # Failure
438+
/// # Panics
439439
///
440-
/// Fails if `order` is `Release` or `AcqRel`.
440+
/// Panics if `order` is `Release` or `AcqRel`.
441441
#[inline]
442442
pub fn load(&self, order: Ordering) -> uint {
443443
unsafe { atomic_load(self.v.get() as *const uint, order) }
444444
}
445445

446446
/// Store the value
447447
///
448-
/// # Failure
448+
/// # Panics
449449
///
450-
/// Fails if `order` is `Acquire` or `AcqRel`.
450+
/// Panics if `order` is `Acquire` or `AcqRel`.
451451
#[inline]
452452
pub fn store(&self, val: uint, order: Ordering) {
453453
unsafe { atomic_store(self.v.get(), val, order); }
@@ -557,9 +557,9 @@ impl<T> AtomicPtr<T> {
557557

558558
/// Load the value
559559
///
560-
/// # Failure
560+
/// # Panics
561561
///
562-
/// Fails if `order` is `Release` or `AcqRel`.
562+
/// Panics if `order` is `Release` or `AcqRel`.
563563
#[inline]
564564
pub fn load(&self, order: Ordering) -> *mut T {
565565
unsafe {
@@ -569,9 +569,9 @@ impl<T> AtomicPtr<T> {
569569

570570
/// Store the value
571571
///
572-
/// # Failure
572+
/// # Panics
573573
///
574-
/// Fails if `order` is `Acquire` or `AcqRel`.
574+
/// Panics if `order` is `Acquire` or `AcqRel`.
575575
#[inline]
576576
pub fn store(&self, ptr: *mut T, order: Ordering) {
577577
unsafe { atomic_store(self.p.get(), ptr as uint, order); }
@@ -729,9 +729,9 @@ unsafe fn atomic_xor<T>(dst: *mut T, val: T, order: Ordering) -> T {
729729
///
730730
/// Accepts `Acquire`, `Release`, `AcqRel` and `SeqCst` orderings.
731731
///
732-
/// # Failure
732+
/// # Panics
733733
///
734-
/// Fails if `order` is `Relaxed`
734+
/// Panics if `order` is `Relaxed`
735735
#[inline]
736736
#[stable]
737737
pub fn fence(order: Ordering) {

branches/try/src/libcore/cell.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ impl<T> RefCell<T> {
274274
/// The borrow lasts until the returned `Ref` exits scope. Multiple
275275
/// immutable borrows can be taken out at the same time.
276276
///
277-
/// # Failure
277+
/// # Panics
278278
///
279-
/// Fails if the value is currently mutably borrowed.
279+
/// Panics if the value is currently mutably borrowed.
280280
#[unstable]
281281
pub fn borrow<'a>(&'a self) -> Ref<'a, T> {
282282
match self.try_borrow() {
@@ -307,9 +307,9 @@ impl<T> RefCell<T> {
307307
/// The borrow lasts until the returned `RefMut` exits scope. The value
308308
/// cannot be borrowed while this borrow is active.
309309
///
310-
/// # Failure
310+
/// # Panics
311311
///
312-
/// Fails if the value is currently borrowed.
312+
/// Panics if the value is currently borrowed.
313313
#[unstable]
314314
pub fn borrow_mut<'a>(&'a self) -> RefMut<'a, T> {
315315
match self.try_borrow_mut() {

0 commit comments

Comments
 (0)