Skip to content

Commit 4ce718b

Browse files
committed
---
yaml --- r: 89947 b: refs/heads/master c: 5e1e487 h: refs/heads/master i: 89945: 6747c05 89943: 4b02a5e v: v3
1 parent b9f2149 commit 4ce718b

File tree

168 files changed

+1620
-2215
lines changed

Some content is hidden

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

168 files changed

+1620
-2215
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f804bd94d5b43723e0f156114ab9fd7eea98fc8f
2+
refs/heads/master: 5e1e487624a134e99371fff073862c90da479755
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3162,7 +3162,7 @@ Borrowed pointers (`&`)
31623162
Borrowed pointers arise by (automatic) conversion from owning pointers, managed pointers,
31633163
or by applying the borrowing operator `&` to some other value,
31643164
including [lvalues, rvalues or temporaries](#lvalues-rvalues-and-temporaries).
3165-
Borrowed pointers are written `&content`, or in some cases `&'f content` for some lifetime-variable `f`,
3165+
Borrowed pointers are written `&content`, or in some cases `&f/content` for some lifetime-variable `f`,
31663166
for example `&int` means a borrowed pointer to an integer.
31673167
Copying a borrowed pointer is a "shallow" operation:
31683168
it involves only copying the pointer itself.

trunk/src/libextra/arc.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<T:Send> MutexArc<T> {
220220
* blocked on the mutex) will also fail immediately.
221221
*/
222222
#[inline]
223-
pub unsafe fn unsafe_access<U>(&self, blk: |x: &mut T| -> U) -> U {
223+
pub unsafe fn unsafe_access<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
224224
let state = self.x.get();
225225
// Borrowck would complain about this if the function were
226226
// not already unsafe. See borrow_rwlock, far below.
@@ -234,7 +234,8 @@ impl<T:Send> MutexArc<T> {
234234
/// As unsafe_access(), but with a condvar, as sync::mutex.lock_cond().
235235
#[inline]
236236
pub unsafe fn unsafe_access_cond<U>(&self,
237-
blk: |x: &mut T, c: &Condvar| -> U)
237+
blk: &fn(x: &mut T,
238+
c: &Condvar) -> U)
238239
-> U {
239240
let state = self.x.get();
240241
do (&(*state).lock).lock_cond |cond| {
@@ -283,14 +284,15 @@ impl<T:Freeze + Send> MutexArc<T> {
283284
* unsafe_access_cond.
284285
*/
285286
#[inline]
286-
pub fn access<U>(&self, blk: |x: &mut T| -> U) -> U {
287+
pub fn access<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
287288
unsafe { self.unsafe_access(blk) }
288289
}
289290

290291
/// As unsafe_access_cond but safe and Freeze.
291292
#[inline]
292293
pub fn access_cond<U>(&self,
293-
blk: |x: &mut T, c: &Condvar| -> U)
294+
blk: &fn(x: &mut T,
295+
c: &Condvar) -> U)
294296
-> U {
295297
unsafe { self.unsafe_access_cond(blk) }
296298
}
@@ -387,7 +389,7 @@ impl<T:Freeze + Send> RWArc<T> {
387389
* poison the Arc, so subsequent readers and writers will both also fail.
388390
*/
389391
#[inline]
390-
pub fn write<U>(&self, blk: |x: &mut T| -> U) -> U {
392+
pub fn write<U>(&self, blk: &fn(x: &mut T) -> U) -> U {
391393
unsafe {
392394
let state = self.x.get();
393395
do (*borrow_rwlock(state)).write {
@@ -401,7 +403,7 @@ impl<T:Freeze + Send> RWArc<T> {
401403
/// As write(), but with a condvar, as sync::rwlock.write_cond().
402404
#[inline]
403405
pub fn write_cond<U>(&self,
404-
blk: |x: &mut T, c: &Condvar| -> U)
406+
blk: &fn(x: &mut T, c: &Condvar) -> U)
405407
-> U {
406408
unsafe {
407409
let state = self.x.get();
@@ -425,7 +427,7 @@ impl<T:Freeze + Send> RWArc<T> {
425427
* Failing will unlock the Arc while unwinding. However, unlike all other
426428
* access modes, this will not poison the Arc.
427429
*/
428-
pub fn read<U>(&self, blk: |x: &T| -> U) -> U {
430+
pub fn read<U>(&self, blk: &fn(x: &T) -> U) -> U {
429431
unsafe {
430432
let state = self.x.get();
431433
do (*state).lock.read {
@@ -455,7 +457,7 @@ impl<T:Freeze + Send> RWArc<T> {
455457
* }
456458
* ```
457459
*/
458-
pub fn write_downgrade<U>(&self, blk: |v: RWWriteMode<T>| -> U) -> U {
460+
pub fn write_downgrade<U>(&self, blk: &fn(v: RWWriteMode<T>) -> U) -> U {
459461
unsafe {
460462
let state = self.x.get();
461463
do (*borrow_rwlock(state)).write_downgrade |write_mode| {
@@ -537,7 +539,7 @@ pub struct RWReadMode<'self, T> {
537539

538540
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
539541
/// Access the pre-downgrade RWArc in write mode.
540-
pub fn write<U>(&mut self, blk: |x: &mut T| -> U) -> U {
542+
pub fn write<U>(&mut self, blk: &fn(x: &mut T) -> U) -> U {
541543
match *self {
542544
RWWriteMode {
543545
data: &ref mut data,
@@ -553,7 +555,7 @@ impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
553555

554556
/// Access the pre-downgrade RWArc in write mode with a condvar.
555557
pub fn write_cond<U>(&mut self,
556-
blk: |x: &mut T, c: &Condvar| -> U)
558+
blk: &fn(x: &mut T, c: &Condvar) -> U)
557559
-> U {
558560
match *self {
559561
RWWriteMode {
@@ -578,7 +580,7 @@ impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
578580

579581
impl<'self, T:Freeze + Send> RWReadMode<'self, T> {
580582
/// Access the post-downgrade rwlock in read mode.
581-
pub fn read<U>(&self, blk: |x: &T| -> U) -> U {
583+
pub fn read<U>(&self, blk: &fn(x: &T) -> U) -> U {
582584
match *self {
583585
RWReadMode {
584586
data: data,

trunk/src/libextra/arena.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl Arena {
184184
}
185185

186186
#[inline]
187-
fn alloc_pod<'a, T>(&'a mut self, op: || -> T) -> &'a T {
187+
fn alloc_pod<'a, T>(&'a mut self, op: &fn() -> T) -> &'a T {
188188
unsafe {
189189
let tydesc = get_tydesc::<T>();
190190
let ptr = self.alloc_pod_inner((*tydesc).size, (*tydesc).align);
@@ -241,7 +241,7 @@ impl Arena {
241241
}
242242

243243
#[inline]
244-
fn alloc_nonpod<'a, T>(&'a mut self, op: || -> T) -> &'a T {
244+
fn alloc_nonpod<'a, T>(&'a mut self, op: &fn() -> T) -> &'a T {
245245
unsafe {
246246
let tydesc = get_tydesc::<T>();
247247
let (ty_ptr, ptr) =
@@ -263,7 +263,7 @@ impl Arena {
263263

264264
// The external interface
265265
#[inline]
266-
pub fn alloc<'a, T>(&'a self, op: || -> T) -> &'a T {
266+
pub fn alloc<'a, T>(&'a self, op: &fn() -> T) -> &'a T {
267267
unsafe {
268268
// XXX: Borrow check
269269
let this = transmute_mut(self);

trunk/src/libextra/bitv.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl SmallBitv {
4040
pub fn bits_op(&mut self,
4141
right_bits: uint,
4242
nbits: uint,
43-
f: |uint, uint| -> uint)
43+
f: &fn(uint, uint) -> uint)
4444
-> bool {
4545
let mask = small_mask(nbits);
4646
let old_b: uint = self.bits;
@@ -140,7 +140,7 @@ impl BigBitv {
140140
pub fn process(&mut self,
141141
b: &BigBitv,
142142
nbits: uint,
143-
op: |uint, uint| -> uint)
143+
op: &fn(uint, uint) -> uint)
144144
-> bool {
145145
let len = b.storage.len();
146146
assert_eq!(self.storage.len(), len);
@@ -161,7 +161,7 @@ impl BigBitv {
161161
}
162162

163163
#[inline]
164-
pub fn each_storage(&mut self, op: |v: &mut uint| -> bool) -> bool {
164+
pub fn each_storage(&mut self, op: &fn(v: &mut uint) -> bool) -> bool {
165165
self.storage.mut_iter().advance(|elt| op(elt))
166166
}
167167

@@ -512,7 +512,7 @@ impl Bitv {
512512
true
513513
}
514514

515-
pub fn ones(&self, f: |uint| -> bool) -> bool {
515+
pub fn ones(&self, f: &fn(uint) -> bool) -> bool {
516516
range(0u, self.nbits).advance(|i| !self.get(i) || f(i))
517517
}
518518

@@ -542,7 +542,7 @@ pub fn from_bools(bools: &[bool]) -> Bitv {
542542
* Create a `Bitv` of the specified length where the value at each
543543
* index is `f(index)`.
544544
*/
545-
pub fn from_fn(len: uint, f: |index: uint| -> bool) -> Bitv {
545+
pub fn from_fn(len: uint, f: &fn(index: uint) -> bool) -> Bitv {
546546
let mut bitv = Bitv::new(len, false);
547547
for i in range(0u, len) {
548548
bitv.set(i, f(i));
@@ -557,7 +557,7 @@ impl ops::Index<uint,bool> for Bitv {
557557
}
558558

559559
#[inline]
560-
fn iterate_bits(base: uint, bits: uint, f: |uint| -> bool) -> bool {
560+
fn iterate_bits(base: uint, bits: uint, f: &fn(uint) -> bool) -> bool {
561561
if bits == 0 {
562562
return true;
563563
}
@@ -675,7 +675,7 @@ impl BitvSet {
675675
}
676676

677677
#[inline]
678-
fn other_op(&mut self, other: &BitvSet, f: |uint, uint| -> uint) {
678+
fn other_op(&mut self, other: &BitvSet, f: &fn(uint, uint) -> uint) {
679679
fn nbits(mut w: uint) -> uint {
680680
let mut bits = 0;
681681
for _ in range(0u, uint::bits) {
@@ -722,7 +722,7 @@ impl BitvSet {
722722
BitvSetIterator {set: self, next_idx: 0}
723723
}
724724

725-
pub fn difference(&self, other: &BitvSet, f: |&uint| -> bool) -> bool {
725+
pub fn difference(&self, other: &BitvSet, f: &fn(&uint) -> bool) -> bool {
726726
for (i, w1, w2) in self.common_iter(other) {
727727
if !iterate_bits(i, w1 & !w2, |b| f(&b)) {
728728
return false
@@ -734,8 +734,8 @@ impl BitvSet {
734734
)
735735
}
736736

737-
pub fn symmetric_difference(&self, other: &BitvSet, f: |&uint| -> bool)
738-
-> bool {
737+
pub fn symmetric_difference(&self, other: &BitvSet,
738+
f: &fn(&uint) -> bool) -> bool {
739739
for (i, w1, w2) in self.common_iter(other) {
740740
if !iterate_bits(i, w1 ^ w2, |b| f(&b)) {
741741
return false
@@ -744,11 +744,11 @@ impl BitvSet {
744744
self.outlier_iter(other).advance(|(_, i, w)| iterate_bits(i, w, |b| f(&b)))
745745
}
746746

747-
pub fn intersection(&self, other: &BitvSet, f: |&uint| -> bool) -> bool {
747+
pub fn intersection(&self, other: &BitvSet, f: &fn(&uint) -> bool) -> bool {
748748
self.common_iter(other).advance(|(i, w1, w2)| iterate_bits(i, w1 & w2, |b| f(&b)))
749749
}
750750

751-
pub fn union(&self, other: &BitvSet, f: |&uint| -> bool) -> bool {
751+
pub fn union(&self, other: &BitvSet, f: &fn(&uint) -> bool) -> bool {
752752
for (i, w1, w2) in self.common_iter(other) {
753753
if !iterate_bits(i, w1 | w2, |b| f(&b)) {
754754
return false

trunk/src/libextra/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<T> DList<T> {
320320
/// or at the end.
321321
///
322322
/// O(N)
323-
pub fn insert_when(&mut self, elt: T, f: |&T, &T| -> bool) {
323+
pub fn insert_when(&mut self, elt: T, f: &fn(&T, &T) -> bool) {
324324
{
325325
let mut it = self.mut_iter();
326326
loop {
@@ -339,7 +339,7 @@ impl<T> DList<T> {
339339
/// put `a` in the result if `f(a, b)` is true, else `b`.
340340
///
341341
/// O(max(N, M))
342-
pub fn merge(&mut self, mut other: DList<T>, f: |&T, &T| -> bool) {
342+
pub fn merge(&mut self, mut other: DList<T>, f: &fn(&T, &T) -> bool) {
343343
{
344344
let mut it = self.mut_iter();
345345
loop {

0 commit comments

Comments
 (0)