Skip to content

Commit 657029b

Browse files
committed
---
yaml --- r: 106294 b: refs/heads/auto c: 5fddb42 h: refs/heads/master v: v3
1 parent bb43e1a commit 657029b

Some content is hidden

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

68 files changed

+488
-380
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: de85948ac0a6bc0fde0484790296cb4e041e993f
16+
refs/heads/auto: 5fddb4280e950c28916ac21838f7433cd199aaed
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/install.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
# The stage we install from
1616
ISTAGE = $(PREPARE_STAGE)
1717

18-
$(eval $(call DEF_PREPARE,mkfile-install))
19-
2018
install: PREPARE_HOST=$(CFG_BUILD)
2119
install: PREPARE_TARGETS=$(CFG_TARGET)
2220
install: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
@@ -30,7 +28,7 @@ install: PREPARE_SOURCE_MAN_DIR=$(S)/man
3028
install: PREPARE_DEST_BIN_DIR=$(DESTDIR)$(CFG_PREFIX)/bin
3129
install: PREPARE_DEST_LIB_DIR=$(DESTDIR)$(CFG_LIBDIR)
3230
install: PREPARE_DEST_MAN_DIR=$(DESTDIR)$(CFG_MANDIR)/man1
33-
install: prepare-everything-mkfile-install
31+
install: prepare-everything
3432

3533

3634
# Uninstall code

branches/auto/mk/prepare.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ prepare-base-$(1): PREPARE_SOURCE_MAN_DIR=$$(S)/man
156156
prepare-base-$(1): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin
157157
prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)
158158
prepare-base-$(1): PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1
159-
prepare-base-$(1): prepare-everything-$(1)
160-
161-
prepare-everything-$(1): prepare-host-$(1) prepare-targets-$(1)
159+
prepare-base-$(1): prepare-host-$(1) prepare-targets-$(1)
162160

163161
prepare-host-$(1): prepare-host-tools-$(1)
164162

branches/auto/src/compiletest/compiletest.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ pub mod common;
4343
pub mod errors;
4444

4545
#[start]
46-
fn start(argc: int, argv: **u8) -> int {
47-
green::start(argc, argv, rustuv::event_loop, main)
48-
}
46+
fn start(argc: int, argv: **u8) -> int { green::start(argc, argv, main) }
4947

5048
pub fn main() {
5149
let args = os::args();

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

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -559,14 +559,9 @@ points at a static constant).
559559

560560
# Named lifetimes
561561

562-
Lifetimes can be named and referenced. For example, the special lifetime
563-
`'static`, which does not go out of scope, can be used to create global
564-
variables and communicate between tasks (see the manual for usecases).
565-
566-
## Parameter Lifetimes
567-
568-
Named lifetimes allow for grouping of parameters by lifetime.
569-
For example, consider this function:
562+
Let's look at named lifetimes in more detail. Named lifetimes allow
563+
for grouping of parameters by lifetime. For example, consider this
564+
function:
570565

571566
~~~
572567
# struct Point {x: f64, y: f64}; // as before
@@ -660,25 +655,6 @@ fn select<'r, T>(shape: &Shape, threshold: f64,
660655

661656
This is equivalent to the previous definition.
662657

663-
## Labeled Control Structures
664-
665-
Named lifetime notation can also be used to control the flow of execution:
666-
667-
~~~
668-
'h: for i in range(0,10) {
669-
'g: loop {
670-
if i % 2 == 0 { continue 'h; }
671-
if i == 9 { break 'h; }
672-
break 'g;
673-
}
674-
}
675-
~~~
676-
677-
> ***Note:*** Labelled breaks are not currently supported within `while` loops.
678-
679-
Named labels are hygienic and can be used safely within macros.
680-
See the macros guide section on hygiene for more details.
681-
682658
# Conclusion
683659

684660
So there you have it: a (relatively) brief tour of the lifetime

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -398,38 +398,6 @@ position (in particular, not as an argument to yet another macro invocation),
398398
the expander will then proceed to evaluate `m2!()` (along with any other macro
399399
invocations `m1!(m2!())` produced).
400400

