Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move RBE to stable #636

Merged
merged 4 commits into from Aug 17, 2015
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,7 @@ language: node_js
sudo: false

install:
- curl -L https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly --yes --prefix=$PWD --disable-sudo --disable-ldconfig
- curl -L https://static.rust-lang.org/rustup.sh | sh -s -- --yes --prefix=$PWD --disable-sudo --disable-ldconfig
- export PATH=$PATH:$PWD/bin
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -13,7 +13,7 @@ See [CONTRIBUTING.md][how-to-contribute].

### Debian (Ubuntu) prerequisites

Install Rust [nightly](http://www.rust-lang.org/install.html) and
Install [Rust](http://www.rust-lang.org/install.html) and
run:

```
Expand Down
3 changes: 0 additions & 3 deletions examples/README.md
Expand Up @@ -11,9 +11,6 @@ for this site][home].
Be sure to have Rust [installed][install] and the [docs][std] at hand, and
let's start!

*Note*: Rust by Example uses the latest nightly build. If you're
following along on your computer, make sure to have it installed.

[rust]: http://www.rust-lang.org/
[install]: http://www.rust-lang.org/install.html
[std]: http://doc.rust-lang.org/std/
Expand Down
6 changes: 1 addition & 5 deletions examples/fn/closures/output_parameters/input.md
Expand Up @@ -8,8 +8,6 @@ The valid types for returns are slightly different than before:

* `Fn`: normal
* `FnMut`: normal
* `FnBox`: equivalent to `FnOnce` but specialized for this application
because `FnOnce` currently(version 1.1.0) interacts badly with the type system.

Beyond this, the `move` keyword must be used which signals that all captures
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still may want to comment on it though. People will probably expect the FnOnce analog and so might just think it missing is an omission.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

occur by value. This is required because any captures by reference would be
Expand All @@ -20,11 +18,9 @@ closure.

### See also:

[Boxing][box], [`Fn`][fn], [`FnMut`][fnmut], [`FnBox`][fnbox], and
[Generics][generics]
[Boxing][box], [`Fn`][fn], [`FnMut`][fnmut], and [Generics][generics].

[box]: /std/box.html
[fn]: http://doc.rust-lang.org/std/ops/trait.Fn.html
[fnmut]: http://doc.rust-lang.org/std/ops/trait.FnMut.html
[fnbox]: http://doc.rust-lang.org/std/boxed/trait.FnBox.html
[generics]: /generics.html
14 changes: 0 additions & 14 deletions examples/fn/closures/output_parameters/output_parameters.rs
@@ -1,15 +1,3 @@
#![feature(fnbox)]

use std::boxed::FnBox;

// Return a closure taking no inputs and returning nothing
// which implements `FnBox` (capture by value).
fn create_fnbox() -> Box<FnBox()> {
let text = "FnBox".to_owned();

Box::new(move || println!("This is a: {}", text))
}

fn create_fn() -> Box<Fn()> {
let text = "Fn".to_owned();

Expand All @@ -25,9 +13,7 @@ fn create_fnmut() -> Box<FnMut()> {
fn main() {
let fn_plain = create_fn();
let mut fn_mut = create_fnmut();
let fn_box = create_fnbox();

fn_plain();
fn_mut();
fn_box();
}
4 changes: 1 addition & 3 deletions examples/fn/hof/hof.rs
@@ -1,5 +1,3 @@
#![feature(iter_arith)]

fn main() {
println!("Find the sum of all the squared odd numbers under 1000");
let upper = 1000;
Expand Down Expand Up @@ -27,7 +25,7 @@ fn main() {
(0..).map(|n| n * n) // All natural numbers squared
.take_while(|&n| n < upper) // Below upper limit
.filter(|n| is_odd(*n)) // That are odd
.sum(); // Sum them
.fold(0, |sum, i| sum + i); // Sum them
println!("functional style: {}", sum_of_squared_odd_numbers);
}

Expand Down
40 changes: 0 additions & 40 deletions examples/generics/assoc_items/consts/consts.rs

This file was deleted.

7 changes: 0 additions & 7 deletions examples/generics/assoc_items/consts/input.md

This file was deleted.

55 changes: 0 additions & 55 deletions examples/meta/bench/bench.rs

This file was deleted.

17 changes: 0 additions & 17 deletions examples/meta/bench/input.md

This file was deleted.

16 changes: 8 additions & 8 deletions examples/std_misc/arg/matching/match_args.rs
@@ -1,5 +1,3 @@
#![feature(slice_patterns)]

use std::env;

fn increase(number: i32) {
Expand All @@ -21,21 +19,23 @@ match_args {{increase|decrease}} <integer>
fn main() {
let args: Vec<String> = env::args().collect();

match &args[..] {
match args.len() {
// no arguments passed
[ref name] => {
println!("My name is '{}'. Try passing some arguments!", name);
1 => {
println!("My name is 'match_args'. Try passing some arguments!");
},
// one argument passed
[_, ref string] => {
if string == &"42" {
2 => {
if &42 == &args[1].parse().unwrap() {
println!("This is the answer!");
} else {
println!("This is not the answer.");
}
},
// one command and one argument passed
[_, ref cmd, ref num] => {
3 => {
let cmd = &args[1];
let num = &args[2];
// parse the number
let number: i32 = match num.parse() {
Ok(n) => {
Expand Down
12 changes: 0 additions & 12 deletions examples/std_misc/fs/fs.rs
@@ -1,5 +1,3 @@
#![feature(fs_walk)]

use std::fs;
use std::fs::{File, OpenOptions};
use std::io;
Expand Down Expand Up @@ -80,16 +78,6 @@ fn main() {
},
}

println!("`walk a`");
// Recursively walk over the contents of a directory, returns
// `Directories`, which implements the `Iterator<Path> trait
match fs::walk_dir("a") {
Err(why) => println!("! {:?}", why.kind()),
Ok(paths) => for path in paths {
println!("> {:?}", path.unwrap().path());
},
}

println!("`rm a/c/e.txt`");
// Remove a file, returns `io::Result<()>`
fs::remove_file("a/c/e.txt").unwrap_or_else(|why| {
Expand Down
18 changes: 0 additions & 18 deletions examples/std_misc/path/path.rs
@@ -1,7 +1,4 @@
#![feature(path_ext)]

use std::path::Path;
use std::fs::PathExt;

fn main() {
// Create a `Path` from an `&'static str`
Expand All @@ -10,21 +7,6 @@ fn main() {
// The `display` method returns a `Show`able structure
let display = path.display();

// Check if the path exists
if path.exists() {
println!("{} exists", display);
}

// Check if the path is a file
if path.is_file() {
println!("{} is a file", display);
}

// Check if the path is a directory
if path.is_dir() {
println!("{} is a directory", display);
}

// `join` merges a path with a byte container using the OS specific
// separator, and returns the new path
let new_path = path.join("a").join("b");
Expand Down
25 changes: 0 additions & 25 deletions examples/std_misc/simd/input.md

This file was deleted.

17 changes: 0 additions & 17 deletions examples/std_misc/simd/simd.rs

This file was deleted.