Skip to content

Commit eaecadf

Browse files
committed
---
yaml --- r: 162663 b: refs/heads/try c: 989d7a7 h: refs/heads/master i: 162661: a115ac1 162659: 6029090 162655: 842f65e v: v3
1 parent eab3da7 commit eaecadf

File tree

259 files changed

+6129
-3040
lines changed

Some content is hidden

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

259 files changed

+6129
-3040
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: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: c9816be35a1bcdef915498939a1f62c18dee1c04
5+
refs/heads/try: 989d7a78bbf6e2354911d37653d5bb1cb018742c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ include $(CFG_SRC_DIR)mk/rustllvm.mk
198198
include $(CFG_SRC_DIR)mk/docs.mk
199199
# LLVM
200200
include $(CFG_SRC_DIR)mk/llvm.mk
201+
# Rules for installing debugger scripts
202+
include $(CFG_SRC_DIR)mk/debuggers.mk
201203

202204
######################################################################
203205
# Secondary makefiles, conditionalized for speed

branches/try/configure

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ probe CFG_LD ld
624624
probe CFG_VALGRIND valgrind
625625
probe CFG_PERF perf
626626
probe CFG_ISCC iscc
627-
probe CFG_LLNEXTGEN LLnextgen
628627
probe CFG_JAVAC javac
629628
probe CFG_ANTLR4 antlr4
630629
probe CFG_GRUN grun

branches/try/mk/clean.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ clean-generic-$(2)-$(1):
6363
-name '*.lib' -o \
6464
-name '*.dll' -o \
6565
-name '*.def' -o \
66+
-name '*.py' -o \
6667
-name '*.bc' \
6768
\) \
6869
| xargs rm -f
@@ -78,7 +79,7 @@ define CLEAN_HOST_STAGE_N
7879

7980
clean$(1)_H_$(2): \
8081
$$(foreach crate,$$(CRATES),clean$(1)_H_$(2)-lib-$$(crate)) \
81-
$$(foreach tool,$$(TOOLS),clean$(1)_H_$(2)-tool-$$(tool))
82+
$$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS),clean$(1)_H_$(2)-tool-$$(tool))
8283
$$(Q)rm -fr $(2)/rt/libbacktrace
8384

8485
clean$(1)_H_$(2)-tool-%:
@@ -98,7 +99,7 @@ define CLEAN_TARGET_STAGE_N
9899

99100
clean$(1)_T_$(2)_H_$(3): \
100101
$$(foreach crate,$$(CRATES),clean$(1)_T_$(2)_H_$(3)-lib-$$(crate)) \
101-
$$(foreach tool,$$(TOOLS),clean$(1)_T_$(2)_H_$(3)-tool-$$(tool))
102+
$$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS),clean$(1)_T_$(2)_H_$(3)-tool-$$(tool))
102103
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a
103104
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a
104105
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass_stage* # For unix

branches/try/mk/crates.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
################################################################################
5151

5252
TARGET_CRATES := libc std flate arena term \
53-
serialize sync getopts collections test time rand \
53+
serialize getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
5656
HOST_CRATES := syntax rustc rustc_trans rustdoc regex_macros fmt_macros \
@@ -63,7 +63,7 @@ DEPS_libc := core
6363
DEPS_unicode := core
6464
DEPS_alloc := core libc native:jemalloc
6565
DEPS_rustrt := alloc core libc collections native:rustrt_native
66-
DEPS_std := core libc rand alloc collections rustrt sync unicode \
66+
DEPS_std := core libc rand alloc collections rustrt unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
6969
DEPS_syntax := std term serialize log fmt_macros arena libc
@@ -81,7 +81,6 @@ DEPS_glob := std
8181
DEPS_serialize := std log
8282
DEPS_rbml := std log serialize
8383
DEPS_term := std log
84-
DEPS_sync := core alloc rustrt collections
8584
DEPS_getopts := std
8685
DEPS_collections := core alloc unicode
8786
DEPS_num := std

