Skip to content

Commit 534ad89

Browse files
author
Jakub Bukaj
committed
---
yaml --- r: 159614 b: refs/heads/auto c: 0d97b95 h: refs/heads/master v: v3
1 parent 2e6885b commit 534ad89

File tree

115 files changed

+1527
-1253
lines changed

Some content is hidden

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

115 files changed

+1527
-1253
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: fb954a1578f84ad9a8a42548eb3ec77069d13847
13+
refs/heads/auto: 0d97b95d43248c7bf0aa408fa39567245e9b794d
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ expensive. So we'd like to define a function that takes the points just as
5151
a reference.
5252

5353
~~~
54+
# use std::num::Float;
5455
# struct Point {x: f64, y: f64}
5556
# fn sqrt(f: f64) -> f64 { 0.0 }
5657
fn compute_distance(p1: &Point, p2: &Point) -> f64 {

branches/auto/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/auto/src/doc/guide-tasks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ Here is another example showing how futures allow you to background
225225
computations. The workload will be distributed on the available cores.
226226

227227
```{rust}
228+
# use std::num::Float;
228229
# use std::sync::Future;
229230
fn partial_sum(start: uint) -> f64 {
230231
let mut local_sum = 0f64;
@@ -262,6 +263,7 @@ several computations on a single large vector of floats. Each task needs the
262263
full vector to perform its duty.
263264

264265
```{rust}
266+
use std::num::Float;
265267
use std::rand;
266268
use std::sync::Arc;
267269

branches/auto/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/auto/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/auto/src/etc/make-win-dist.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def make_win_dist(dist_root, target_triple):
6262
"libcomctl32.a",
6363
"libcomdlg32.a",
6464
"libcrypt32.a",
65-
"libctl3d32.a",
6665
"libgdi32.a",
6766
"libimagehlp.a",
6867
"libiphlpapi.a",

branches/auto/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ syn keyword rustTrait FromIterator IntoIterator Extend ExactSize
9797
syn keyword rustTrait Iterator DoubleEndedIterator
9898
syn keyword rustTrait RandomAccessIterator CloneableIterator
9999
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator
100-
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
101-
syn keyword rustTrait Signed Unsigned Primitive Int Float
100+
syn keyword rustTrait NumCast Int SignedInt UnsignedInt Float
102101
syn keyword rustTrait FloatMath ToPrimitive FromPrimitive
103102
syn keyword rustTrait Box
104103
syn keyword rustTrait GenericPath Path PosixPath WindowsPath

branches/auto/src/libarena/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use std::cmp;
3838
use std::intrinsics::{TyDesc, get_tydesc};
3939
use std::intrinsics;
4040
use std::mem;
41-
use std::num;
41+
use std::num::{Int, UnsignedInt};
4242
use std::ptr;
4343
use std::rc::Rc;
4444
use std::rt::heap::{allocate, deallocate};
@@ -132,7 +132,7 @@ impl Drop for Arena {
132132

133133
#[inline]
134134
fn round_up(base: uint, align: uint) -> uint {
135-
(base.checked_add(&(align - 1))).unwrap() & !(align - 1)
135+
(base.checked_add(align - 1)).unwrap() & !(align - 1)
136136
}
137137

138138
// Walk down a chunk, running the destructors for any objects stored
@@ -187,7 +187,7 @@ impl Arena {
187187
self.chunks.borrow_mut().push(self.copy_head.borrow().clone());
188188

189189
*self.copy_head.borrow_mut() =
190-
chunk(num::next_power_of_two(new_min_chunk_size + 1u), true);
190+
chunk((new_min_chunk_size + 1u).next_power_of_two(), true);
191191

192192
return self.alloc_copy_inner(n_bytes, align);
193193
}
@@ -228,7 +228,7 @@ impl Arena {
228228
self.chunks.borrow_mut().push(self.head.borrow().clone());
229229

230230
*self.head.borrow_mut() =
231-
chunk(num::next_power_of_two(new_min_chunk_size + 1u), false);
231+
chunk((new_min_chunk_size + 1u).next_power_of_two(), false);
232232

233233
return self.alloc_noncopy_inner(n_bytes, align);
234234
}
@@ -376,8 +376,8 @@ fn calculate_size<T>(capacity: uint) -> uint {
376376
let mut size = mem::size_of::<TypedArenaChunk<T>>();
377377
size = round_up(size, mem::min_align_of::<T>());
378378
let elem_size = mem::size_of::<T>();
379-
let elems_size = elem_size.checked_mul(&capacity).unwrap();
380-
size = size.checked_add(&elems_size).unwrap();
379+
let elems_size = elem_size.checked_mul(capacity).unwrap();
380+
size = size.checked_add(elems_size).unwrap();
381381
size
382382
}
383383

@@ -432,7 +432,7 @@ impl<T> TypedArenaChunk<T> {
432432
#[inline]
433433
fn end(&self) -> *const u8 {
434434
unsafe {
435-
let size = mem::size_of::<T>().checked_mul(&self.capacity).unwrap();
435+
let size = mem::size_of::<T>().checked_mul(self.capacity).unwrap();
436436
self.start().offset(size as int)
437437
}
438438
}
@@ -481,7 +481,7 @@ impl<T> TypedArena<T> {
481481
fn grow(&self) {
482482
unsafe {
483483
let chunk = *self.first.borrow_mut();
484-
let new_capacity = (*chunk).capacity.checked_mul(&2).unwrap();
484+
let new_capacity = (*chunk).capacity.checked_mul(2).unwrap();
485485
let chunk = TypedArenaChunk::<T>::new(chunk, new_capacity);
486486
self.ptr.set((*chunk).start() as *const T);
487487
self.end.set((*chunk).end() as *const T);

branches/auto/src/libcollections/bit.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//!
2323
//! ```
2424
//! use std::collections::{BitvSet, Bitv};
25+
//! use std::num::Float;
2526
//! use std::iter;
2627
//!
2728
//! let max_prime = 10000;
@@ -69,6 +70,7 @@ use core::default::Default;
6970
use core::fmt;
7071
use core::iter::{Chain, Enumerate, Repeat, Skip, Take};
7172
use core::iter;
73+
use core::num::Int;
7274
use core::slice;
7375
use core::u32;
7476
use std::hash;
@@ -256,9 +258,9 @@ impl Bitv {
256258

257259
/// Retrieves the value at index `i`.
258260
///
259-
/// # Failure
261+
/// # Panics
260262
///
261-
/// Fails if `i` is out of bounds.
263+
/// Panics if `i` is out of bounds.
262264
///
263265
/// # Example
264266
///
@@ -283,9 +285,9 @@ impl Bitv {
283285

284286
/// Sets the value of a bit at a index `i`.
285287
///
286-
/// # Failure
288+
/// # Panics
287289
///
288-
/// Fails if `i` is out of bounds.
290+
/// Panics if `i` is out of bounds.
289291
///
290292
/// # Example
291293
///
@@ -351,9 +353,9 @@ impl Bitv {
351353
/// Sets `self` to the union of `self` and `other`. Both bitvectors must be
352354
/// the same length. Returns `true` if `self` changed.
353355
///
354-
/// # Failure
356+
/// # Panics
355357
///
356-
/// Fails if the bitvectors are of different lengths.
358+
/// Panics if the bitvectors are of different lengths.
357359
///
358360
/// # Example
359361
///
@@ -381,9 +383,9 @@ impl Bitv {
381383
/// Sets `self` to the intersection of `self` and `other`. Both bitvectors
382384
/// must be the same length. Returns `true` if `self` changed.
383385
///
384-
/// # Failure
386+
/// # Panics
385387
///
386-
/// Fails if the bitvectors are of different lengths.
388+
/// Panics if the bitvectors are of different lengths.
387389
///
388390
/// # Example
389391
///
@@ -411,9 +413,9 @@ impl Bitv {
411413
/// element of `other` at the same index. Both bitvectors must be the same
412414
/// length. Returns `true` if `self` changed.
413415
///
414-
/// # Failure
416+
/// # Panics
415417
///
416-
/// Fails if the bitvectors are of different length.
418+
/// Panics if the bitvectors are of different length.
417419
///
418420
/// # Example
419421
///
@@ -578,9 +580,9 @@ impl Bitv {
578580
/// Compares a `Bitv` to a slice of `bool`s.
579581
/// Both the `Bitv` and slice must have the same length.
580582
///
581-
/// # Failure
583+
/// # Panics
582584
///
583-
/// Fails if the the `Bitv` and slice are of different length.
585+
/// Panics if the the `Bitv` and slice are of different length.
584586
///
585587
/// # Example
586588
///
@@ -716,7 +718,7 @@ impl Bitv {
716718

717719
/// Shortens by one element and returns the removed element.
718720
///
719-
/// # Failure
721+
/// # Panics
720722
///
721723
/// Assert if empty.
722724
///

branches/auto/src/libcollections/enum_set.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
1616
use core::prelude::*;
1717
use core::fmt;
18+
use core::num::Int;
1819

1920
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
2021

branches/auto/src/libcollections/hash/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ use alloc::boxed::Box;
6969
use alloc::rc::Rc;
7070
use core::intrinsics::TypeId;
7171
use core::mem;
72+
use core::num::Int;
7273

7374
use vec::Vec;
7475

branches/auto/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

0 commit comments

Comments
 (0)