Skip to content

Commit

Permalink
Auto merge of #22895 - Manishearth:rollup, r=Manishearth
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Feb 28, 2015
2 parents 6f8d831 + 0775959 commit 8a69110
Show file tree
Hide file tree
Showing 37 changed files with 247 additions and 327 deletions.
1 change: 0 additions & 1 deletion src/compiletest/compiletest.rs
Expand Up @@ -20,7 +20,6 @@
#![feature(std_misc)]
#![feature(test)]
#![feature(unicode)]
#![feature(env)]
#![feature(core)]

#![deny(warnings)]
Expand Down
4 changes: 2 additions & 2 deletions src/doc/intro.md
Expand Up @@ -536,7 +536,7 @@ use std::thread::Thread;
fn main() {
let numbers = vec![1, 2, 3];
let guards: Vec<_> = (0..3).map(|i| {
Thread::scoped(move || {
println!("{}", numbers[i]);
Expand Down Expand Up @@ -565,7 +565,7 @@ while retaining safety. The answer is iterators:
```{rust}
let vec = vec![1, 2, 3];
for x in vec.iter() {
for x in &vec {
println!("{}", x);
}
```
Expand Down
4 changes: 2 additions & 2 deletions src/doc/reference.md
Expand Up @@ -3765,9 +3765,9 @@ An example of creating and calling a closure:
```rust
let captured_var = 10;

let closure_no_args = |&:| println!("captured_var={}", captured_var);
let closure_no_args = || println!("captured_var={}", captured_var);

let closure_args = |&: arg: i32| -> i32 {
let closure_args = |arg: i32| -> i32 {
println!("captured_var={}, arg={}", captured_var, arg);
arg // Note lack of semicolon after 'arg'
};
Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/installing-rust.md
Expand Up @@ -70,10 +70,10 @@ If you've got Rust installed, you can open up a shell, and type this:
$ rustc --version
```

You should see some output that looks something like this:
You should see the version number, commit hash, commit date and build date:

```bash
rustc 1.0.0-nightly (f11f3e7ba 2015-01-04 20:02:14 +0000)
rustc 1.0.0-nightly (f11f3e7ba 2015-01-04) (built 2015-01-06)
```

If you did, Rust has been installed successfully! Congrats!
Expand Down
8 changes: 4 additions & 4 deletions src/doc/trpl/plugins.md
Expand Up @@ -71,8 +71,8 @@ extern crate rustc;
use syntax::codemap::Span;
use syntax::parse::token;
use syntax::ast::{TokenTree, TtToken};
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacExpr};
use syntax::ext::build::AstBuilder; // trait for expr_uint
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
use syntax::ext::build::AstBuilder; // trait for expr_usize
use rustc::plugin::Registry;
fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
Expand Down Expand Up @@ -107,7 +107,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
}
}
MacExpr::new(cx.expr_uint(sp, total))
MacEager::expr(cx.expr_usize(sp, total))
}
#[plugin_registrar]
Expand Down Expand Up @@ -183,7 +183,7 @@ with
[`syntax::print::pprust::*_to_string`](http://doc.rust-lang.org/syntax/print/pprust/index.html#functions).

The example above produced an integer literal using
[`AstBuilder::expr_uint`](../syntax/ext/build/trait.AstBuilder.html#tymethod.expr_uint).
[`AstBuilder::expr_usize`](../syntax/ext/build/trait.AstBuilder.html#tymethod.expr_usize).
As an alternative to the `AstBuilder` trait, `libsyntax` provides a set of
[quasiquote macros](../syntax/ext/quote/index.html). They are undocumented and
very rough around the edges. However, the implementation may be a good
Expand Down
54 changes: 20 additions & 34 deletions src/libcore/iter.rs
Expand Up @@ -2874,10 +2874,10 @@ pub mod order {
use super::Iterator;

/// Compare `a` and `b` for equality using `Eq`
pub fn equals<A, T, S>(mut a: T, mut b: S) -> bool where
pub fn equals<A, L, R>(mut a: L, mut b: R) -> bool where
A: Eq,
T: Iterator<Item=A>,
S: Iterator<Item=A>,
L: Iterator<Item=A>,
R: Iterator<Item=A>,
{
loop {
match (a.next(), b.next()) {
Expand All @@ -2889,10 +2889,10 @@ pub mod order {
}

/// Order `a` and `b` lexicographically using `Ord`
pub fn cmp<A, T, S>(mut a: T, mut b: S) -> cmp::Ordering where
pub fn cmp<A, L, R>(mut a: L, mut b: R) -> cmp::Ordering where
A: Ord,
T: Iterator<Item=A>,
S: Iterator<Item=A>,
L: Iterator<Item=A>,
R: Iterator<Item=A>,
{
loop {
match (a.next(), b.next()) {
Expand All @@ -2908,10 +2908,8 @@ pub mod order {
}

/// Order `a` and `b` lexicographically using `PartialOrd`
pub fn partial_cmp<A, T, S>(mut a: T, mut b: S) -> Option<cmp::Ordering> where
A: PartialOrd,
T: Iterator<Item=A>,
S: Iterator<Item=A>,
pub fn partial_cmp<L: Iterator, R: Iterator>(mut a: L, mut b: R) -> Option<cmp::Ordering> where
L::Item: PartialOrd<R::Item>
{
loop {
match (a.next(), b.next()) {
Expand All @@ -2927,10 +2925,8 @@ pub mod order {
}

/// Compare `a` and `b` for equality (Using partial equality, `PartialEq`)
pub fn eq<A, B, L, R>(mut a: L, mut b: R) -> bool where
A: PartialEq<B>,
L: Iterator<Item=A>,
R: Iterator<Item=B>,
pub fn eq<L: Iterator, R: Iterator>(mut a: L, mut b: R) -> bool where
L::Item: PartialEq<R::Item>,
{
loop {
match (a.next(), b.next()) {
Expand All @@ -2942,10 +2938,8 @@ pub mod order {
}

/// Compare `a` and `b` for nonequality (Using partial equality, `PartialEq`)
pub fn ne<A, B, L, R>(mut a: L, mut b: R) -> bool where
A: PartialEq<B>,
L: Iterator<Item=A>,
R: Iterator<Item=B>,
pub fn ne<L: Iterator, R: Iterator>(mut a: L, mut b: R) -> bool where
L::Item: PartialEq<R::Item>,
{
loop {
match (a.next(), b.next()) {
Expand All @@ -2957,10 +2951,8 @@ pub mod order {
}

/// Return `a` < `b` lexicographically (Using partial order, `PartialOrd`)
pub fn lt<A, T, S>(mut a: T, mut b: S) -> bool where
A: PartialOrd,
T: Iterator<Item=A>,
S: Iterator<Item=A>,
pub fn lt<R: Iterator, L: Iterator>(mut a: L, mut b: R) -> bool where
L::Item: PartialOrd<R::Item>,
{
loop {
match (a.next(), b.next()) {
Expand All @@ -2973,10 +2965,8 @@ pub mod order {
}

/// Return `a` <= `b` lexicographically (Using partial order, `PartialOrd`)
pub fn le<A, T, S>(mut a: T, mut b: S) -> bool where
A: PartialOrd,
T: Iterator<Item=A>,
S: Iterator<Item=A>,
pub fn le<L: Iterator, R: Iterator>(mut a: L, mut b: R) -> bool where
L::Item: PartialOrd<R::Item>,
{
loop {
match (a.next(), b.next()) {
Expand All @@ -2989,10 +2979,8 @@ pub mod order {
}

/// Return `a` > `b` lexicographically (Using partial order, `PartialOrd`)
pub fn gt<A, T, S>(mut a: T, mut b: S) -> bool where
A: PartialOrd,
T: Iterator<Item=A>,
S: Iterator<Item=A>,
pub fn gt<L: Iterator, R: Iterator>(mut a: L, mut b: R) -> bool where
L::Item: PartialOrd<R::Item>,
{
loop {
match (a.next(), b.next()) {
Expand All @@ -3005,10 +2993,8 @@ pub mod order {
}

/// Return `a` >= `b` lexicographically (Using partial order, `PartialOrd`)
pub fn ge<A, T, S>(mut a: T, mut b: S) -> bool where
A: PartialOrd,
T: Iterator<Item=A>,
S: Iterator<Item=A>,
pub fn ge<L: Iterator, R: Iterator>(mut a: L, mut b: R) -> bool where
L::Item: PartialOrd<R::Item>,
{
loop {
match (a.next(), b.next()) {
Expand Down
1 change: 0 additions & 1 deletion src/liblog/lib.rs
Expand Up @@ -174,7 +174,6 @@
#![feature(core)]
#![feature(old_io)]
#![feature(std_misc)]
#![feature(env)]

use std::boxed;
use std::cell::RefCell;
Expand Down
1 change: 0 additions & 1 deletion src/librustc/lib.rs
Expand Up @@ -31,7 +31,6 @@
#![feature(int_uint)]
#![feature(old_io)]
#![feature(libc)]
#![feature(env)]
#![feature(old_path)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/const_eval.rs
Expand Up @@ -257,7 +257,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &ty::ctxt<'tcx>,
}
}
(Ok(const_int(a)), Ok(const_int(b))) => {
let is_a_min_value = |&:| {
let is_a_min_value = || {
let int_ty = match ty::expr_ty_opt(tcx, e).map(|ty| &ty.sty) {
Some(&ty::ty_int(int_ty)) => int_ty,
_ => return false
Expand Down
1 change: 0 additions & 1 deletion src/librustc_back/lib.rs
Expand Up @@ -40,7 +40,6 @@
#![feature(old_path)]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(env)]
#![feature(path)]

extern crate syntax;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_driver/lib.rs
Expand Up @@ -26,7 +26,6 @@
#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![feature(env)]
#![feature(int_uint)]
#![feature(old_io)]
#![feature(libc)]
Expand All @@ -38,6 +37,7 @@
#![feature(unsafe_destructor)]
#![feature(staged_api)]
#![feature(unicode)]
#![feature(exit_status)]

extern crate arena;
extern crate flate;
Expand Down
1 change: 0 additions & 1 deletion src/librustc_trans/lib.rs
Expand Up @@ -30,7 +30,6 @@
#![feature(core)]
#![feature(int_uint)]
#![feature(old_io)]
#![feature(env)]
#![feature(libc)]
#![feature(old_path)]
#![feature(quote)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/dropck.rs
Expand Up @@ -45,7 +45,7 @@ fn iterate_over_potentially_unsafe_regions_in_type<'a, 'tcx>(
scope: region::CodeExtent,
depth: uint)
{
let origin = |&:| infer::SubregionOrigin::SafeDestructor(span);
let origin = || infer::SubregionOrigin::SafeDestructor(span);
let mut walker = ty_root.walk();
let opt_phantom_data_def_id = rcx.tcx().lang_items.phantom_data();

Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/lib.rs
Expand Up @@ -22,7 +22,7 @@
#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![feature(env)]
#![feature(exit_status)]
#![feature(int_uint)]
#![feature(old_io)]
#![feature(libc)]
Expand Down

0 comments on commit 8a69110

Please sign in to comment.