Skip to content

Commit 7e97eea

Browse files
committed
---
yaml --- r: 187563 b: refs/heads/tmp c: eceab29 h: refs/heads/master i: 187561: 91636ca 187559: f302449 v: v3
1 parent a2b1035 commit 7e97eea

File tree

296 files changed

+7313
-3946
lines changed

Some content is hidden

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

296 files changed

+7313
-3946
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: eb06c0ecd26081ee8795447184f47d453e3b3fca
37+
refs/heads/tmp: eceab2963d731544e9a13d25a224b6a6364c5eee
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ links to the major sections:
1414
If you have questions, please make a post on [internals.rust-lang.org][internals] or
1515
hop on [#rust-internals][pound-rust-internals].
1616

17-
As a reminder, all contributors are expected to follow our [Code of Conduct][coc].
17+
As a reminder, all contributors are expected to follow our [Code of Conduct](coc).
1818

1919
[pound-rust-internals]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
2020
[internals]: http://internals.rust-lang.org

branches/tmp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ To contribute to Rust, please see [CONTRIBUTING.md](CONTRIBUTING.md).
111111
Rust has an [IRC] culture and most real-time collaboration happens in a
112112
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
113113
most popular channel is [#rust], a venue for general discussion about
114-
Rust, and a good place to ask for help,
114+
Rust, and a good place to ask for help.
115115

116116
[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
117117
[#rust]: irc://irc.mozilla.org/rust

branches/tmp/RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Version 1.0.0-alpha.2 (February 2015)
5151
* Abstract [OS-specific string types][osstr], `std::ff::{OsString,
5252
OsStr}`, provide strings in platform-specific encodings for easier
5353
interop with system APIs. [RFC][osstr-rfc].
54-
* The `boxed::into_raw` and `Box::from_raw` functions [convert
54+
* The `boxed::into_raw` and `Box::frow_raw` functions [convert
5555
between `Box<T>` and `*mut T`][boxraw], a common pattern for
5656
creating raw pointers.
5757

branches/tmp/configure

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,8 @@ case $CFG_OSTYPE in
374374
CFG_OSTYPE=unknown-dragonfly
375375
;;
376376

377-
Bitrig)
378-
CFG_OSTYPE=unknown-bitrig
379-
;;
380-
381377
OpenBSD)
382-
CFG_OSTYPE=unknown-openbsd
378+
CFG_OSTYPE=unknown-openbsd
383379
;;
384380

385381
Darwin)
@@ -751,13 +747,6 @@ then
751747
CFG_ENABLE_CLANG=1
752748
fi
753749

754-
# Force bitrig to build with clang; gcc doesn't like us there
755-
if [ $CFG_OSTYPE = unknown-bitrig ]
756-
then
757-
step_msg "on Bitrig, forcing use of clang"
758-
CFG_ENABLE_CLANG=1
759-
fi
760-
761750
if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
762751
then
763752
err "either clang or gcc is required"

branches/tmp/mk/cfg/x86_64-unknown-bitrig.mk

Lines changed: 0 additions & 26 deletions
This file was deleted.

branches/tmp/mk/platform.mk

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,14 @@ FIND_COMPILER = $(word 1,$(1:ccache=))
144144
define CFG_MAKE_TOOLCHAIN
145145
# Prepend the tools with their prefix if cross compiling
146146
ifneq ($(CFG_BUILD),$(1))
147-
CC_$(1)=$(CROSS_PREFIX_$(1))$(CC_$(1))
148-
CXX_$(1)=$(CROSS_PREFIX_$(1))$(CXX_$(1))
149-
CPP_$(1)=$(CROSS_PREFIX_$(1))$(CPP_$(1))
150-
AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1))
151-
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(CC_$(1))) \
152-
-C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1))
153-
154-
RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1))
147+
CC_$(1)=$(CROSS_PREFIX_$(1))$(CC_$(1))
148+
CXX_$(1)=$(CROSS_PREFIX_$(1))$(CXX_$(1))
149+
CPP_$(1)=$(CROSS_PREFIX_$(1))$(CPP_$(1))
150+
AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1))
151+
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(CC_$(1))) \
152+
-C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1))
153+
154+
RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1))
155155
endif
156156

157157
CFG_COMPILE_C_$(1) = $$(CC_$(1)) \
@@ -179,19 +179,11 @@ define CFG_MAKE_TOOLCHAIN
179179

180180
ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel powerpc),)
181181

182-
# On Bitrig, we need the relocation model to be PIC for everthing
183-
ifeq (,$(filter $(OSTYPE_$(1)),bitrig))
184-
LLVM_MC_RELOCATION_MODEL="pic"
185-
else
186-
LLVM_MC_RELOCATION_MODEL="default"
187-
endif
188-
189182
# We're using llvm-mc as our assembler because it supports
190183
# .cfi pseudo-ops on mac
191184
CFG_ASSEMBLE_$(1)=$$(CPP_$(1)) -E $$(CFG_DEPEND_FLAGS) $$(2) | \
192185
$$(LLVM_MC_$$(CFG_BUILD)) \
193186
-assemble \
194-
-relocation-model=$$(LLVM_MC_RELOCATION_MODEL) \
195187
-filetype=obj \
196188
-triple=$(1) \
197189
-o=$$(1)
@@ -200,7 +192,7 @@ define CFG_MAKE_TOOLCHAIN
200192
# For the ARM, AARCH64, MIPS and POWER crosses, use the toolchain assembler
201193
# FIXME: We should be able to use the LLVM assembler
202194
CFG_ASSEMBLE_$(1)=$$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
203-
$$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1)
195+
$$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1)
204196