branches/try/mk/debuggers.mk

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
# file at the top-level directory of this distribution and at
3+
# http://rust-lang.org/COPYRIGHT.
4+
#
5+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
# option. This file may not be copied, modified, or distributed
9+
# except according to those terms.
10+
11+
######################################################################
12+
# Copy debugger related scripts
13+
######################################################################
14+
15+
DEBUGGER_RUSTLIB_ETC_SCRIPTS=lldb_rust_formatters.py
16+
DEBUGGER_BIN_SCRIPTS=rust-lldb
17+
18+
DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS=$(foreach script,$(DEBUGGER_RUSTLIB_ETC_SCRIPTS), \
19+
$(CFG_SRC_DIR)src/etc/$(script))
20+
DEBUGGER_BIN_SCRIPTS_ABS=$(foreach script,$(DEBUGGER_BIN_SCRIPTS), \
21+
$(CFG_SRC_DIR)src/etc/$(script))
22+
23+
DEBUGGER_SCRIPTS_ALL=$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $(DEBUGGER_BIN_SCRIPTS_ABS)
24+
25+
# $(1) - the stage to copy to
26+
# $(2) - the host triple
27+
define DEF_INSTALL_DEBUGGER_SCRIPTS_HOST
28+
29+
tmp/install-debugger-scripts$(1)_H_$(2).done: $$(DEBUGGER_SCRIPTS_ALL)
30+
$(Q)mkdir -p $$(HBIN$(1)_H_$(2))
31+
$(Q)mkdir -p $$(HLIB$(1)_H_$(2))/rustlib/etc
32+
$(Q)install $(DEBUGGER_BIN_SCRIPTS_ABS) $$(HBIN$(1)_H_$(2))
33+
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
34+
$(Q)touch $$@
35+
endef
36+
37+
# Expand host make-targets for all stages
38+
$(foreach stage,$(STAGES), \
39+
$(foreach host,$(CFG_HOST), \
40+
$(eval $(call DEF_INSTALL_DEBUGGER_SCRIPTS_HOST,$(stage),$(host)))))
41+
42+
# $(1) is the stage number
43+
# $(2) is the target triple
44+
# $(3) is the host triple
45+
define DEF_INSTALL_DEBUGGER_SCRIPTS_TARGET
46+
47+
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3).done: $$(DEBUGGER_SCRIPTS_ALL)
48+
$(Q)mkdir -p $$(TBIN$(1)_T_$(2)_H_$(3))
49+
$(Q)mkdir -p $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
50+
$(Q)install $(DEBUGGER_BIN_SCRIPTS_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
51+
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
52+
$(Q)touch $$@
53+
endef
54+
55+
# Expand target make-targets for all stages
56+
$(foreach stage,$(STAGES), \
57+
$(foreach target,$(CFG_TARGET), \
58+
$(foreach host,$(CFG_HOST), \
59+
$(eval $(call DEF_INSTALL_DEBUGGER_SCRIPTS_TARGET,$(stage),$(target),$(host))))))

branches/try/mk/docs.mk

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -246,26 +246,6 @@ endef
246246
$(foreach lang,$(L10N_LANGS),$(eval $(call DEF_L10N_DOC,$(lang),guide)))
247247

248248

249-
######################################################################
250-
# LLnextgen (grammar analysis from refman)
251-
######################################################################
252-
253-
ifeq ($(CFG_LLNEXTGEN),)
254-
$(info cfg: no llnextgen found, omitting grammar-verification)
255-
else
256-
.PHONY: verify-grammar
257-
258-
doc/rust.g: $(D)/rust.md $(S)src/etc/extract_grammar.py
259-
@$(call E, extract_grammar: $@)
260-
$(Q)$(CFG_PYTHON) $(S)src/etc/extract_grammar.py $< >$@
261-
262-
verify-grammar: doc/rust.g
263-
@$(call E, LLnextgen: $<)
264-
$(Q)$(CFG_LLNEXTGEN) --generate-lexer-wrapper=no $< >$@
265-
$(Q)rm -f doc/rust.c doc/rust.h
266-
endif
267-
268-
269249
######################################################################
270250
# Rustdoc (libstd/extra)
271251
######################################################################

branches/try/mk/main.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,8 @@ HSREQ$(1)_H_$(3) = $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3))
356356
else
357357
HSREQ$(1)_H_$(3) = \
358358
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
359-
$$(MKFILE_DEPS)
359+
$$(MKFILE_DEPS) \
360+
tmp/install-debugger-scripts$(1)_H_$(3).done
360361
endif
361362

362363
# Prerequisites for using the stageN compiler to build target artifacts
@@ -370,7 +371,8 @@ TSREQ$(1)_T_$(2)_H_$(3) = \
370371
SREQ$(1)_T_$(2)_H_$(3) = \
371372
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
372373
$$(foreach dep,$$(TARGET_CRATES), \
373-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep))
374+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \
375+
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3).done
374376

