Skip to content

Commit 26423d7

Browse files
committed
---
yaml --- r: 124663 b: refs/heads/try c: 711e439 h: refs/heads/master i: 124661: c211df0 124659: ab36bdd 124655: c225616 v: v3
1 parent be8da3b commit 26423d7

File tree

185 files changed

+888
-5133
lines changed

Some content is hidden

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

185 files changed

+888
-5133
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: f15d6d28396e8700b6c3f2704204a2769e710403
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9fc8394d3bce22ab483f98842434c84c396212ae
5-
refs/heads/try: c0e6c4e65075e5a1a596d09f16a179ff92a922cc
5+
refs/heads/try: 711e43959ac4e7686d8e3ba7ddade3cb1590e75f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ define SREQ_CMDS
377377
ifeq ($$(OSTYPE_$(3)),apple-darwin)
378378
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := DYLD_LIBRARY_PATH
379379
else
380-
ifeq ($$(CFG_WINDOWSY_$(2)),1)
380+
ifeq ($$(CFG_WINDOWSY_$(3)),1)
381381
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := PATH
382382
else
383383
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := LD_LIBRARY_PATH

branches/try/src/compiletest/compiletest.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use std::io::fs;
3030
use std::from_str::FromStr;
3131
use getopts::{optopt, optflag, reqopt};
3232
use common::Config;
33-
use common::{Pretty, DebugInfoGdb, DebugInfoLldb, Codegen};
33+
use common::{Pretty, DebugInfoGdb, Codegen};
3434
use util::logv;
3535
use regex::Regex;
3636

@@ -89,9 +89,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
8989
optflag("h", "help", "show this message"));
9090

