Skip to content

Commit 1945daf

Browse files
committed
---
yaml --- r: 109369 b: refs/heads/dist-snap c: 6200e76 h: refs/heads/master i: 109367: dc8b8b5 v: v3
1 parent 520f5bd commit 1945daf

36 files changed

+115
-256
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: e28f081cc257122fed7a2fb9d3358f3ac9829245
9+
refs/heads/dist-snap: 6200e761f0ef58510ad2acc383b29de7e7a79bcd
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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/dist-snap/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: &mut T) -> DList<A> {
585+
fn from_iterator<T: Iterator<A>>(iterator: 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, iterator: &mut T) {
594-
for elt in *iterator { self.push_back(elt); }
593+
fn extend<T: Iterator<A>>(&mut self, mut iterator: T) {
594+
for elt in iterator { self.push_back(elt); }
595595
}
596596
}
597597

branches/dist-snap/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: &mut T) -> HashMap<K, V, H> {
1359+
fn from_iterator<T: Iterator<(K, V)>>(iter: 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, iter: &mut T) {
1369-
for (k, v) in *iter {
1368+
fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: 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: &mut I) -> HashSet<T, H> {
1543+
fn from_iterator<I: Iterator<T>>(iter: 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, iter: &mut I) {
1553-
for k in *iter {
1552+
fn extend<I: Iterator<T>>(&mut self, mut iter: I) {
1553+
for k in iter {
15541554
self.insert(k);
15551555
}
15561556
}

branches/dist-snap/src/libcollections/priority_queue.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,22 +193,21 @@ 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: &mut Iter) -> PriorityQueue<T> {
196+
fn from_iterator<Iter: Iterator<T>>(iter: Iter) -> PriorityQueue<T> {
197197
let mut q = PriorityQueue::new();
198198
q.extend(iter);
199-
200199
q
201200
}
202201
}
203202

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

208207
let len = self.capacity();
209208
self.reserve(len + lower);
210209

211-
for elem in *iter {
210+
for elem in iter {
212211
self.push(elem);
213212
}
214213
}

branches/dist-snap/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: &mut T) -> RingBuf<A> {
389+
fn from_iterator<T: Iterator<A>>(iterator: 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, iterator: &mut T) {
399-
for elt in *iterator {
398+
fn extend<T: Iterator<A>>(&mut self, mut iterator: T) {
399+
for elt in iterator {
400400
self.push_back(elt);
401401
}
402402
}

branches/dist-snap/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: &mut T) -> TreeMap<K, V> {
974+
fn from_iterator<T: Iterator<(K, V)>>(iter: 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, iter: &mut T) {
984-
for (k, v) in *iter {
983+
fn extend<T: Iterator<(K, V)>>(&mut self, mut iter: 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: &mut Iter) -> TreeSet<T> {
991+
fn from_iterator<Iter: Iterator<T>>(iter: 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, iter: &mut Iter) {
1001-
for elem in *iter {
1000+
fn extend<Iter: Iterator<T>>(&mut self, mut iter: Iter) {
1001+
for elem in iter {
10021002
self.insert(elem);
10031003
}
10041004
}

branches/dist-snap/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: &mut Iter) -> TrieMap<T> {
264+
fn from_iterator<Iter: Iterator<(uint, T)>>(iter: 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, iter: &mut Iter) {
273-
for (k, v) in *iter {
272+
fn extend<Iter: Iterator<(uint, T)>>(&mut self, mut iter: 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: &mut Iter) -> TrieSet {
349+
fn from_iterator<Iter: Iterator<uint>>(iter: 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, iter: &mut Iter) {
358-
for elem in *iter {
357+
fn extend<Iter: Iterator<uint>>(&mut self, mut iter: Iter) {
358+
for elem in iter {
359359
self.insert(elem);
360360
}
361361
}

branches/dist-snap/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(&mut list_dir_sorted(&path).move_iter().map(|x|(x,idx+1)));
156+
self.todo.extend(list_dir_sorted(&path).move_iter().map(|x|(x,idx+1)));
157157
}
158158
}
159159
}

branches/dist-snap/src/libnum/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,7 @@ mod bigint_tests {
21852185
nums.push(BigInt::from_slice(Minus, *s));
21862186
}
21872187
nums.push(Zero::zero());
2188-
nums.extend(&mut vs.iter().map(|s| BigInt::from_slice(Plus, *s)));
2188+
nums.extend(vs.iter().map(|s| BigInt::from_slice(Plus, *s)));
21892189
21902190
for (i, ni) in nums.iter().enumerate() {
21912191
for (j0, nj) in nums.slice(i, nums.len()).iter().enumerate() {

branches/dist-snap/src/librustc/back/archive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ fn run_ar(sess: &Session, args: &str, cwd: Option<&Path>,
4141
let ar = get_ar_prog(sess);
4242

4343
let mut args = vec!(args.to_owned());
44-
let mut paths = paths.iter().map(|p| p.as_str().unwrap().to_owned());
45-
args.extend(&mut paths);
44+
let paths = paths.iter().map(|p| p.as_str().unwrap().to_owned());
45+
args.extend(paths);
4646
debug!("{} {}", ar, args.connect(" "));
4747
match cwd {
4848
Some(p) => { debug!("inside {}", p.display()); }
@@ -190,7 +190,7 @@ impl<'a> Archive<'a> {
190190

191191
// Finally, add all the renamed files to this archive
192192
let mut args = vec!(&self.dst);
193-
args.extend(&mut inputs.iter());
193+
args.extend(inputs.iter());
194194
run_ar(self.sess, "r", None, args.as_slice());
195195
Ok(())
196196
}

branches/dist-snap/src/librustc/driver/session.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ pub fn collect_crate_types(session: &Session,
496496
return vec!(CrateTypeExecutable)
497497
}
498498
let mut base = session.opts.crate_types.clone();
499-
let mut iter = attrs.iter().filter_map(|a| {
499+
let iter = attrs.iter().filter_map(|a| {
500500
if a.name().equiv(&("crate_type")) {
501501
match a.value_str() {
502502
Some(ref n) if n.equiv(&("rlib")) => Some(CrateTypeRlib),
@@ -525,7 +525,7 @@ pub fn collect_crate_types(session: &Session,
525525
None
526526
}
527527
});
528-
base.extend(&mut iter);
528+
base.extend(iter);
529529
if base.len() == 0 {
530530
base.push(CrateTypeExecutable);
531531
}

branches/dist-snap/src/librustc/middle/trans/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ pub fn get_wrapper_for_bare_fn(ccx: &CrateContext,
476476
}
477477
None => {}
478478
}
479-
llargs.extend(&mut args.iter().map(|arg| arg.val));
479+
llargs.extend(args.iter().map(|arg| arg.val));
480480

481481
let retval = Call(bcx, fn_ptr, llargs.as_slice(), []);
482482
if type_is_zero_size(ccx, f.sig.output) || fcx.llretptr.get().is_some() {

branches/dist-snap/src/librustc/middle/trans/type_of.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ pub fn type_of_rust_fn(cx: &CrateContext, has_env: bool,
5757
}
5858

5959
// ... then explicit args.
60-
let mut input_tys = inputs.iter().map(|&arg_ty| type_of_explicit_arg(cx, arg_ty));
61-
atys.extend(&mut input_tys);
60+
let input_tys = inputs.iter().map(|&arg_ty| type_of_explicit_arg(cx, arg_ty));
61+
atys.extend(input_tys);
6262

6363
// Use the output as the actual return value if it's immediate.
6464
if use_out_pointer || return_type_is_void(cx, output) {

0 commit comments

Comments
 (0)