375377
# Prerequisites for a working stageN compiler and complete set of target
376378
# libraries

branches/try/mk/prepare.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ prepare-base-$(1): PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELAT
155155
prepare-base-$(1): PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1
156156
prepare-base-$(1): prepare-everything-$(1)
157157

158-
prepare-everything-$(1): prepare-host-$(1) prepare-targets-$(1)
158+
prepare-everything-$(1): prepare-host-$(1) prepare-targets-$(1) prepare-debugger-scripts-$(1)
159159

160160
prepare-host-$(1): prepare-host-tools-$(1)
161161

@@ -167,8 +167,13 @@ prepare-host-tools-$(1): \
167167
prepare-host-dirs-$(1): prepare-maybe-clean-$(1)
168168
$$(call PREPARE_DIR,$$(PREPARE_DEST_BIN_DIR))
169169
$$(call PREPARE_DIR,$$(PREPARE_DEST_LIB_DIR))
170+
$$(call PREPARE_DIR,$$(PREPARE_DEST_LIB_DIR)/rustlib/etc)
170171
$$(call PREPARE_DIR,$$(PREPARE_DEST_MAN_DIR))
171172

173+
prepare-debugger-scripts-$(1): prepare-host-dirs-$(1) $(DEBUGGER_SCRIPTS_ALL)
174+
$$(Q)$$(PREPARE_BIN_CMD) $(DEBUGGER_BIN_SCRIPTS_ABS) $$(PREPARE_DEST_BIN_DIR)
175+
$$(Q)$$(PREPARE_LIB_CMD) $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ABS) $$(PREPARE_DEST_LIB_DIR)/rustlib/etc
176+
172177
$$(foreach tool,$$(PREPARE_TOOLS), \
173178
$$(foreach host,$$(CFG_HOST), \
174179
$$(eval $$(call DEF_PREPARE_HOST_TOOL,$$(tool),$$(PREPARE_STAGE),$$(host),$(1)))))

branches/try/src/compiletest/errors.rs

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
use self::WhichLine::*;
1011

1112
use std::ascii::AsciiExt;
1213
use std::io::{BufferedReader, File};
@@ -18,28 +19,74 @@ pub struct ExpectedError {
1819
pub msg: String,
1920
}
2021

21-
pub static EXPECTED_PATTERN : &'static str = r"//~(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
22+
/// Looks for either "//~| KIND MESSAGE" or "//~^^... KIND MESSAGE"
23+
/// The former is a "follow" that inherits its target from the preceding line;
24+
/// the latter is an "adjusts" that goes that many lines up.
25+
///
26+
/// Goal is to enable tests both like: //~^^^ ERROR go up three
27+
/// and also //~^ ERROR message one for the preceding line, and
28+
/// //~| ERROR message two for that same line.
29+
30+
pub static EXPECTED_PATTERN : &'static str =
31+
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
32+
33+
#[deriving(PartialEq, Show)]
34+
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
2235

2336
// Load any test directives embedded in the file
2437
pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> {
2538
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
2639

40+
// `last_nonfollow_error` tracks the most recently seen
41+
// line with an error template that did not use the
42+
// follow-syntax, "//~| ...".
43+
//
44+
// (pnkfelix could not find an easy way to compose Iterator::scan
45+
// and Iterator::filter_map to pass along this information into
46+
// `parse_expected`. So instead I am storing that state here and
47+
// updating it in the map callback below.)
48+
let mut last_nonfollow_error = None;
49+
2750
rdr.lines().enumerate().filter_map(|(line_no, ln)| {
28-
parse_expected(line_no + 1, ln.unwrap().as_slice(), re)
51+
parse_expected(last_nonfollow_error,
52+
line_no + 1,
53+
ln.unwrap().as_slice(), re)
54+
.map(|(which, error)| {
55+
match which {
56+
FollowPrevious(_) => {}
57+
_ => last_nonfollow_error = Some(error.line),
58+
}
59+
error
60+
})
2961
}).collect()
3062
}
3163