401-
# Hygiene
402-
403-
To prevent clashes, rust implements
404-
[hygienic macros](http://en.wikipedia.org/wiki/Hygienic_macro).
405-
406-
As an example, `loop` and `for-loop` labels (discussed in the lifetimes guide)
407-
will not clash. The following code will print "Hello!" only once:
408-
409-
~~~
410-
#[feature(macro_rules)];
411-
412-
macro_rules! loop_x (
413-
($e: expr) => (
414-
// $e will not interact with this 'x
415-
'x: loop {
416-
println!("Hello!");
417-
$e
418-
}
419-
);
420-
)
421-
422-
fn main() {
423-
'x: loop {
424-
loop_x!(break 'x);
425-
println!("I am never printed.");
426-
}
427-
}
428-
~~~
429-
430-
The two `'x` names did not clash, which would have caused the loop
431-
to print "I am never printed" and to run forever.
432-
433401
# A final note
434402

435403
Macros, as currently implemented, are not for the faint of heart. Even

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

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -223,49 +223,27 @@ Having a default decision made in the compiler is done out of necessity and
223223
convenience. The compiler's decision of runtime to link to is *not* an
224224
endorsement of one over the other. As always, this decision can be overridden.
225225

226-
For example, this program will be linked to "the default runtime". The current
227-
default runtime is to use libnative.
226+
For example, this program will be linked to "the default runtime"
228227

229228
~~~{.rust}
230229
fn main() {}
231230
~~~
232231

233-
### Force booting with libgreen
234-
235-
In this example, the `main` function will be booted with I/O support powered by
236-
libuv. This is done by linking to the `rustuv` crate and specifying the
237-
`rustuv::event_loop` function as the event loop factory.
238-
239-
To create a pool of green tasks which have no I/O support, you may shed the
240-
`rustuv` dependency and use the `green::basic::event_loop` function instead of
241-
`rustuv::event_loop`. All tasks will have no I/O support, but they will still be
242-
able to deschedule/reschedule (use channels, locks, etc).
232+
Whereas this program explicitly opts into using a particular runtime
243233

244234
~~~{.rust}
245235
extern crate green;
246-
extern crate rustuv;
247236
248237
#[start]
249238
fn start(argc: int, argv: **u8) -> int {
250-
green::start(argc, argv, rustuv::event_loop, main)
239+
green::start(argc, argv, main)
251240
}
252241
253242
fn main() {}
254243
~~~
255244

256-
### Force booting with libnative
257-
258-
This program's `main` function will always be booted with libnative, running
259-
inside of an OS thread.
260-
261-
~~~{.rust}
262-
extern crate native;
263-
264-
#[start]
265-
fn start(argc: int, argv: **u8) -> int { native::start(argc, argv, main) }
266-
267-
fn main() {}
268-
~~~
245+
Both libgreen/libnative provide a top-level `start` function which is used to
246+
boot an initial Rust task in that specified runtime.
269247

270248
# Finding the runtime
271249

branches/auto/src/doc/tutorial.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,8 +2103,7 @@ a `&T` pointer. `MutexArc` is an example of a *sharable* type with internal muta
21032103
These are types that do not contain any data whose lifetime is bound to
21042104
a particular stack frame. These are types that do not contain any
21052105
references, or types where the only contained references
2106-
have the `'static` lifetime. (For more on named lifetimes and their uses,
2107-
see the [references and lifetimes guide][lifetimes].)
2106+
have the `'static` lifetime.
21082107
21092108
> ***Note:*** These two traits were referred to as 'kinds' in earlier
21102109
> iterations of the language, and often still are.

branches/auto/src/libcollections/dlist.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,16 +582,16 @@ impl<A> DoubleEndedIterator<A> for MoveItems<A> {
582582
}
583583

