Skip to content

Commit 1bfedc6

Browse files
committed
---
yaml --- r: 161277 b: refs/heads/snap-stage3 c: 2264049 h: refs/heads/master i: 161275: c2087b6 v: v3
1 parent bc5726b commit 1bfedc6

File tree

281 files changed

+4401
-9579
lines changed

Some content is hidden

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

281 files changed

+4401
-9579
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: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 93ba558588c3c3c406d2ba923794550567c66bed
4+
refs/heads/snap-stage3: 2264049577e1d64a2a863a9b9f2b7d94f6b90e15
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Cole Mickens <[email protected]>
121121
Colin Davidson <[email protected]>
122122
Colin Sherratt <[email protected]>
123123
Conrad Kleinespel <[email protected]>
124+
Corey Farwell <[email protected]>
124125
Corey Ford <[email protected]>
125126
Corey Richardson <[email protected]>
126127

branches/snap-stage3/configure

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,27 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
546546
# there's no rpath. This is where the build system itself puts libraries;
547547
# --libdir is used to configure the installation directory.
548548
# FIXME: This needs to parameterized over target triples. Do it in platform.mk
549-
CFG_LIBDIR_RELATIVE=lib
550549
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ]
551550
then
552551
CFG_LIBDIR_RELATIVE=bin
552+
else
553+
CFG_LIBDIR_RELATIVE=lib
553554
fi
554555