32-
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
64+
fn parse_expected(last_nonfollow_error: Option<uint>,
65+
line_num: uint,
66+
line: &str,
67+
re: &Regex) -> Option<(WhichLine, ExpectedError)> {
3368
re.captures(line).and_then(|caps| {
3469
let adjusts = caps.name("adjusts").len();
3570
let kind = caps.name("kind").to_ascii_lower();
3671
let msg = caps.name("msg").trim().to_string();
72+
let follow = caps.name("follow").len() > 0;
73+
74+
let (which, line) = if follow {
75+
assert!(adjusts == 0, "use either //~| or //~^, not both.");
76+
let line = last_nonfollow_error.unwrap_or_else(|| {
77+
panic!("encountered //~| without preceding //~^ line.")
78+
});
79+
(FollowPrevious(line), line)
80+
} else {
81+
let which =
82+
if adjusts > 0 { AdjustBackward(adjusts) } else { ThisLine };
83+
let line = line_num - adjusts;
84+
(which, line)
85+
};
3786

38-
debug!("line={} kind={} msg={}", line_num, kind, msg);
39-
Some(ExpectedError {
40-
line: line_num - adjusts,
41-
kind: kind,
42-
msg: msg,
43-
})
87+
debug!("line={} which={} kind={} msg={}", line_num, which, kind, msg);
88+
Some((which, ExpectedError { line: line,
89+
kind: kind,
90+
msg: msg, }))
4491
})
4592
}

branches/try/src/doc/complement-bugreport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# I think I found a bug in the compiler!
44

5-
If you see this message: `error: internal compiler error: unexpected failure`,
5+
If you see this message: `error: internal compiler error: unexpected panic`,
66
then you have definitely found a bug in the compiler. It's also possible that
77
your code is not well-typed, but if you saw this message, it's still a bug in
88
error reporting.

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,32 @@ fn succ(x: &int) -> int { *x + 1 }
445445
to
446446

447447
```{rust}
448+
use std::rc::Rc;
449+
448450
fn box_succ(x: Box<int>) -> int { *x + 1 }
449451
450-
fn rc_succ(x: std::rc::Rc<int>) -> int { *x + 1 }
452+
fn rc_succ(x: Rc<int>) -> int { *x + 1 }
453+
```
454+
455+
Note that the caller of your function will have to modify their calls slightly:
456+
457+
```{rust}
458+
use std::rc::Rc;
459+
460+
fn succ(x: &int) -> int { *x + 1 }
461+
462+
let ref_x = &5i;
463+
let box_x = box 5i;
464+
let rc_x = Rc::new(5i);
465+
466+
succ(ref_x);
467+
succ(&*box_x);
468+
succ(&*rc_x);
451469
```
452470

471+
The initial `*` dereferences the pointer, and then `&` takes a reference to
472+
those contents.
473+
453474
# Boxes
454475

455476
`Box<T>` is Rust's 'boxed pointer' type. Boxes provide the simplest form of

branches/try/src/doc/guide.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,15 @@ of your time with Rust.
378378
The first thing we'll learn about are 'variable bindings.' They look like this:
379379

380380
```{rust}
381-
let x = 5i;
381+
fn main() {
382+
let x = 5i;
383+
}
382384
```
383385

386+
Putting `fn main() {` in each example is a bit tedious, so we'll leave that out
387+
in the future. If you're following along, make sure to edit your `main()`
388+
function, rather than leaving it off. Otherwise, you'll get an error.
389+
384390
In many languages, this is called a 'variable.' But Rust's variable bindings
385391
have a few tricks up their sleeves. Rust has a very powerful feature called
386392
'pattern matching' that we'll get into detail with later, but the left

branches/try/src/etc/licenseck.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@
3838
"rt/isaac/randport.cpp", # public domain
3939
"rt/isaac/rand.h", # public domain
4040
"rt/isaac/standard.h", # public domain
41-
"libsync/mpsc_queue.rs", # BSD
42-
"libsync/spsc_queue.rs", # BSD
43-
"libsync/mpmc_bounded_queue.rs", # BSD
44-
"libsync/mpsc_intrusive.rs", # BSD
41+
"libstd/sync/mpsc_queue.rs", # BSD
42+
"libstd/sync/spsc_queue.rs", # BSD
43+
"libstd/sync/mpmc_bounded_queue.rs", # BSD
4544
"test/bench/shootout-binarytrees.rs", # BSD
4645
"test/bench/shootout-chameneos-redux.rs", # BSD
4746
"test/bench/shootout-fannkuch-redux.rs", # BSD

0 commit comments

Comments
 (0)