584584
impl<A> FromIterator<A> for DList<A> {
585-
fn from_iterator<T: Iterator<A>>(iterator: T) -> DList<A> {
585+
fn from_iterator<T: Iterator<A>>(iterator: &mut T) -> DList<A> {
586586
let mut ret = DList::new();
587587
ret.extend(iterator);
588588
ret
589589
}
590590
}
591591

592592
impl<A> Extendable<A> for DList<A> {
593-
fn extend<T: Iterator<A>>(&mut self, mut iterator: T) {
594-
for elt in iterator { self.push_back(elt); }
593+
fn extend<T: Iterator<A>>(&mut self, iterator: &mut T) {
594+
for elt in *iterator { self.push_back(elt); }
595595
}
596596
}
597597

branches/auto/src/libcollections/hashmap.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ pub type Values<'a, K, V> =
13561356
iter::Map<'static, (&'a K, &'a V), &'a V, Entries<'a, K, V>>;
13571357

13581358
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> for HashMap<K, V, H> {
1359-
fn from_iterator<T: Iterator<(K, V)>>(iter: T) -> HashMap<K, V, H> {
1359+
fn from_iterator<T: Iterator<(K, V)>>(iter: &mut T) -> HashMap<K, V, H> {
13601360
let (lower, _) = iter.size_hint();
13611361
let mut map = HashMap::with_capacity_and_hasher(lower, Default::default());
13621362
map.extend(iter);
@@ -1365,8 +1365,8 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> FromIterator<(K, V)> fo
13651365
}
13661366

13671367
impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S> + Default> Extendable<(K, V)> for HashMap<K, V, H> {
1368-
fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
1369-
for (k, v) in iter {
1368+
fn extend<T: Iterator<(K, V)>>(&mut self, iter: &mut T) {
1369+
for (k, v) in *iter {
13701370
self.insert(k, v);
13711371
}
13721372
}
@@ -1540,7 +1540,7 @@ impl<T: TotalEq + Hash<S> + fmt::Show, S, H: Hasher<S>> fmt::Show for HashSet<T,
15401540
}
15411541

15421542
impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSet<T, H> {
1543-
fn from_iterator<I: Iterator<T>>(iter: I) -> HashSet<T, H> {
1543+
fn from_iterator<I: Iterator<T>>(iter: &mut I) -> HashSet<T, H> {
15441544
let (lower, _) = iter.size_hint();
15451545
let mut set = HashSet::with_capacity_and_hasher(lower, Default::default());
15461546
set.extend(iter);
@@ -1549,8 +1549,8 @@ impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> FromIterator<T> for HashSe
15491549
}
15501550

15511551
impl<T: TotalEq + Hash<S>, S, H: Hasher<S> + Default> Extendable<T> for HashSet<T, H> {
1552-
fn extend<I: Iterator<T>>(&mut self, mut iter: I) {
1553-
for k in iter {
1552+
fn extend<I: Iterator<T>>(&mut self, iter: &mut I) {
1553+
for k in *iter {
15541554
self.insert(k);
15551555
}
15561556
}

branches/auto/src/libcollections/priority_queue.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,22 @@ impl<'a, T> Iterator<&'a T> for Items<'a, T> {
193193
}
194194

195195
impl<T: Ord> FromIterator<T> for PriorityQueue<T> {
196-
fn from_iterator<Iter: Iterator<T>>(iter: Iter) -> PriorityQueue<T> {
196+
fn from_iterator<Iter: Iterator<T>>(iter: &mut Iter) -> PriorityQueue<T> {
197197
let mut q = PriorityQueue::new();
198198
q.extend(iter);
199+
199200
q
200201
}
201202
}
202203

203204
impl<T: Ord> Extendable<T> for PriorityQueue<T> {
204-
fn extend<Iter: Iterator<T>>(&mut self, mut iter: Iter) {
205+
fn extend<Iter: Iterator<T>>(&mut self, iter: &mut Iter) {
205206
let (lower, _) = iter.size_hint();
206207

207208
let len = self.capacity();
208209
self.reserve(len + lower);
209210

210-
for elem in iter {
211+
for elem in *iter {
211212
self.push(elem);
212213
}
213214
}

branches/auto/src/libcollections/ringbuf.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl<A: Eq> Eq for RingBuf<A> {
386386
}
387387

388388
impl<A> FromIterator<A> for RingBuf<A> {
389-
fn from_iterator<T: Iterator<A>>(iterator: T) -> RingBuf<A> {
389+
fn from_iterator<T: Iterator<A>>(iterator: &mut T) -> RingBuf<A> {
390390
let (lower, _) = iterator.size_hint();
391391
let mut deq = RingBuf::with_capacity(lower);
392392
deq.extend(iterator);
@@ -395,8 +395,8 @@ impl<A> FromIterator<A> for RingBuf<A> {
395395
}
396396

397397
impl<A> Extendable<A> for RingBuf<A> {
398-
fn extend<T: Iterator<A>>(&mut self, mut iterator: T) {
399-
for elt in iterator {
398+
fn extend<T: Iterator<A>>(&mut self, iterator: &mut T) {
399+
for elt in *iterator {
400400
self.push_back(elt);
401401
}
402402
}

branches/auto/src/libcollections/treemap.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ fn remove<K: TotalOrd, V>(node: &mut Option<~TreeNode<K, V>>,
971971
}
972972

973973
impl<K: TotalOrd, V> FromIterator<(K, V)> for TreeMap<K, V> {
974-
fn from_iterator<T: Iterator<(K, V)>>(iter: T) -> TreeMap<K, V> {
974+
fn from_iterator<T: Iterator<(K, V)>>(iter: &mut T) -> TreeMap<K, V> {
975975
let mut map = TreeMap::new();
976976
map.extend(iter);
977977
map
@@ -980,15 +980,15 @@ impl<K: TotalOrd, V> FromIterator<(K, V)> for TreeMap<K, V> {
980980

981981
impl<K: TotalOrd, V> Extendable<(K, V)> for TreeMap<K, V> {
982982
#[inline]
983-
fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: T) {
984-
for (k, v) in iter {
983+
fn extend<T: Iterator<(K, V)>>(&mut self, iter: &mut T) {
984+
for (k, v) in *iter {
985985
self.insert(k, v);
986986
}
987987
}
988988
}
989989

990990
impl<T: TotalOrd> FromIterator<T> for TreeSet<T> {
991-
fn from_iterator<Iter: Iterator<T>>(iter: Iter) -> TreeSet<T> {
991+
fn from_iterator<Iter: Iterator<T>>(iter: &mut Iter) -> TreeSet<T> {
992992
let mut set = TreeSet::new();
993993
set.extend(iter);
994994
set
@@ -997,8 +997,8 @@ impl<T: TotalOrd> FromIterator<T> for TreeSet<T> {
997997

998998
impl<T: TotalOrd> Extendable<T> for TreeSet<T> {
999999
#[inline]
1000-
fn extend<Iter: Iterator<T>>(&mut self, mut iter: Iter) {
1001-
for elem in iter {
1000+
fn extend<Iter: Iterator<T>>(&mut self, iter: &mut Iter) {
1001+
for elem in *iter {
10021002
self.insert(elem);
10031003
}
10041004
}

branches/auto/src/libcollections/trie.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,16 @@ impl<T> TrieMap<T> {
261261
}
262262

263263
impl<T> FromIterator<(uint, T)> for TrieMap<T> {
264-
fn from_iterator<Iter: Iterator<(uint, T)>>(iter: Iter) -> TrieMap<T> {
264+
fn from_iterator<Iter: Iterator<(uint, T)>>(iter: &mut Iter) -> TrieMap<T> {
265265
let mut map = TrieMap::new();
266266
map.extend(iter);
267267
map
268268
}
269269
}
270270

271271
impl<T> Extendable<(uint, T)> for TrieMap<T> {
272-
fn extend<Iter: Iterator<(uint, T)>>(&mut self, mut iter: Iter) {
273-
for (k, v) in iter {
272+
fn extend<Iter: Iterator<(uint, T)>>(&mut self, iter: &mut Iter) {
273+
for (k, v) in *iter {
274274
self.insert(k, v);
275275
}
276276
}
@@ -346,16 +346,16 @@ impl TrieSet {
346346
}
347347

348348
impl FromIterator<uint> for TrieSet {
349-
fn from_iterator<Iter: Iterator<uint>>(iter: Iter) -> TrieSet {
349+
fn from_iterator<Iter: Iterator<uint>>(iter: &mut Iter) -> TrieSet {
350350
let mut set = TrieSet::new();
351351
set.extend(iter);
352352
set
353353
}
354354
}
355355

356356
impl Extendable<uint> for TrieSet {
357-
fn extend<Iter: Iterator<uint>>(&mut self, mut iter: Iter) {
358-
for elem in iter {
357+
fn extend<Iter: Iterator<uint>>(&mut self, iter: &mut Iter) {
358+
for elem in *iter {
359359
self.insert(elem);
360360
}
361361
}

branches/auto/src/libglob/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl Iterator<Path> for Paths {
153153
// so we don't need to check the children
154154
return Some(path);
155155
} else {
156-
self.todo.extend(list_dir_sorted(&path).move_iter().map(|x|(x,idx+1)));
156+
self.todo.extend(&mut list_dir_sorted(&path).move_iter().map(|x|(x,idx+1)));
157157
}
158158
}
159159
}

0 commit comments

Comments
 (0)