Skip to content

Commit 945b47a

Browse files
committed
---
yaml --- r: 212807 b: refs/heads/tmp c: 91effb3 h: refs/heads/master i: 212805: 1aa1f01 212803: 492ede0 212799: 8ec98cf v: v3
1 parent 3c02f26 commit 945b47a

File tree

170 files changed

+659
-898
lines changed

Some content is hidden

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

170 files changed

+659
-898
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 4efc4ec178f6ddf3c8cd268b011f3a04056f9d16
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: b5b3a99f84f2b4dbf9495dccd7112c74f4357acc
35+
refs/heads/tmp: 91effb374c98927823b3032f7433e7b73a229f95
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: bea1c4a78e5233ea6f85a2028a26e08c26635fca
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/compiletest/runtest.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
285285
format!("--target={}", config.target),
286286
"-L".to_string(),
287287
aux_dir.to_str().unwrap().to_string());
288-
args.extend(split_maybe_args(&config.target_rustcflags));
289-
args.extend(split_maybe_args(&props.compile_flags));
288+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
289+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
290290
return ProcArgs {
291291
prog: config.rustc_path.to_str().unwrap().to_string(),
292292
args: args,
@@ -333,8 +333,8 @@ actual:\n\
333333
config.build_base.to_str().unwrap().to_string(),
334334
"-L".to_string(),
335335
aux_dir.to_str().unwrap().to_string());
336-
args.extend(split_maybe_args(&config.target_rustcflags));
337-
args.extend(split_maybe_args(&props.compile_flags));
336+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
337+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
338338
// FIXME (#9639): This needs to handle non-utf8 paths
339339
return ProcArgs {
340340
prog: config.rustc_path.to_str().unwrap().to_string(),
@@ -380,7 +380,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
380380
script_str.push_str(&format!("set solib-search-path \
381381
./{}/stage2/lib/rustlib/{}/lib/\n",
382382
config.host, config.target));
383-
for line in &breakpoint_lines {
383+
for line in breakpoint_lines.iter() {
384384
script_str.push_str(&format!("break {:?}:{}\n",
385385
testfile.file_name().unwrap()
386386
.to_string_lossy(),
@@ -1171,7 +1171,7 @@ fn document(config: &Config, props: &TestProps,
11711171
out_dir.to_str().unwrap().to_string(),
11721172
testfile.to_str().unwrap().to_string()];
11731173
args.extend(extra_args.iter().cloned());
1174-
args.extend(split_maybe_args(&props.compile_flags));
1174+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
11751175
let args = ProcArgs {
11761176
prog: config.rustdoc_path.to_str().unwrap().to_string(),
11771177
args: args,
@@ -1236,7 +1236,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
12361236
vec!("--crate-type=dylib".to_string())
12371237
}
12381238
};
1239-
crate_type.extend(extra_link_args.clone());
1239+
crate_type.extend(extra_link_args.clone().into_iter());
12401240
let aux_args =
12411241
make_compile_args(config,
12421242
&aux_props,
@@ -1334,11 +1334,11 @@ fn make_compile_args<F>(config: &Config,
13341334
};
13351335
args.push(path.to_str().unwrap().to_string());
13361336
if props.force_host {
1337-
args.extend(split_maybe_args(&config.host_rustcflags));
1337+
args.extend(split_maybe_args(&config.host_rustcflags).into_iter());
13381338
} else {
1339-
args.extend(split_maybe_args(&config.target_rustcflags));
1339+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
13401340
}
1341-
args.extend(split_maybe_args(&props.compile_flags));
1341+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
13421342
return ProcArgs {
13431343
prog: config.rustc_path.to_str().unwrap().to_string(),
13441344
args: args,
@@ -1373,7 +1373,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path)
13731373
args.push(exe_file.to_str().unwrap().to_string());
13741374

13751375
// Add the arguments in the run_flags directive
1376-
args.extend(split_maybe_args(&props.run_flags));
1376+
args.extend(split_maybe_args(&props.run_flags).into_iter());
13771377

13781378
let prog = args.remove(0);
13791379
return ProcArgs {
@@ -1683,7 +1683,7 @@ fn compile_test_and_save_ir(config: &Config, props: &TestProps,
16831683
aux_dir.to_str().unwrap().to_string());
16841684
let llvm_args = vec!("--emit=llvm-ir".to_string(),
16851685
"--crate-type=lib".to_string());
1686-
link_args.extend(llvm_args);
1686+
link_args.extend(llvm_args.into_iter());
16871687
let args = make_compile_args(config,
16881688
props,
16891689
link_args,

branches/tmp/src/doc/complement-lang-faq.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ You may also be interested in browsing [trending Rust repositories][github-rust]
3030

3131
## Is anyone using Rust in production?
3232

33-
Yes. For example (incomplete):
33+
Currently, Rust is still pre-1.0, and so we don't recommend that you use Rust
34+
in production unless you know exactly what you're getting into.
35+
36+
That said, there are two production deployments of Rust that we're aware of:
3437

3538
* [OpenDNS](http://labs.opendns.com/2013/10/04/zeromq-helping-us-block-malicious-domains/)
3639
* [Skylight](http://skylight.io)
37-
* [wit.ai](https://github.com/wit-ai/witd)
38-
* [Codius](https://codius.org/blog/codius-rust/)
39-
* [MaidSafe](http://maidsafe.net/)
40+
41+
Let the fact that this is an easily countable number be a warning.
4042

4143
## Does it run on Windows?
4244

branches/tmp/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ methods in such an implementation can only be used as direct calls on the
15501550
values of the type that the implementation targets. In such an implementation,
15511551
the trait type and `for` after `impl` are omitted. Such implementations are
15521552
limited to nominal types (enums, structs), and the implementation must appear
1553-
in the same crate as the `self` type:
1553+
in the same module or a sub-module as the `self` type:
15541554

15551555
```
15561556
struct Point {x: i32, y: i32}

branches/tmp/src/doc/trpl/closures.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -324,34 +324,37 @@ first, it may seem strange, but we’ll figure it out. Here’s how you’d prob
324324
try to return a closure from a function:
325325

326326
```rust,ignore
327-
fn factory() -> (Fn(i32) -> i32) {
328-
let num = 5;
327+
fn factory() -> (Fn(i32) -> Vec<i32>) {
328+
let vec = vec![1, 2, 3];
329329
330-
|x| x + num
330+
|n| vec.push(n)
331331
}
332332
333333
let f = factory();
334334
335-
let answer = f(1);
336-
assert_eq!(6, answer);
335+
let answer = f(4);
336+
assert_eq!(vec![1, 2, 3, 4], answer);
337337
```
338338

339339
This gives us these long, related errors:
340340

341341
```text
342342
error: the trait `core::marker::Sized` is not implemented for the type
343-
`core::ops::Fn(i32) -> i32` [E0277]
344-
fn factory() -> (Fn(i32) -> i32) {
345-
^~~~~~~~~~~~~~~~
346-
note: `core::ops::Fn(i32) -> i32` does not have a constant size known at compile-time
347-
fn factory() -> (Fn(i32) -> i32) {
348-
^~~~~~~~~~~~~~~~
349-
error: the trait `core::marker::Sized` is not implemented for the type `core::ops::Fn(i32) -> i32` [E0277]
350-
let f = factory();
351-
^
352-
note: `core::ops::Fn(i32) -> i32` does not have a constant size known at compile-time
353-
let f = factory();
354-
^
343+
`core::ops::Fn(i32) -> collections::vec::Vec<i32>` [E0277]
344+
f = factory();
345+
^
346+
note: `core::ops::Fn(i32) -> collections::vec::Vec<i32>` does not have a
347+
constant size known at compile-time
348+
f = factory();
349+
^
350+
error: the trait `core::marker::Sized` is not implemented for the type
351+
`core::ops::Fn(i32) -> collections::vec::Vec<i32>` [E0277]
352+
factory() -> (Fn(i32) -> Vec<i32>) {
353+
^~~~~~~~~~~~~~~~~~~~~
354+
note: `core::ops::Fn(i32) -> collections::vec::Vec<i32>` does not have a constant size known at compile-time
355+
factory() -> (Fn(i32) -> Vec<i32>) {
356+
^~~~~~~~~~~~~~~~~~~~~
357+
355358
```
356359

357360
In order to return something from a function, Rust needs to know what
@@ -361,16 +364,16 @@ way to give something a size is to take a reference to it, as references
361364
have a known size. So we’d write this:
362365

363366
```rust,ignore
364-
fn factory() -> &(Fn(i32) -> i32) {
365-
let num = 5;
367+
fn factory() -> &(Fn(i32) -> Vec<i32>) {
368+
let vec = vec![1, 2, 3];
366369
367-
|x| x + num
370+
|n| vec.push(n)
368371
}
369372
370373
let f = factory();
371374
372-
let answer = f(1);
373-
assert_eq!(6, answer);
375+
let answer = f(4);
376+
assert_eq!(vec![1, 2, 3, 4], answer);
374377
```
375378

376379
But we get another error:
@@ -445,8 +448,7 @@ assert_eq!(6, answer);
445448
We use a trait object, by `Box`ing up the `Fn`. There’s just one last problem:
446449

447450
```text
448-
error: closure may outlive the current function, but it borrows `num`,
449-
which is owned by the current function [E0373]
451+
error: `num` does not live long enough
450452
Box::new(|x| x + num)
451453
^~~~~~~~~~~
452454
```

branches/tmp/src/error-index-generator/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ r##"<!DOCTYPE html>
7373

7474
try!(write!(&mut output_file, "<h1>Rust Compiler Error Index</h1>\n"));
7575

76-
for (err_code, info) in err_map {
76+
for (err_code, info) in err_map.iter() {
7777
// Enclose each error in a div so they can be shown/hidden en masse.
7878
let desc_desc = match info.description {
7979
Some(_) => "error-described",

branches/tmp/src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<'longer_than_self> Drop for Arena<'longer_than_self> {
127127
fn drop(&mut self) {
128128
unsafe {
129129
destroy_chunk(&*self.head.borrow());
130-
for chunk in self.chunks.borrow().iter() {
130+
for chunk in &*self.chunks.borrow() {
131131
if !chunk.is_copy.get() {
132132
destroy_chunk(chunk);
133133
}

branches/tmp/src/libcollections/binary_heap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
//!
8686
//! // For each node we can reach, see if we can find a way with
8787
//! // a lower cost going through this node
88-
//! for edge in &adj_list[position] {
88+
//! for edge in adj_list[position].iter() {
8989
//! let next = State { cost: cost + edge.cost, position: edge.node };
9090
//!
9191
//! // If so, add it to the frontier and continue
@@ -450,7 +450,7 @@ impl<T: Ord> BinaryHeap<T> {
450450
/// let vec = heap.into_vec();
451451
///
452452
/// // Will print in some order
453-
/// for x in vec {
453+
/// for x in vec.iter() {
454454
/// println!("{}", x);
455455
/// }
456456
/// ```

branches/tmp/src/libcollections/bit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ impl BitVec {
266266
/// # #![feature(collections)]
267267
/// use std::collections::BitVec;
268268
///
269-
/// let bv = BitVec::from_elem(10, false);
269+
/// let mut bv = BitVec::from_elem(10, false);
270270
/// assert_eq!(bv.len(), 10);
271-
/// for x in &bv {
271+
/// for x in bv.iter() {
272272
/// assert_eq!(x, false);
273273
/// }
274274
/// ```
@@ -1245,7 +1245,7 @@ impl<'a> IntoIterator for &'a BitVec {
12451245
/// s.union_with(&other);
12461246
///
12471247
/// // Print 0, 1, 3 in some order
1248-
/// for x in &s {
1248+
/// for x in s.iter() {
12491249
/// println!("{}", x);
12501250
/// }
12511251
///
@@ -1370,7 +1370,7 @@ impl BitSet {
13701370
/// let s = BitSet::from_bit_vec(bv);
13711371
///
13721372
/// // Print 1, 2 in arbitrary order
1373-
/// for x in &s {
1373+
/// for x in s.iter() {
13741374
/// println!("{}", x);
13751375
/// }
13761376
/// ```

branches/tmp/src/libcollections/borrow.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use core::ops::Deref;
2121
use core::option::Option;
2222

2323
use fmt;
24-
use alloc::{boxed, rc, arc};
24+
use alloc::{rc, arc};
2525

2626
use self::Cow::*;
2727

@@ -116,14 +116,6 @@ impl<'a, T: ?Sized> BorrowMut<T> for &'a mut T {
116116
fn borrow_mut(&mut self) -> &mut T { &mut **self }
117117
}
118118

119-
impl<T: ?Sized> Borrow<T> for boxed::Box<T> {
120-
fn borrow(&self) -> &T { &**self }
121-
}
122-
123-
impl<T: ?Sized> BorrowMut<T> for boxed::Box<T> {
124-
fn borrow_mut(&mut self) -> &mut T { &mut **self }
125-
}
126-
127119
impl<T: ?Sized> Borrow<T> for rc::Rc<T> {
128120
fn borrow(&self) -> &T { &**self }
129121
}

branches/tmp/src/libcollections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ impl<K: Ord, V> Default for BTreeMap<K, V> {
907907
impl<K: PartialEq, V: PartialEq> PartialEq for BTreeMap<K, V> {
908908
fn eq(&self, other: &BTreeMap<K, V>) -> bool {
909909
self.len() == other.len() &&
910-
self.iter().zip(other).all(|(a, b)| a == b)
910+
self.iter().zip(other.iter()).all(|(a, b)| a == b)
911911
}
912912
}
913913

@@ -1544,7 +1544,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
15441544
/// for (_, balance) in map.range_mut(Included(&"B"), Excluded(&"Cheryl")) {
15451545
/// *balance += 100;
15461546
/// }
1547-
/// for (name, balance) in &map {
1547+
/// for (name, balance) in map.iter() {
15481548
/// println!("{} => {}", name, balance);
15491549
/// }
15501550
/// ```

branches/tmp/src/libcollections/linked_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl<T> LinkedList<T> {
265265
///
266266
/// a.append(&mut b);
267267
///
268-
/// for e in &a {
268+
/// for e in a.iter() {
269269
/// println!("{}", e); // prints 1, then 2, then 3, then 4
270270
/// }
271271
/// println!("{}", b.len()); // prints 0
@@ -1189,7 +1189,7 @@ mod tests {
11891189
check_links(&m);
11901190

11911191
let mut i = 0;
1192-
for (a, &b) in m.into_iter().zip(&v) {
1192+
for (a, &b) in m.into_iter().zip(v.iter()) {
11931193
i += 1;
11941194
assert_eq!(a, b);
11951195
}

branches/tmp/src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ impl<T> [T] {
971971
reason = "uncertain about this API approach")]
972972
#[inline]
973973
pub fn move_from(&mut self, mut src: Vec<T>, start: usize, end: usize) -> usize {
974-
for (a, b) in self.iter_mut().zip(&mut src[start .. end]) {
974+
for (a, b) in self.iter_mut().zip(src[start .. end].iter_mut()) {
975975
mem::swap(a, b);
976976
}
977977
cmp::min(self.len(), end-start)

0 commit comments

Comments
 (0)