Skip to content

Commit 2e24938

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163509 b: refs/heads/snap-stage3 c: 556d971 h: refs/heads/master i: 163507: 3f75aa2 v: v3
1 parent 1da7b56 commit 2e24938

File tree

172 files changed

+2315
-4367
lines changed

Some content is hidden

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

172 files changed

+2315
-4367
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: bdb1146181e4c320255bec4a93af3d645d522d59
4+
refs/heads/snap-stage3: 556d971f83ea5950444b0a5b5392cd0040f077f6
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,3 @@
1111
[submodule "src/jemalloc"]
1212
path = src/jemalloc
1313
url = https://github.com/rust-lang/jemalloc.git
14-
[submodule "src/rust-installer"]
15-
path = src/rust-installer
16-
url = https://github.com/rust-lang/rust-installer

branches/snap-stage3/mk/dist.mk

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ PKG_FILES := \
5858
rt \
5959
rustllvm \
6060
snapshots.txt \
61-
rust-installer \
6261
test) \
6362
$(PKG_GITMODULES) \
6463
$(filter-out config.stamp, \
@@ -210,40 +209,33 @@ distcheck-osx: dist-osx
210209
# Unix binary installer tarballs
211210
######################################################################
212211

213-
NON_INSTALLED_PREFIXES=COPYRIGHT,LICENSE-APACHE,LICENSE-MIT,README.md,doc
214-
215212
define DEF_INSTALLER
216213

217214
$$(eval $$(call DEF_PREPARE,dir-$(1)))
218215

219216
dist-install-dir-$(1): PREPARE_HOST=$(1)
220217
dist-install-dir-$(1): PREPARE_TARGETS=$(2)
221-
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)-image
218+
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
222219
dist-install-dir-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
223220
dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
224221
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
225222
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
226223
dist-install-dir-$(1): PREPARE_CLEAN=true
227224
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
225+
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
226+
> tmp/dist/manifest-$(1).in
227+
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
228+
# Add remaining non-installed files
228229
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
229230
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
230231
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
231232
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
232233
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
234+
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
233235

234236
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
235237
@$(call E, build: $$@)
236-
$$(Q)$$(S)src/rust-installer/gen-installer.sh \
237-
--product-name=Rust \
238-
--verify-bin=rustc \
239-
--rel-manifest-dir=rustlib \
240-
--success-message=Rust-is-ready-to-roll. \
241-
--image-dir=tmp/dist/$$(PKG_NAME)-$(1)-image \
242-
--work-dir=tmp/dist \
243-
--output-dir=dist \
244-
--non-installed-prefixes=$$(NON_INSTALLED_PREFIXES) \
245-
--package-name=$$(PKG_NAME)-$(1)
246-
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image
238+
$$(Q)tar -czf dist/$$(PKG_NAME)-$(1).tar.gz -C tmp/dist $$(PKG_NAME)-$(1)
247239

248240
endef
249241

branches/snap-stage3/mk/install.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endif
2525
# Remove tmp files because it's a decent amount of disk space
2626
$(Q)rm -R tmp/dist
2727

28-
prepare_install: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
28+
prepare_install: dist-install-dir-$(CFG_BUILD) | tmp/empty_dir
2929

3030
uninstall:
3131
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))
@@ -38,7 +38,7 @@ endif
3838
# Remove tmp files because it's a decent amount of disk space
3939
$(Q)rm -R tmp/dist
4040

41-
prepare_uninstall: dist/$(PKG_NAME)-$(CFG_BUILD).tar.gz | tmp/empty_dir
41+
prepare_uninstall: dist-install-dir-$(CFG_BUILD) | tmp/empty_dir
4242

4343
.PHONY: install prepare_install uninstall prepare_uninstall
4444

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
394394