205197
endif
206198

branches/tmp/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
268268
logfile: config.logfile.clone(),
269269
run_tests: true,
270270
run_benchmarks: true,
271-
nocapture: env::var("RUST_TEST_NOCAPTURE").is_ok(),
271+
nocapture: false,
272272
color: test::AutoColor,
273273
}
274274
}

branches/tmp/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
5858
fn parse_expected(last_nonfollow_error: Option<uint>,
5959
line_num: uint,
6060
line: &str) -> Option<(WhichLine, ExpectedError)> {
61-
let start = match line.find("//~") { Some(i) => i, None => return None };
61+
let start = match line.find_str("//~") { Some(i) => i, None => return None };
6262
let (follow, adjusts) = if line.char_at(start + 3) == '|' {
6363
(true, 0)
6464
} else {

branches/tmp/src/compiletest/header.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::env;
12-
1311
use common::Config;
1412
use common;
1513
use util;
@@ -127,16 +125,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
127125
true
128126
});
129127

130-
for key in vec!["RUST_TEST_NOCAPTURE", "RUST_TEST_TASKS"] {
131-
match env::var(key) {
132-
Ok(val) =>
133-
if exec_env.iter().find(|&&(ref x, _)| *x == key.to_string()).is_none() {
134-
exec_env.push((key.to_string(), val))
135-
},
136-
Err(..) => {}
137-
}
138-
}
139-
140128
TestProps {
141129
error_patterns: error_patterns,
142130
compile_flags: compile_flags,
@@ -342,7 +330,7 @@ fn parse_name_directive(line: &str, directive: &str) -> bool {
342330
pub fn parse_name_value_directive(line: &str, directive: &str)
343331
-> Option<String> {
344332
let keycolon = format!("{}:", directive);
345-
match line.find(&keycolon) {
333+
match line.find_str(&keycolon) {
346334
Some(colon) => {
347335
let value = line[(colon + keycolon.len()) .. line.len()].to_string();
348336
debug!("{}: {}", directive, value);

branches/tmp/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
847847
check_lines.iter().map(|s| {
848848
s
849849
.trim()
850-
.split("[...]")
850+
.split_str("[...]")
851851
.map(|x| x.to_string())
852852
.collect()
853853
}).collect();
@@ -866,7 +866,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
866866
None
867867
}
868868
} else {
869-
rest.find(frag)
869+
rest.find_str(frag)
870870
};
871871
match found {
872872
None => {

branches/tmp/src/compiletest/util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ static OS_TABLE: &'static [(&'static str, &'static str)] = &[
2323
("linux", "linux"),
2424
("freebsd", "freebsd"),
2525
("dragonfly", "dragonfly"),
26-
("bitrig", "bitrig"),
2726
("openbsd", "openbsd"),
2827
];
2928

branches/tmp/src/doc/intro.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -426,33 +426,39 @@ use std::thread::Thread;
426426
fn main() {
427427
let mut numbers = vec![1, 2, 3];
428428
429-
let guards: Vec<_> = (0..3).map(|i| {
430-
Thread::scoped(move || {
429+
for i in 0..3 {
430+
Thread::spawn(move || {
431431
for j in 0..3 { numbers[j] += 1 }
432432
});
433-
}).collect();
433+
}
434434
}
435435
```
436436
437437
It gives us this error:
438438
439439
```text
440-
7:29: 9:10 error: cannot move out of captured outer variable in an `FnMut` closure
441-
7 Thread::scoped(move || {
442-
8 for j in 0..3 { numbers[j] += 1 }
443-
9 });
440+
6:71 error: capture of moved value: `numbers`
441+
for j in 0..3 { numbers[j] += 1 }
442+
^~~~~~~
443+
7:50 note: `numbers` moved into closure environment here
444+
spawn(move || {
445+
for j in 0..3 { numbers[j] += 1 }
446+
});
447+
6:79 error: cannot assign to immutable dereference (dereference is implicit, due to indexing)
448+
for j in 0..3 { numbers[j] += 1 }
449+
^~~~~~~~~~~~~~~
444450
```
445451
446-
It mentions that "captured outer variable in an `FnMut` closure".
447-
Because we declared the closure as a moving closure, and it referred
448-
to `numbers`, the closure will try to take ownership of the
449-
vector. But the closure itself is created in a loop, and hence we will
450-
actually create three closures, one for every iteration of the
451-
loop. This means that all three of those closures would try to own
452-
`numbers`, which is impossible -- `numbers` must have just one
453-
owner. Rust detects this and gives us the error: we claim that
454-
`numbers` has ownership, but our code tries to make three owners. This
455-
may cause a safety problem, so Rust disallows it.
452+
It mentions that "numbers moved into closure environment". Because we
453+
declared the closure as a moving closure, and it referred to
454+
`numbers`, the closure will try to take ownership of the vector. But
455+
the closure itself is created in a loop, and hence we will actually
456+
create three closures, one for every iteration of the loop. This means
457+
that all three of those closures would try to own `numbers`, which is
458+
impossible -- `numbers` must have just one owner. Rust detects this
459+
and gives us the error: we claim that `numbers` has ownership, but our
460+
code tries to make three owners. This may cause a safety problem, so
461+
Rust disallows it.
456462
457463
What to do here? Rust has two types that helps us: `Arc<T>` and `Mutex<T>`.
458464
*Arc* stands for "atomically reference counted". In other words, an Arc will
@@ -474,14 +480,14 @@ use std::sync::{Arc,Mutex};
474480
fn main() {
475481
let numbers = Arc::new(Mutex::new(vec![1, 2, 3]));
476482
477-
let guards: Vec<_> = (0..3).map(|i| {
483+
for i in 0..3 {
478484
let number = numbers.clone();
479-
Thread::scoped(move || {
485+
Thread::spawn(move || {
480486
let mut array = number.lock().unwrap();
481487
array[i] += 1;
482488
println!("numbers[{}] is {}", i, array[i]);
483489
});
484-
}).collect();
490+
}
485491
}
486492
```
487493
@@ -510,10 +516,8 @@ numbers[1] is 3
510516
numbers[0] is 2
511517
```
512518
513-
Each time, we can get a slithtly different output because the threads
514-
are not quaranteed to run in any set order. If you get the same order
515-
every time it is because each of these threads are very small and
516-
complete too fast for their indeterminate behavior to surface.
519+
Each time, we get a slightly different output, because each thread works in a
520+
different order. You may not get the same output as this sample, even.
517521
518522
The important part here is that the Rust compiler was able to use ownership to
519523
give us assurance _at compile time_ that we weren't doing something incorrect
@@ -535,13 +539,13 @@ safety check that makes this an error about moved values:
535539
use std::thread::Thread;
536540
537541
fn main() {
538-
let numbers = vec![1, 2, 3];
539-
540-
let guards: Vec<_> = (0..3).map(|i| {
541-
Thread::scoped(move || {
542-
println!("{}", numbers[i]);
542+
let vec = vec![1, 2, 3];
543+
544+
for i in 0..3 {
545+
Thread::spawn(move || {
546+
println!("{}", vec[i]);
543547
});
544-
}).collect();
548+
}
545549
}
546550
```
547551

branches/tmp/src/doc/reference.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,6 @@ This last example is different because it is not possible to use the suffix
515515
syntax with a floating point literal ending in a period. `2.f64` would attempt
516516
to call a method named `f64` on `2`.
517517

518-
The representation semantics of floating-point numbers are described in
519-
["Machine Types"](#machine-types).
520-
521518
#### Boolean literals
522519

523520
The two values of the boolean type are written `true` and `false`.
@@ -2191,8 +2188,8 @@ The following configurations must be defined by the implementation:
21912188
`"unix"` or `"windows"`. The value of this configuration option is defined
21922189
as a configuration itself, like `unix` or `windows`.
21932190
* `target_os = "..."`. Operating system of the target, examples include
2194-
`"win32"`, `"macos"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
2195-
`"bitrig"` or `"openbsd"`.
2191+
`"win32"`, `"macos"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"` or
2192+
`"openbsd"`.
21962193
* `target_word_size = "..."`. Target word size in bits. This is set to `"32"`
21972194
for targets with 32-bit pointers, and likewise set to `"64"` for 64-bit
21982195
pointers.

branches/tmp/src/doc/trpl/crates-and-modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Rust has two distinct terms that relate to the module system: *crate* and
1212
*module*. A crate is synonymous with a *library* or *package* in other
1313
languages. Hence "Cargo" as the name of Rust's package management tool: you
1414
ship your crates to others with Cargo. Crates can produce an executable or a
15-
library, depending on the project.
15+
shared library, depending on the project.
1616

1717
Each crate has an implicit *root module* that contains the code for that crate.
1818
You can then define a tree of sub-modules under that root module. Modules allow

branches/tmp/src/doc/trpl/guessing-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn main() {
9191
```
9292

9393
You've seen this code before, when we talked about standard input. We
94-
import the `std::old_io` module with `use`, and then our `main` function contains
94+
import the `std::io` module with `use`, and then our `main` function contains
9595
our program's logic. We print a little message announcing the game, ask the
9696
user to input a guess, get their input, and then print it out.
9797

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,6 @@ if x == 5 {
3434
}
3535
```
3636

37-
If there is more than one case, use an `else if`:
38-
39-
```rust
40-
let x = 5;
41-
42-
if x == 5 {
43-
println!("x is five!");
44-
} else if x == 6 {
45-
println!("x is six!");
46-
} else {
47-
println!("x is not five or six :(");
48-
}
49-
```
50-
5137
This is all pretty standard. However, you can also do this:
5238

5339

0 commit comments

Comments
 (0)