9191
assert!(!args.is_empty());
92-
let argv0 = args[0].clone();
92+
let argv0 = (*args.get(0)).clone();
9393
let args_ = args.tail();
94-
if args[1].as_slice() == "-h" || args[1].as_slice() == "--help" {
94+
if args.get(1).as_slice() == "-h" || args.get(1).as_slice() == "--help" {
9595
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
9696
println!("{}", getopts::usage(message.as_slice(), groups.as_slice()));
9797
println!("");
@@ -116,7 +116,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
116116
}
117117

118118
let filter = if !matches.free.is_empty() {
119-
let s = matches.free[0].as_slice();
119+
let s = matches.free.get(0).as_slice();
120120
match regex::Regex::new(s) {
121121
Ok(re) => Some(re),
122122
Err(e) => {
@@ -241,16 +241,6 @@ pub fn run_tests(config: &Config) {
241241
os::setenv("RUST_TEST_TASKS","1");
242242
}
243243

244-
match config.mode {
245-
DebugInfoLldb => {
246-
// Some older versions of LLDB seem to have problems with multiple
247-
// instances running in parallel, so only run one test task at a
248-
// time.
249-
os::setenv("RUST_TEST_TASKS", "1");
250-
}
251-
_ => { /* proceed */ }
252-
}
253-
254244
let opts = test_opts(config);
255245
let tests = make_tests(config);
256246
// sadly osx needs some file descriptor limits raised for running tests in

branches/try/src/compiletest/runtest.rs

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
167167
let proc_res = print_source(config,
168168
props,
169169
testfile,
170-
srcs[round].to_string(),
170+
(*srcs.get(round)).to_string(),
171171
"normal");
172172

173173
if !proc_res.status.success() {
@@ -187,9 +187,9 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
187187
let s = File::open(&filepath).read_to_end().unwrap();
188188
String::from_utf8(s).unwrap()
189189
}
190-
None => { srcs[srcs.len() - 2u].clone() }
190+
None => { (*srcs.get(srcs.len() - 2u)).clone() }
191191
};
192-
let mut actual = srcs[srcs.len() - 1u].clone();
192+
let mut actual = (*srcs.get(srcs.len() - 1u)).clone();
193193

194194
if props.pp_exact.is_some() {
195195
// Now we have to care about line endings
@@ -209,7 +209,7 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
209209
if props.no_pretty_expanded { return }
210210

211211
// additionally, run `--pretty expanded` and try to build it.
212-
let proc_res = print_source(config, props, testfile, srcs[round].clone(), "expanded");
212+
let proc_res = print_source(config, props, testfile, (*srcs.get(round)).clone(), "expanded");
213213
if !proc_res.status.success() {
214214
fatal_proc_rec("pretty-printing (expanded) failed", &proc_res);
215215
}
@@ -536,16 +536,6 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
536536
// We don't want to hang when calling `quit` while the process is still running
537537
let mut script_str = String::from_str("settings set auto-confirm true\n");
538538

539-
// Make LLDB emit its version, so we have it documented in the test output
540-
script_str.push_str("version\n");
541-
542-
// Switch LLDB into "Rust mode"
543-
script_str.push_str("command script import ./src/etc/lldb_rust_formatters.py\n");
544-
script_str.push_str("type summary add --no-value ");
545-
script_str.push_str("--python-function lldb_rust_formatters.print_val ");
546-
script_str.push_str("-x \".*\" --category Rust\n");
547-
script_str.push_str("type category enable Rust\n");
548-
549539
// Set breakpoints on every line that contains the string "#break"
550540
for line in breakpoint_lines.iter() {
551541
script_str.push_str(format!("breakpoint set --line {}\n",
@@ -702,7 +692,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
702692
let mut rest = line.trim();
703693
let mut first = true;
704694
let mut failed = false;
705-
for frag in check_fragments[i].iter() {
695+
for frag in check_fragments.get(i).iter() {
706696
let found = if first {
707697
if rest.starts_with(frag.as_slice()) {
708698
Some(0)
@@ -752,7 +742,7 @@ fn check_error_patterns(props: &TestProps,
752742
}
753743

754744
let mut next_err_idx = 0u;
755-
let mut next_err_pat = &props.error_patterns[next_err_idx];
745+
let mut next_err_pat = props.error_patterns.get(next_err_idx);
756746
let mut done = false;
757747
let output_to_check = if props.check_stdout {
758748
format!("{}{}", proc_res.stdout, proc_res.stderr)
@@ -761,14 +751,14 @@ fn check_error_patterns(props: &TestProps,
761751
};
762752
for line in output_to_check.as_slice().lines() {
763753
if line.contains(next_err_pat.as_slice()) {
764-
debug!("found error pattern {}", next_err_pat);
754+
debug!("found error pattern {}", *next_err_pat);
765755
next_err_idx += 1u;
766756
if next_err_idx == props.error_patterns.len() {
767757
debug!("found all error patterns");
768758
done = true;
769759
break;
770760
}
771-
next_err_pat = &props.error_patterns[next_err_idx];
761+
next_err_pat = props.error_patterns.get(next_err_idx);
772762
}
773763
}
774764
if done { return; }
@@ -847,13 +837,13 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
847837
for line in proc_res.stderr.as_slice().lines() {
848838
let mut was_expected = false;
849839
for (i, ee) in expected_errors.iter().enumerate() {
850-
if !found_flags[i] {
840+
if !*found_flags.get(i) {
851841
debug!("prefix={} ee.kind={} ee.msg={} line={}",
852-
prefixes[i].as_slice(),
842+
prefixes.get(i).as_slice(),
853843
ee.kind,
854844
ee.msg,
855845
line);
856-
if prefix_matches(line, prefixes[i].as_slice()) &&
846+
if prefix_matches(line, prefixes.get(i).as_slice()) &&
857847
line.contains(ee.kind.as_slice()) &&
858848
line.contains(ee.msg.as_slice()) {
859849
*found_flags.get_mut(i) = true;
@@ -877,7 +867,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
877867

878868
for (i, &flag) in found_flags.iter().enumerate() {
879869
if !flag {
880-
let ee = &expected_errors[i];
870+
let ee = expected_errors.get(i);
881871
fatal_proc_rec(format!("expected {} on line {} not found: {}",
882872
ee.kind, ee.line, ee.msg).as_slice(),
883873
proc_res);

branches/try/src/doc/guide.md

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,59 @@ program doesn't have any dependencies, so we'll only be using the first part of
279279
its functionality. Eventually, we'll add more. Since we started off by using
280280
Cargo, it'll be easy to add later.
281281

282-
Let's convert Hello World to Cargo. The first thing we need to do to begin
283-
using Cargo is to install Cargo. Luckily for us, the script we ran to install
284-
Rust includes Cargo by default. If you installed Rust some other way, you may
285-
want to [check the Cargo
286-
README](https://github.com/rust-lang/cargo#installing-cargo-from-nightlies)
287-
for specific instructions about installing it.
282+
Let's convert Hello World to Cargo. The first thing we need to do to begin using Cargo
283+
is to install Cargo. To do this, we need to build it from source. There are no binaries
284+
yet.
285+
286+
First, let's go back to our projects directory. We don't want Cargo to
287+
live in our project!
288+
289+
```{bash}
290+
$ cd ..
291+
```
292+
293+
Next, we need these commands:
294+
295+
```{bash}
296+
$ git clone --recursive https://github.com/rust-lang/cargo
297+
$ cd cargo
298+
$ make
299+
$ make install # may need sudo or admin permissions
300+
```
301+
302+
The `--recursive` downloads Cargo's own dependencies. You can't use Cargo to
303+
fetch dependencies until you have Cargo installed! Also, you will need to have
304+
`git` installed. Much of the Rust world assumes `git` usage, so it's a good
305+
thing to have around. Please check out [the git
306+
documentation](http://git-scm.com/book/en/Getting-Started-Installing-Git) for
307+
more on installing `git`.
308+
309+
We hope to give Cargo a binary installer, similar to Rust's own, so that
310+
this will not be necessary in the future.
311+
312+
Let's see if that worked. Try this:
313+
314+
```{bash}
315+
$ cargo
316+
Commands:
317+
build # compile the current project
318+
319+
Options (for all commands):
320+
321+
-v, [--verbose]
322+
-h, [--help]
323+
```
324+
325+
If you see this output when you run `cargo`, congrats! Cargo is working. If
326+
not, please [open an issue](https://github.com/rust-lang/cargo/issues/new) or
327+
drop by the Rust IRC, and we can help you out.
328+
329+
Let's move back into our `hello_world` directory now:
330+
331+
```{bash}
332+
$ cd .. # move back up into projects
333+
$ cd hello_world # move into hello_world
334+
```
288335

289336
To Cargo-ify our project, we need to do two things: Make a `Cargo.toml`
290337
configuration file, and put our source file in the right place. Let's

branches/try/src/doc/intro.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fn main() {
205205
206206
spawn(proc() {
207207
let numbers = rx.recv();
208-
println!("{}", numbers[0]);
208+
println!("{}", *numbers.get(0));
209209
})
210210
}
211211
```
@@ -244,19 +244,19 @@ fn main() {
244244
245245
spawn(proc() {
246246
let numbers = rx.recv();
247-
println!("{}", numbers[0]);
247+
println!("{}", numbers.get(0));
248248
});
249249
250250
// Try to print a number from the original task
251-
println!("{}", numbers[0]);
251+
println!("{}", *numbers.get(0));
252252
}
253253
```
254254

255255
The compiler will produce an error indicating that the value is no longer in scope:
256256

257257
```text
258258
concurrency.rs:12:20: 12:27 error: use of moved value: 'numbers'
259-
concurrency.rs:12 println!("{}", numbers[0]);
259+
concurrency.rs:12 println!("{}", numbers.get(0));
260260
^~~~~~~
261261
```
262262

@@ -276,7 +276,7 @@ fn main() {
276276
277277
spawn(proc() {
278278
let numbers = rx.recv();
279-
println!("{:d}", numbers[num as uint]);
279+
println!("{:d}", *numbers.get(num as uint));
280280
})
281281
}
282282
}
@@ -309,7 +309,7 @@ fn main() {
309309
310310
spawn(proc() {
311311
let numbers = rx.recv();
312-
println!("{:d}", (*numbers)[num as uint]);
312+
println!("{:d}", *numbers.get(num as uint));
313313
})
314314
}
315315
}
@@ -364,7 +364,7 @@ fn main() {
364364
// See: https://github.com/rust-lang/rust/issues/6515
365365
*numbers.get_mut(num as uint) = *numbers.get_mut(num as uint) + 1;
366366
367-
println!("{}", (*numbers)[num as uint]);
367+
println!("{}", *numbers.get(num as uint));
368368
369369
// When `numbers` goes out of scope the lock is dropped
370370
})

branches/try/src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,7 @@ as in this version of `print_all` that copies elements.
24272427
fn print_all<T: Printable + Clone>(printable_things: Vec<T>) {
24282428
let mut i = 0;
24292429
while i < printable_things.len() {
2430-
let copy_of_thing = printable_things[i].clone();
2430+
let copy_of_thing = printable_things.get(i).clone();
24312431
copy_of_thing.print();
24322432
i += 1;
24332433
}

branches/try/src/etc/lldb_batchmode.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
import re
3232
import atexit
3333

34+
# Terminate the debugger
35+
atexit.register(lambda: lldb.SBDebugger.Terminate())
36+
3437
# Set this to True for additional output
3538
DEBUG_OUTPUT = False
3639

0 commit comments

Comments
 (0)