395395
match re.captures(full_version_line) {
396396
Some(captures) => {
397-
Some(captures.at(2).unwrap_or("").to_string())
397+
Some(captures.at(2).to_string())
398398
}
399399
None => {
400400
println!("Could not extract GDB version from line '{}'",
@@ -428,7 +428,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
428428

429429
match re.captures(full_version_line) {
430430
Some(captures) => {
431-
Some(captures.at(1).unwrap_or("").to_string())
431+
Some(captures.at(1).to_string())
432432
}
433433
None => {
434434
println!("Could not extract LLDB version from line '{}'",

branches/snap-stage3/src/compiletest/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ fn parse_expected(last_nonfollow_error: Option<uint>,
6666
line: &str,
6767
re: &Regex) -> Option<(WhichLine, ExpectedError)> {
6868
re.captures(line).and_then(|caps| {
69-
let adjusts = caps.name("adjusts").unwrap_or("").len();
70-
let kind = caps.name("kind").unwrap_or("").to_ascii_lower();
71-
let msg = caps.name("msg").unwrap_or("").trim().to_string();
72-
let follow = caps.name("follow").unwrap_or("").len() > 0;
69+
let adjusts = caps.name("adjusts").len();
70+
let kind = caps.name("kind").to_ascii_lower();
71+
let msg = caps.name("msg").trim().to_string();
72+
let follow = caps.name("follow").len() > 0;
7373

7474
let (which, line) = if follow {
7575
assert!(adjusts == 0, "use either //~| or //~^, not both.");

branches/snap-stage3/src/doc/guide.md

Lines changed: 28 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ $ curl -s https://static.rust-lang.org/rustup.sh | sudo sh
3030
below.)
3131

3232
If you're on Windows, please download either the [32-bit
33-
installer](https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.exe)
34-
33+
installer](https://static.rust-lang.org/dist/rust-nightly-i686-w64-mingw32.exe)
3534
or the [64-bit
36-
installer](https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.exe)
35+
installer](https://static.rust-lang.org/dist/rust-nightly-x86_64-w64-mingw32.exe)
3736
and run it.
3837

3938
If you decide you don't want Rust anymore, we'll be a bit sad, but that's okay.
@@ -418,19 +417,6 @@ let x: int = 5;
418417
If I asked you to read this out loud to the rest of the class, you'd say "`x`
419418
is a binding with the type `int` and the value `five`."
420419

421-
In future examples, we may annotate the type in a comment. The examples will
422-
look like this:
423-
424-
```{rust}
425-
fn main() {
426-
let x = 5i; // x: int
427-
}
428-
```
429-
430-
Note the similarities between this annotation and the syntax you use with `let`.
431-
Including these kinds of comments is not idiomatic Rust, but we'll occasionally
432-
include them to help you understand what the types that Rust infers are.
433-
434420
By default, bindings are **immutable**. This code will not compile:
435421

436422
```{ignore}
@@ -449,7 +435,7 @@ error: re-assignment of immutable variable `x`
449435
If you want a binding to be mutable, you can use `mut`:
450436

451437
```{rust}
452-
let mut x = 5i; // mut x: int
438+
let mut x = 5i;
453439
x = 10i;
454440
```
455441

@@ -597,15 +583,15 @@ let y = if x == 5i {
597583
10i
598584
} else {
599585
15i
600-
}; // y: int
586+
};
601587
```
602588

603589
Which we can (and probably should) write like this:
604590

605591
```{rust}
606592
let x = 5i;
607593
608-
let y = if x == 5i { 10i } else { 15i }; // y: int
594+
let y = if x == 5i { 10i } else { 15i };
609595
```
610596

611597
This reveals two interesting things about Rust: it is an expression-based
@@ -941,8 +927,8 @@ destructuring. You can assign one tuple into another, if they have the same
941927
arity and contained types.
942928

943929
```rust
944-
let mut x = (1i, 2i); // x: (int, int)
945-
let y = (2i, 3i); // y: (int, int)
930+
let mut x = (1i, 2i);
931+
let y = (2i, 3i);
946932

947933
x = y;
948934
```
@@ -994,7 +980,7 @@ struct Point {
994980
}
995981

996982
fn main() {
997-
let origin = Point { x: 0i, y: 0i }; // origin: Point
983+
let origin = Point { x: 0i, y: 0i };
998984

999985
println!("The origin is at ({}, {})", origin.x, origin.y);
1000986
}
@@ -1114,7 +1100,7 @@ fn main() {
11141100
let x = 5i;
11151101
let y = 10i;
11161102
1117-
let ordering = cmp(x, y); // ordering: Ordering
1103+
let ordering = cmp(x, y);
11181104
11191105
if ordering == Less {
11201106
println!("less");
@@ -1401,7 +1387,7 @@ Instead, it looks like this:
14011387

14021388
```{rust}
14031389
for x in range(0i, 10i) {
1404-
println!("{}", x); // x: int
1390+
println!("{}", x);
14051391
}
14061392
```
14071393

@@ -1436,8 +1422,8 @@ The other kind of looping construct in Rust is the `while` loop. It looks like
14361422
this:
14371423

14381424
```{rust}
1439-
let mut x = 5u; // mut x: uint
1440-
let mut done = false; // mut done: bool
1425+
let mut x = 5u;
1426+
let mut done = false;
14411427
14421428
while !done {
14431429
x += x - 3;
@@ -1533,7 +1519,7 @@ The first kind is a `&str`. This is pronounced a 'string slice.' String literals
15331519
are of the type `&str`:
15341520

15351521
```{rust}
1536-
let string = "Hello there."; // string: &str
1522+
let string = "Hello there.";
15371523
```
15381524

15391525
This string is statically allocated, meaning that it's saved inside our
@@ -1545,7 +1531,7 @@ A `String`, on the other hand, is an in-memory string. This string is
15451531
growable, and is also guaranteed to be UTF-8.
15461532

15471533
```{rust}
1548-
let mut s = "Hello".to_string(); // mut s: String
1534+
let mut s = "Hello".to_string();
15491535
println!("{}", s);
15501536
15511537
s.push_str(", world.");
@@ -1601,19 +1587,16 @@ things. The most basic is the **array**, a fixed-size list of elements of the
16011587
same type. By default, arrays are immutable.
16021588

16031589
```{rust}
1604-
let a = [1i, 2i, 3i]; // a: [int, ..3]
1605-
let mut m = [1i, 2i, 3i]; // mut m: [int, ..3]
1590+
let a = [1i, 2i, 3i];
1591+
let mut m = [1i, 2i, 3i];
16061592
```
16071593

16081594
You can create an array with a given number of elements, all initialized to the
16091595
same value, with `[val, ..N]` syntax. The compiler ensures that arrays are
16101596
always initialized.
16111597

1612-
There's a shorthand for initializing each element of an array to the same
1613-
value. In this example, each element of `a` will be initialized to `0i`:
1614-
16151598
```{rust}
1616-
let a = [0i, ..20]; // a: [int, ..20]
1599+
let a = [0i, ..20]; // Shorthand for array of 20 elements all initialized to 0
16171600
```
16181601

16191602
Arrays have type `[T,..N]`. We'll talk about this `T` notation later, when we
@@ -1624,7 +1607,7 @@ You can get the number of elements in an array `a` with `a.len()`, and use
16241607
number in order:
16251608

16261609
```{rust}
1627-
let a = [1i, 2, 3]; // Only the first item needs a type suffix
1610+
let a = [1i, 2, 3]; // Only the first item needs a type suffix
16281611
16291612
println!("a has {} elements", a.len());
16301613
for e in a.iter() {
@@ -1635,7 +1618,7 @@ for e in a.iter() {
16351618
You can access a particular element of an array with **subscript notation**:
16361619

16371620
```{rust}
1638-
let names = ["Graydon", "Brian", "Niko"]; // names: [&str, 3]
1621+
let names = ["Graydon", "Brian", "Niko"];
16391622
16401623
println!("The second name is: {}", names[1]);
16411624
```
@@ -1653,7 +1636,7 @@ later). Vectors are to arrays what `String` is to `&str`. You can create them
16531636
with the `vec!` macro:
16541637

16551638
```{rust}
1656-
let v = vec![1i, 2, 3]; // v: Vec<int>
1639+
let v = vec![1i, 2, 3];
16571640
```
16581641

16591642
(Notice that unlike the `println!` macro we've used in the past, we use square
@@ -1664,10 +1647,8 @@ You can get the length of, iterate over, and subscript vectors just like
16641647
arrays. In addition, (mutable) vectors can grow automatically:
16651648

16661649
```{rust}
1667-
let mut nums = vec![1i, 2, 3]; // mut nums: Vec<int>
1668-
1650+
let mut nums = vec![1i, 2, 3];
16691651
nums.push(4);
1670-
16711652
println!("The length of nums is now {}", nums.len()); // Prints 4
16721653
```
16731654

@@ -1841,12 +1822,10 @@ use std::io;
18411822
fn main() {
18421823
println!("Type something!");
18431824
1844-
// here, we'll show the types at each step
1845-
1846-
let input = io::stdin() // std::io::stdio::StdinReader
1847-
.read_line() // IoResult<String>
1848-
.ok() // Option<String>
1849-
.expect("Failed to read line"); // String
1825+
let input = io::stdin()
1826+
.read_line()
1827+
.ok()
1828+
.expect("Failed to read line");
18501829
18511830
println!("{}", input);
18521831
}
@@ -1989,7 +1968,7 @@ use std::rand;
19891968
fn main() {
19901969
println!("Guess the number!");
19911970
1992-
let secret_number = (rand::random() % 100i) + 1i; // secret_number: int
1971+
let secret_number = (rand::random() % 100i) + 1i;
19931972
19941973
println!("The secret number is: {}", secret_number);
19951974
@@ -2282,8 +2261,8 @@ In this case, we say `x` is a `uint` explicitly, so Rust is able to properly
22822261
tell `random()` what to generate. In a similar fashion, both of these work:
22832262
22842263
```{rust,ignore}
2285-
let input_num = from_str::<uint>("5"); // input_num: Option<uint>
2286-
let input_num: Option<uint> = from_str("5"); // input_num: Option<uint>
2264+
let input_num = from_str::<uint>("5");
2265+
let input_num: Option<uint> = from_str("5");
22872266
```
22882267
22892268
Anyway, with us now converting our input to a number, our code looks like this:

0 commit comments

Comments
 (0)