555-
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
556+
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (do not set it on windows platform)"
557+
558+
case "$CFG_LIBDIR" in
559+
"$CFG_PREFIX"/*) CAT_INC=2;;
560+
"$CFG_PREFIX"*) CAT_INC=1;;
561+
*)
562+
err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
563+
esac
564+
565+
CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
566+
567+
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then
568+
err "libdir on windows should be set to 'bin'"
569+
fi
556570

557571
if [ $HELP -eq 1 ]
558572
then
@@ -701,11 +715,6 @@ then
701715
fi
702716
step_msg "using rustc at: ${CFG_LOCAL_RUST_ROOT} with version: $LRV"
703717
putvar CFG_LOCAL_RUST_ROOT
704-
else
705-
if [ ! -z "$CFG_LOCAL_RUST_ROOT" ]
706-
then
707-
warn "Use of --local-rust-root without --enable-local-rust"
708-
fi
709718
fi
710719

711720
# Force freebsd to build with clang; gcc doesn't like us there
@@ -883,7 +892,10 @@ CFG_PREFIX=${CFG_PREFIX%/}
883892
CFG_MANDIR=${CFG_MANDIR%/}
884893
CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')"
885894
CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')"
886-
CFG_SUPPORTED_TARGET="$(ls ${CFG_SRC_DIR}mk/cfg)"
895+
CFG_SUPPORTED_TARGET=""
896+
for target_file in ${CFG_SRC_DIR}mk/cfg/*.mk; do
897+
CFG_SUPPORTED_TARGET="${CFG_SUPPORTED_TARGET} $(basename "$target_file" .mk)"
898+
done
887899

888900
# copy host-triples to target-triples so that hosts are a subset of targets
889901
V_TEMP=""
@@ -989,6 +1001,15 @@ for h in $CFG_HOST
9891001
do
9901002
for t in $CFG_TARGET
9911003
do
1004+
# host lib dir stage0
1005+
make_dir $h/stage0/lib
1006+
1007+
# target bin dir stage0
1008+
make_dir $h/stage0/lib/rustlib/$t/bin
1009+
1010+
# target lib dir stage0
1011+
make_dir $h/stage0/lib/rustlib/$t/lib
1012+
9921013
for i in 0 1 2 3
9931014
do
9941015
# host bin dir

branches/snap-stage3/mk/crates.mk

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#
3838
# DEPS_<crate>
3939
# These lists are the dependencies of the <crate> that is to be built.
40-
# Rust dependencies are listed bare (i.e. std, green) and native
40+
# Rust dependencies are listed bare (i.e. std) and native
4141
# dependencies have a "native:" prefix (i.e. native:hoedown). All deps
4242
# will be built before the crate itself is built.
4343
#
@@ -49,7 +49,7 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := libc std green native flate arena term \
52+
TARGET_CRATES := libc std flate arena term \
5353
serialize sync getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
@@ -66,8 +66,6 @@ DEPS_rustrt := alloc core libc collections native:rustrt_native
6666
DEPS_std := core libc rand alloc collections rustrt sync unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
69-
DEPS_green := std native:context_switch
70-
DEPS_native := std
7169
DEPS_syntax := std term serialize log fmt_macros arena libc
7270
DEPS_rustc_trans := rustc rustc_back rustc_llvm libc
7371
DEPS_rustc := syntax flate arena serialize getopts rbml \
@@ -95,9 +93,9 @@ DEPS_regex := std
9593
DEPS_regex_macros = rustc syntax std regex
9694
DEPS_fmt_macros = std
9795

98-
TOOL_DEPS_compiletest := test getopts native
99-
TOOL_DEPS_rustdoc := rustdoc native
100-
TOOL_DEPS_rustc := rustc_trans native
96+
TOOL_DEPS_compiletest := test getopts
97+
TOOL_DEPS_rustdoc := rustdoc
98+
TOOL_DEPS_rustc := rustc_trans
10199
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
102100
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
103101
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs

branches/snap-stage3/mk/main.mk

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,14 @@ endif
190190
# Target-and-rule "utility variables"
191191
######################################################################
192192

193-
define DEF_X
193+
define DEF_FOR_TARGET
194194
X_$(1) := $(CFG_EXE_SUFFIX_$(1))
195+
ifndef CFG_LLVM_TARGET_$(1)
196+
CFG_LLVM_TARGET_$(1) := $(1)
197+
endif
195198
endef
196199
$(foreach target,$(CFG_TARGET), \
197-
$(eval $(call DEF_X,$(target))))
200+
$(eval $(call DEF_FOR_TARGET,$(target))))
198201

199202
# "Source" files we generate in builddir along the way.
200203
GENERATED :=
@@ -332,7 +335,15 @@ define SREQ
332335
# Destinations of artifacts for the host compiler
333336
HROOT$(1)_H_$(3) = $(3)/stage$(1)
334337
HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin
338+
ifeq ($$(CFG_WINDOWSY_$(3)),1)
339+
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
340+
else
341+
ifeq ($(1),0)
342+
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib
343+
else
335344
HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)
345+
endif
346+
endif
336347

337348
# Destinations of artifacts for target architectures
338349
TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2)

branches/snap-stage3/mk/platform.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ $(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS, \
113113

114114
CFG_RLIB_GLOB=lib$(1)-*.rlib
115115

116-
include $(wildcard $(CFG_SRC_DIR)mk/cfg/*)
116+
include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk)
117117

118118
# The -Qunused-arguments sidesteps spurious warnings from clang
119119
define FILTER_FLAGS

branches/snap-stage3/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \
7575
@mkdir -p $$(@D)
7676
@$$(call E, compile: $$@)
7777
$$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
78-
-filetype=obj -mtriple=$(1) -relocation-model=pic -o $$@ $$<
78+
-filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) -relocation-model=pic -o $$@ $$<
7979

8080
$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
8181
@mkdir -p $$(@D)

branches/snap-stage3/mk/stage0.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ifdef CFG_ENABLE_LOCAL_RUST
2222
else
2323
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
2424
endif
25-
$(Q)touch $@
25+
$(Q)if [ -e "$@" ]; then touch "$@"; else echo "ERROR: snapshot $@ not found"; exit 1; fi
2626

2727
# For other targets, let the host build the target:
2828

branches/snap-stage3/mk/target.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
116116
$$(foreach dep,$$(TOOL_DEPS_$(4)), \
117117
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \
118118
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
119-
| $$(TBIN$(1)_T_$(4)_H_$(3))/
119+
| $$(TBIN$(1)_T_$(2)_H_$(3))/
120120
@$$(call E, rustc: $$@)
121121
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4)
122122

branches/snap-stage3/src/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Source layout:
99
| `libcore/` | The Rust core library |
1010
| `libdebug/` | Debugging utilities |
1111
| `libstd/` | The standard library (imported and linked by default) |
12-
| `libgreen/` | The M:N runtime library |
13-
| `libnative/` | The 1:1 runtime library |
1412
| `libsyntax/` | The Rust parser and pretty-printer |
1513
| `libtest/` | Rust's test-runner code |
1614
| ------------------- | --------------------------------------------------------- |

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

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

11+
use std::ascii::AsciiExt;
1112
use std::io::{BufferedReader, File};
1213
use regex::Regex;
1314

@@ -31,7 +32,7 @@ pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> {
3132
fn parse_expected(line_num: uint, line: &str, re: &Regex) -> Option<ExpectedError> {
3233
re.captures(line).and_then(|caps| {
3334
let adjusts = caps.name("adjusts").len();
34-
let kind = caps.name("kind").to_ascii().to_lowercase().into_string();
35+
let kind = caps.name("kind").to_ascii_lower();
3536
let msg = caps.name("msg").trim().to_string();
3637

3738
debug!("line={} kind={} msg={}", line_num, kind, msg);

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +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-
#[cfg(not(stage0))]
10+
1111
use self::TargetLocation::*;
1212

1313
use common::Config;
@@ -990,7 +990,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
990990
let i = s.chars();
991991
let c : Vec<char> = i.map( |c| {
992992
if c.is_ascii() {
993-
c.to_ascii().to_lowercase().to_char()
993+
c.to_ascii().to_lowercase().as_char()
994994
} else {
995995
c
996996
}
@@ -1161,7 +1161,7 @@ fn compile_test_(config: &Config, props: &TestProps,
11611161
let args = make_compile_args(config,
11621162
props,
11631163
link_args,
1164-
|a, b| ThisFile(make_exe_name(a, b)), testfile);
1164+
|a, b| TargetLocation::ThisFile(make_exe_name(a, b)), testfile);
11651165
compose_and_run_compiler(config, props, testfile, args, None)
11661166
}
11671167

@@ -1219,7 +1219,7 @@ fn compose_and_run_compiler(
12191219
crate_type,
12201220
|a,b| {
12211221
let f = make_lib_name(a, b, testfile);
1222-
ThisDirectory(f.dir_path())
1222+
TargetLocation::ThisDirectory(f.dir_path())
12231223
},
12241224
&abs_ab);
12251225
let auxres = compose_and_run(config,
@@ -1296,11 +1296,11 @@ fn make_compile_args(config: &Config,
12961296
args.push("prefer-dynamic".to_string());
12971297
}
12981298
let path = match xform_file {
1299-
ThisFile(path) => {
1299+
TargetLocation::ThisFile(path) => {
13001300
args.push("-o".to_string());
13011301
path
13021302
}
1303-
ThisDirectory(path) => {
1303+
TargetLocation::ThisDirectory(path) => {
13041304
args.push("--out-dir".to_string());
13051305
path
13061306
}
@@ -1566,7 +1566,7 @@ fn _arm_exec_compiled_test(config: &Config,
15661566

15671567
let mut exitcode: int = 0;
15681568
for c in exitcode_out.as_slice().chars() {
1569-
if !c.is_digit() { break; }
1569+
if !c.is_numeric() { break; }
15701570
exitcode = exitcode * 10 + match c {
15711571
'0' ... '9' => c as int - ('0' as int),
15721572
_ => 101,
@@ -1672,7 +1672,8 @@ fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
16721672
let args = make_compile_args(config,
16731673
props,
16741674
link_args,
1675-
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
1675+
|a, b| TargetLocation::ThisDirectory(
1676+
output_base_name(a, b).dir_path()),
16761677
testfile);
16771678
compose_and_run_compiler(config, props, testfile, args, None)
16781679
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3144,8 +3144,8 @@ pub fn add_three_times_four(x: int) -> int {
31443144
}
31453145
```
31463146

3147-
We're calling this file `lib.rs` because it has the same name as our project,
3148-
and so it's named this, by convention.
3147+
We're calling this file `lib.rs`, because Cargo uses that filename as the crate
3148+
root by convention.
31493149

31503150
We'll then need to use this crate in our `src/main.rs`:
31513151

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,14 +1059,14 @@ An example of what will and will not work for `use` items:
10591059

10601060
```
10611061
# #![allow(unused_imports)]
1062-
use foo::native::start; // good: foo is at the root of the crate
1062+
use foo::core::iter; // good: foo is at the root of the crate
10631063
use foo::baz::foobaz; // good: foo is at the root of the crate
10641064
10651065
mod foo {
1066-
extern crate native;
1066+
extern crate core;
10671067
1068-
use foo::native::start; // good: foo is at crate root
1069-
// use native::start; // bad: native is not at the crate root
1068+
use foo::core::iter; // good: foo is at crate root
1069+
// use core::iter; // bad: native is not at the crate root
10701070
use self::baz::foobaz; // good: self refers to module 'foo'
10711071
use foo::bar::foobar; // good: foo is at crate root
10721072
@@ -1334,7 +1334,12 @@ specific type; the type-specified aspects of a value include:
13341334
For example, the type `(u8, u8)` defines the set of immutable values that are
13351335
composite pairs, each containing two unsigned 8-bit integers accessed by
13361336
pattern-matching and laid out in memory with the `x` component preceding the
1337-
`y` component.
1337+
`y` component:
1338+
1339+
```
1340+
type Point = (u8, u8);
1341+
let p: Point = (41, 68);
1342+
```
13381343

13391344
### Structures
13401345

branches/snap-stage3/src/etc/emacs/rust-mode.el

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
(modify-syntax-entry ?\" "\"" table)
3232
(modify-syntax-entry ?\\ "\\" table)
3333

34-
;; _ is a word-char
35-
(modify-syntax-entry ?_ "w" table)
36-
3734
;; Comments
3835
(modify-syntax-entry ?/ ". 124b" table)
3936
(modify-syntax-entry ?* ". 23" table)
@@ -397,7 +394,7 @@ This is written mainly to be used as `beginning-of-defun-function' for Rust.
397394
Don't move to the beginning of the line. `beginning-of-defun',
398395
which calls this, does that afterwards."
399396
(interactive "p")
400-
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\b")
397+
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\_>")
401398
nil 'move (or arg 1)))
402399

403400
(defun rust-end-of-defun ()

branches/snap-stage3/src/etc/install.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,16 @@ fi
301301
flag uninstall "only uninstall from the installation prefix"
302302
opt verify 1 "verify that the installed binaries run correctly"
303303
valopt prefix "/usr/local" "set installation prefix"
304-
# NB This isn't quite the same definition as in `configure`.
305-
# just using 'lib' instead of CFG_LIBDIR_RELATIVE
304+
# NB This is exactly the same definition as in `configure`.
306305
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries"
306+
case "$CFG_LIBDIR" in
307+
"$CFG_PREFIX"/*) CAT_INC=2;;
308+
"$CFG_PREFIX"*) CAT_INC=1;;
309+
*)
310+
err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
311+
esac
312+
CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
313+
307314
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
308315

309316
if [ $HELP -eq 1 ]
@@ -428,9 +435,9 @@ while read p; do
428435
# Decide the destination of the file
429436
FILE_INSTALL_PATH="${CFG_PREFIX}/$p"
430437

431-
if echo "$p" | grep "^lib/" > /dev/null
438+
if echo "$p" | grep "^${CFG_LIBDIR_RELATIVE}/" > /dev/null
432439
then
433-
pp=`echo $p | sed 's/^lib\///'`
440+
pp=`echo $p | sed "s%^${CFG_LIBDIR_RELATIVE}/%%"`
434441
FILE_INSTALL_PATH="${CFG_LIBDIR}/$pp"
435442
fi
436443

0 commit comments

Comments
 (0)