Skip to content

Commit baaa5ce

Browse files
---
yaml --- r: 128508 b: refs/heads/try c: 34d76d4 h: refs/heads/master v: v3
1 parent 37e710e commit baaa5ce

File tree

395 files changed

+3175
-9950
lines changed

Some content is hidden

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

395 files changed

+3175
-9950
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: b22e840d43ec8d0de0b95f26a76046cfcca93c22
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
5-
refs/heads/try: 73b8f60b60d8a2a7ca5a7d49d59771350b867951
5+
refs/heads/try: 34d76d4a0f7ea45f7203d925fce2ec6bfa448f4b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ please do two things:
1616

1717
2. Run the full Rust test suite with the `make check` command. You're
1818
not off the hook even if you just stick to documentation; code
19-
examples in the docs are tested as well! Although for simple
20-
wording or grammar fixes, this is probably unnecessary.
19+
examples in the docs are tested as well!
2120

2221
Pull requests will be treated as "review requests", and we will give
2322
feedback we expect to see corrected on

branches/try/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ documentation.
3232

3333
To build from the [tarball] do:
3434

35-
$ curl -O https://static.rust-lang.org/dist/rust-nightly.tar.gz
35+
$ curl -O http://static.rust-lang.org/dist/rust-nightly.tar.gz
3636
$ tar -xzf rust-nightly.tar.gz
3737
$ cd rust-nightly
3838

@@ -75,7 +75,7 @@ To easily build on windows we can use [MSYS2](http://sourceforge.net/projects/ms
7575
$ make && make install
7676

7777
[repo]: https://github.com/rust-lang/rust
78-
[tarball]: https://static.rust-lang.org/dist/rust-nightly.tar.gz
78+
[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz
7979
[tutorial]: http://doc.rust-lang.org/tutorial.html
8080

8181
## Notes

branches/try/configure

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -557,21 +557,13 @@ fi
557557

558558
if [ ! -z "$CFG_ENABLE_LOCAL_RUST" ]
559559
then
560-
system_rustc=$(which rustc)
561-
if [ -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
560+
if [ ! -f ${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} ]
562561
then
563-
: # everything already configured
564-
elif [ -n "$system_rustc" ]
565-
then
566-
# we assume that rustc is in a /bin directory
567-
CFG_LOCAL_RUST_ROOT=${system_rustc%/bin/rustc}
568-
else
569562
err "no local rust to use"
563+
else
564+
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} --version`
565+
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
570566
fi
571-
572-
LRV=`${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF} --version`
573-
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
574-
putvar CFG_LOCAL_RUST_ROOT
575567
fi
576568

577569
# Force freebsd to build with clang; gcc doesn't like us there

branches/try/mk/main.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ endif
139139
RUSTFLAGS_STAGE0 += -C prefer-dynamic
140140
RUSTFLAGS_STAGE1 += -C prefer-dynamic
141141

142-
# Landing pads require a lot of codegen. We can get through bootstrapping faster
143-
# by not emitting them.
144-
RUSTFLAGS_STAGE0 += -Z no-landing-pads
145-
146142
# platform-specific auto-configuration
147143
include $(CFG_SRC_DIR)mk/platform.mk
148144

branches/try/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
233233
parse_name_value_directive(line, "exec-env").map(|nv| {
234234
// nv is either FOO or FOO=BAR
235235
let mut strs: Vec<String> = nv.as_slice()
236-
.splitn(1, '=')
236+
.splitn('=', 1)
237237
.map(|s| s.to_string())
238238
.collect();
239239

branches/try/src/compiletest/runtest.rs

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use std::os;
3030
use std::str;
3131
use std::string::String;
3232
use std::task;
33-
use std::time::Duration;
3433
use test::MetricMap;
3534

3635
pub fn run(config: Config, testfile: String) {
@@ -323,7 +322,12 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
323322
};
324323

325324
let config = &mut config;
326-
let DebuggerCommands { commands, check_lines, .. } = parse_debugger_commands(testfile, "gdb");
325+
let DebuggerCommands {
326+
commands,
327+
check_lines,
328+
use_gdb_pretty_printer,
329+
..
330+
} = parse_debugger_commands(testfile, "gdb");
327331
let mut cmds = commands.connect("\n");
328332

329333
// compile test file (it should have 'compile-flags:-g' in the header)
@@ -334,7 +338,6 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
334338

335339
let exe_file = make_exe_name(config, testfile);
336340

337-
let mut proc_args;
338341
let debugger_run_result;
339342
match config.target.as_slice() {
340343
"arm-linux-androideabi" => {
@@ -401,7 +404,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
401404
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
402405
loop {
403406
//waiting 1 second for gdbserver start
404-
timer::sleep(Duration::milliseconds(1000));
407+
timer::sleep(1000);
405408
let result = task::try(proc() {
406409
tcp::TcpStream::connect("127.0.0.1", 5039).unwrap();
407410
});
@@ -454,6 +457,12 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
454457
}
455458

456459
_=> {
460+
let rust_src_root = find_rust_src_root(config).expect("Could not find Rust source root");
461+
let rust_pp_module_rel_path = Path::new("./src/etc");
462+
let rust_pp_module_abs_path = rust_src_root.join(rust_pp_module_rel_path)
463+
.as_str()
464+
.unwrap()
465+
.to_string();
457466
// write debugger script
458467
let script_str = [
459468
"set charset UTF-8".to_string(),
@@ -466,6 +475,12 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
466475
script_str.as_slice(),
467476
"debugger.script");
468477

478+
if use_gdb_pretty_printer {
479+
// Only emit the gdb auto-loading script if pretty printers
480+
// should actually be loaded
481+
dump_gdb_autoload_script(config, testfile);
482+
}
483+
469484
// run debugger script with gdb
470485
#[cfg(windows)]
471486
fn debugger() -> String {
@@ -483,16 +498,27 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
483498
vec!("-quiet".to_string(),
484499
"-batch".to_string(),
485500
"-nx".to_string(),
501+
// Add the directory containing the pretty printers to
502+
// GDB's script auto loading safe path ...
503+
format!("-iex=add-auto-load-safe-path {}",
504+
rust_pp_module_abs_path.as_slice()),
505+
// ... and also the test directory
506+
format!("-iex=add-auto-load-safe-path {}",
507+
config.build_base.as_str().unwrap()),
486508
format!("-command={}", debugger_script.as_str().unwrap()),
487509
exe_file.as_str().unwrap().to_string());
488-
proc_args = ProcArgs {
510+
511+
let proc_args = ProcArgs {
489512
prog: debugger(),
490513
args: debugger_opts,
491514
};
515+
516+
let environment = vec![("PYTHONPATH".to_string(), rust_pp_module_abs_path)];
517+
492518
debugger_run_result = compose_and_run(config,
493519
testfile,
494520
proc_args,
495-
Vec::new(),
521+
environment,
496522
config.run_lib_path.as_slice(),
497523
None,
498524
None);
@@ -504,6 +530,32 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
504530
}
505531

506532
check_debugger_output(&debugger_run_result, check_lines.as_slice());
533+
534+
fn dump_gdb_autoload_script(config: &Config, testfile: &Path) {
535+
let mut script_path = output_base_name(config, testfile);
536+
let mut script_file_name = script_path.filename().unwrap().to_vec();
537+
script_file_name.push_all("-gdb.py".as_bytes());
538+
script_path.set_filename(script_file_name.as_slice());
539+
540+
let script_content = "import gdb_rust_pretty_printing\n\
541+
gdb_rust_pretty_printing.register_printers(gdb.current_objfile())\n"
542+
.as_bytes();
543+
544+
File::create(&script_path).write(script_content).unwrap();
545+
}
546+
}
547+
548+
fn find_rust_src_root(config: &Config) -> Option<Path> {
549+
let mut path = config.src_base.clone();
550+
let path_postfix = Path::new("src/etc/lldb_batchmode.py");
551+
552+
while path.pop() {
553+
if path.join(path_postfix.clone()).is_file() {
554+
return Some(path);
555+
}
556+
}
557+
558+
return None;
507559
}
508560

509561
fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path) {
@@ -533,7 +585,8 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
533585
let DebuggerCommands {
534586
commands,
535587
check_lines,
536-
breakpoint_lines
588+
breakpoint_lines,
589+
..
537590
} = parse_debugger_commands(testfile, "lldb");
538591

539592
// Write debugger script:
@@ -619,6 +672,7 @@ struct DebuggerCommands {
619672
commands: Vec<String>,
620673
check_lines: Vec<String>,
621674
breakpoint_lines: Vec<uint>,
675+
use_gdb_pretty_printer: bool
622676
}
623677

624678
fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
@@ -631,6 +685,7 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
631685
let mut breakpoint_lines = vec!();
632686
let mut commands = vec!();
633687
let mut check_lines = vec!();
688+
let mut use_gdb_pretty_printer = false;
634689
let mut counter = 1;
635690
let mut reader = BufferedReader::new(File::open(file_path).unwrap());
636691
for line in reader.lines() {
@@ -640,6 +695,10 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
640695
breakpoint_lines.push(counter);
641696
}
642697

698+
if line.as_slice().contains("gdb-use-pretty-printer") {
699+
use_gdb_pretty_printer = true;
700+
}
701+
643702
header::parse_name_value_directive(
644703
line.as_slice(),
645704
command_directive.as_slice()).map(|cmd| {
@@ -663,7 +722,8 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str)
663722
DebuggerCommands {
664723
commands: commands,
665724
check_lines: check_lines,
666-
breakpoint_lines: breakpoint_lines
725+
breakpoint_lines: breakpoint_lines,
726+
use_gdb_pretty_printer: use_gdb_pretty_printer,
667727
}
668728
}
669729

branches/try/src/doc/complement-design-faq.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ non-deterministic behavior. Rust provides the tools to make using a GC
5050
possible and even pleasant, but it should not be a requirement for
5151
implementing the language.
5252

53-
## Non-`Sync` `static mut` is unsafe
53+
## Non-`Share` `static mut` is unsafe
5454

55-
Types which are [`Sync`][sync] are thread-safe when multiple shared
56-
references to them are used concurrently. Types which are not `Sync` are not
55+
Types which are [`Share`][share] are thread-safe when multiple shared
56+
references to them are used concurrently. Types which are not `Share` are not
5757
thread-safe, and thus when used in a global require unsafe code to use.
5858

59-
[sync]: http://doc.rust-lang.org/core/kinds/trait.Sync.html
59+
[share]: http://doc.rust-lang.org/core/kinds/trait.Share.html
6060

61-
### If mutable static items that implement `Sync` are safe, why is taking &mut SHARABLE unsafe?
61+
### If mutable static items that implement `Share` are safe, why is taking &mut SHARABLE unsafe?
6262

6363
Having multiple aliasing `&mut T`s is never allowed. Due to the nature of
6464
globals, the borrow checker cannot possibly ensure that a static obeys the

branches/try/src/doc/guide-ffi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ linking to, and in the second case `bar` is the type of native library that the
350350
compiler is linking to. There are currently three known types of native
351351
libraries:
352352
353-
* Dynamic - `#[link(name = "readline")]`
354-
* Static - `#[link(name = "my_build_dependency", kind = "static")]`
355-
* Frameworks - `#[link(name = "CoreFoundation", kind = "framework")]`
353+
* Dynamic - `#[link(name = "readline")]
354+
* Static - `#[link(name = "my_build_dependency", kind = "static")]
355+
* Frameworks - `#[link(name = "CoreFoundation", kind = "framework")]
356356
357357
Note that frameworks are only available on OSX targets.
358358

branches/try/src/doc/guide-pointers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ This part is coming soon.
655655
# Returning Pointers
656656

657657
In many languages with pointers, you'd return a pointer from a function
658-
so as to avoid copying a large data structure. For example:
658+
so as to avoid a copying a large data structure. For example:
659659

660660
```{rust}
661661
struct BigStruct {

branches/try/src/doc/guide-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ itself, yet again implying that they are not defined in the standard library.
128128
The full complement of runtime features is defined by the [`Runtime`
129129
trait](std/rt/trait.Runtime.html) and the [`Task`
130130
struct](std/rt/task/struct.Task.html). A `Task` is constant among all runtime
131-
implementations, but each runtime has its own implementation of the
131+
implementations, but each runtime implements has its own implementation of the
132132
`Runtime` trait.
133133

134134
The local `Task` stores the runtime value inside of itself, and then ownership

branches/try/src/doc/guide-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ per-iteration speed of.
198198

199199
For benchmarks relating to processing/generating data, one can set the
200200
`bytes` field to the number of bytes consumed/produced in each
201-
iteration; this will be used to show the throughput of the benchmark.
201+
iteration; this will used to show the throughput of the benchmark.
202202
This must be the amount used in each iteration, *not* the total
203203
amount.
204204

branches/try/src/doc/guide-unsafe.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ explicitly with, respectively, `value as *const T` and `value as *mut T`).
137137

138138
Going the opposite direction, from `*const` to a reference `&`, is not
139139
safe. A `&T` is always valid, and so, at a minimum, the raw pointer
140-
`*const T` has to point to a valid instance of type `T`. Furthermore,
140+
`*const T` has to be a valid to a valid instance of type `T`. Furthermore,
141141
the resulting pointer must satisfy the aliasing and mutability laws of
142142
references. The compiler assumes these properties are true for any
143143
references, no matter how they are created, and so any conversion from
@@ -699,10 +699,10 @@ Other features provided by lang items include:
699699
- stack unwinding and general failure; the `eh_personality`, `fail_`
700700
and `fail_bounds_checks` lang items.
701701
- the traits in `std::kinds` used to indicate types that satisfy
702-
various kinds; lang items `send`, `sync` and `copy`.
702+
various kinds; lang items `send`, `share` and `copy`.
703703
- the marker types and variance indicators found in
704704
`std::kinds::markers`; lang items `covariant_type`,
705-
`contravariant_lifetime`, `no_sync_bound`, etc.
705+
`contravariant_lifetime`, `no_share_bound`, etc.
706706

707707
Lang items are loaded lazily by the compiler; e.g. if one never uses
708708
`Box` then there is no need to define functions for `exchange_malloc`

0 commit comments

Comments
 (0)