Skip to content

Commit bd534fe

Browse files
committed
---
yaml --- r: 274975 b: refs/heads/stable c: 263de3d h: refs/heads/master i: 274973: 3eacd8b 274971: 2e04473 274967: 5c9cf29 274959: da02541 274943: 824be1d
1 parent 83ebb3f commit bd534fe

Some content is hidden

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

78 files changed

+485
-924
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 0bf6394801c9699d1e699f99d3ac62a019d4b1ad
32+
refs/heads/stable: 263de3d0e7aa0930d4155e997985a8cff7253f77
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Read ["Installing Rust"] from [The Book].
1717
1. Make sure you have installed the dependencies:
1818

1919
* `g++` 4.7 or `clang++` 3.x
20-
* `python` 2.7 (but not 3.x)
20+
* `python` 2.7 or later (but not 3.x)
2121
* GNU `make` 3.81 or later
2222
* `curl`
2323
* `git`

branches/stable/configure

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -729,12 +729,12 @@ step_msg "looking for build programs"
729729

730730
probe_need CFG_CURLORWGET curl wget
731731
if [ -z "$CFG_PYTHON_PROVIDED" ]; then
732-
probe_need CFG_PYTHON python2.7 python2 python
732+
probe_need CFG_PYTHON python2.7 python2.6 python2 python
733733
fi
734734

735735
python_version=$($CFG_PYTHON -V 2>&1)
736-
if [ $(echo $python_version | grep -c '^Python 2\.7') -ne 1 ]; then
737-
err "Found $python_version, but Python 2.7 is required"
736+
if [ $(echo $python_version | grep -c '^Python 2\.[4567]') -ne 1 ]; then
737+
err "Found $python_version, but LLVM requires Python 2.4-2.7"
738738
fi
739739

740740
# If we have no git directory then we are probably a tarball distribution

branches/stable/mk/crates.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
6060
rustc_plugin rustc_metadata rustc_passes
6161
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros
62-
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
62+
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
6363

6464
DEPS_core :=
6565
DEPS_alloc := core libc alloc_system
@@ -120,12 +120,12 @@ TOOL_DEPS_compiletest := test getopts
120120
TOOL_DEPS_rustdoc := rustdoc
121121
TOOL_DEPS_rustc := rustc_driver
122122
TOOL_DEPS_rustbook := std rustdoc
123-
TOOL_DEPS_error_index_generator := rustdoc syntax serialize
123+
TOOL_DEPS_error-index-generator := rustdoc syntax serialize
124124
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
125125
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
126126
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
127127
TOOL_SOURCE_rustbook := $(S)src/rustbook/main.rs
128-
TOOL_SOURCE_error_index_generator := $(S)src/error_index_generator/main.rs
128+
TOOL_SOURCE_error-index-generator := $(S)src/error-index-generator/main.rs
129129

130130
ONLY_RLIB_core := 1
131131
ONLY_RLIB_libc := 1

branches/stable/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ PKG_FILES := \
5252
doc \
5353
driver \
5454
etc \
55-
error_index_generator \
55+
error-index-generator \
5656
$(foreach crate,$(CRATES),lib$(crate)) \
5757
libcollectionstest \
5858
libcoretest \

branches/stable/mk/docs.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ RUSTBOOK_EXE = $(HBIN2_H_$(CFG_BUILD))/rustbook$(X_$(CFG_BUILD))
5959
# ./configure
6060
RUSTBOOK = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(RUSTBOOK_EXE)
6161

62-
# The error_index_generator executable...
63-
ERR_IDX_GEN_EXE = $(HBIN2_H_$(CFG_BUILD))/error_index_generator$(X_$(CFG_BUILD))
62+
# The error-index-generator executable...
63+
ERR_IDX_GEN_EXE = $(HBIN2_H_$(CFG_BUILD))/error-index-generator$(X_$(CFG_BUILD))
6464
ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
6565
ERR_IDX_GEN_MD = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE) markdown
6666

@@ -221,9 +221,9 @@ error-index: doc/error-index.html
221221
# Metadata used to generate the index is created as a side effect of
222222
# the build so this depends on every crate being up to date.
223223
doc/error-index.html: $(ERR_IDX_GEN_EXE) $(CSREQ$(2)_T_$(CFG_BUILD)_H_$(CFG_BUILD)) | doc/
224-
$(Q)$(call E, error_index_generator: $@)
224+
$(Q)$(call E, error-index-generator: $@)
225225
$(Q)$(ERR_IDX_GEN)
226226

227227
doc/error-index.md: $(ERR_IDX_GEN_EXE) $(CSREQ$(2)_T_$(CFG_BUILD)_H_$(CFG_BUILD)) | doc/
228-
$(Q)$(call E, error_index_generator: $@)
228+
$(Q)$(call E, error-index-generator: $@)
229229
$(Q)$(ERR_IDX_GEN_MD)

branches/stable/mk/prepare.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ define PREPARE_MAN
8282

8383
endef
8484

85-
PREPARE_TOOLS = $(filter-out compiletest rustbook error_index_generator, $(TOOLS))
85+
PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS))
8686

8787

8888
# $(1) is tool

branches/stable/mk/rt.mk

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,7 @@ ifeq ($$(CFG_WINDOWSY_$(1)),1)
148148
else ifeq ($(OSTYPE_$(1)), apple-ios)
149149
JEMALLOC_ARGS_$(1) := --disable-tls
150150
else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
151-
# We force android to have prefixed symbols because apparently replacement of
152-
# the libc allocator doesn't quite work. When this was tested (unprefixed
153-
# symbols), it was found that the `realpath` function in libc would allocate
154-
# with libc malloc (not jemalloc malloc), and then the standard library would
155-
# free with jemalloc free, causing a segfault.
156-
#
157-
# If the test suite passes, however, without symbol prefixes then we should be
158-
# good to go!
159-
JEMALLOC_ARGS_$(1) := --disable-tls --with-jemalloc-prefix=je_
151+
JEMALLOC_ARGS_$(1) := --disable-tls
160152
endif
161153

162154
ifdef CFG_ENABLE_DEBUG_JEMALLOC
@@ -194,7 +186,7 @@ JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1
194186
$$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
195187
@$$(call E, make: jemalloc)
196188
cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
197-
$$(JEMALLOC_ARGS_$(1)) $(CFG_JEMALLOC_FLAGS) \
189+
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ $(CFG_JEMALLOC_FLAGS) \
198190
--build=$$(CFG_GNU_TRIPLE_$(CFG_BUILD)) --host=$$(CFG_GNU_TRIPLE_$(1)) \
199191
CC="$$(CC_$(1)) $$(CFG_JEMALLOC_CFLAGS_$(1))" \
200192
AR="$$(AR_$(1))" \

branches/stable/mk/tests.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,8 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10721072
$(3) \
10731073
"$$(LLVM_LIBDIR_RUSTFLAGS_$(3))" \
10741074
"$$(LLVM_ALL_COMPONENTS_$(3))" \
1075-
"$$(LLVM_CXXFLAGS_$(3))"
1075+
"$$(LLVM_CXXFLAGS_$(3))" \
1076+
'$$(CXX_$(3))'
10761077
@touch -r $$@.start_time $$@ && rm $$@.start_time
10771078
else
10781079
# FIXME #11094 - The above rule doesn't work right for multiple targets

branches/stable/src/doc/book/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You get this error:
6868

6969
```text
7070
expected one of `!`, `:`, or `@`, found `)`
71-
fn print_sum(x, y) {
71+
fn print_number(x, y) {
7272
```
7373

7474
This is a deliberate design decision. While full-program inference is possible,

branches/stable/src/doc/book/strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The second, with a `\`, trims the spaces and the newline:
3939

4040
```rust
4141
let s = "foo\
42-
bar";
42+
bar";
4343

4444
assert_eq!("foobar", s);
4545
```

branches/stable/src/doc/book/vectors.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,15 @@ let v = vec![1, 2, 3, 4, 5]; // v: Vec<i32>
1111
```
1212

1313
(Notice that unlike the `println!` macro we’ve used in the past, we use square
14-
brackets `[]` with `vec!` macro. Rust allows you to use either in either
15-
situation, this is just convention.)
14+
brackets `[]` with `vec!` macro. Rust allows you to use either in either situation,
15+
this is just convention.)
1616

1717
There’s an alternate form of `vec!` for repeating an initial value:
1818

1919
```rust
2020
let v = vec![0; 10]; // ten zeroes
2121
```
2222

23-
Vectors store their contents as contiguous arrays of `T` on the heap. This means
24-
that they must be able to know the size of `T` at compile time (that is, how
25-
many bytes are needed to store a `T`?). The size of some things can't be known
26-
at compile time. For these you'll have to store a pointer to that thing:
27-
thankfully, the [`Box`][box] type works perfectly for this.
28-
2923
## Accessing elements
3024

3125
To get the value at a particular index in the vector, we use `[]`s:
@@ -119,7 +113,6 @@ Vectors have many more useful methods, which you can read about in [their
119113
API documentation][vec].
120114

121115
[vec]: ../std/vec/index.html
122-
[box]: ../std/boxed/index.html
123116
[generic]: generics.html
124117
[panic]: concurrency.html#panics
125118
[get]: http://doc.rust-lang.org/std/vec/struct.Vec.html#method.get

branches/stable/src/etc/maketest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def convert_path_spec(name, value):
5757
putenv('RUSTFLAGS', sys.argv[15])
5858
putenv('LLVM_COMPONENTS', sys.argv[16])
5959
putenv('LLVM_CXXFLAGS', sys.argv[17])
60+
putenv('CXX', sys.argv[18])
6061
putenv('PYTHON', sys.executable)
6162
os.putenv('TARGET', target_triple)
6263

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#!/usr/bin/env python2
2+
3+
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
4+
# file at the top-level directory of this distribution and at
5+
# http://rust-lang.org/COPYRIGHT.
6+
#
7+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
# option. This file may not be copied, modified, or distributed
11+
# except according to those terms.
12+
13+
from __future__ import absolute_import, division, print_function
14+
import argparse
15+
import datetime
16+
import os.path as path
17+
18+
19+
def print_tests(tests):
20+
print('\n'.join([test_tostr(t) for t in tests]))
21+
22+
23+
def read_tests(f):
24+
basename, _ = path.splitext(path.basename(f))
25+
tests = []
26+
for lineno, line in enumerate(open(f), 1):
27+
fields = filter(None, map(str.strip, line.split('\t')))
28+
if not (4 <= len(fields) <= 5) \
29+
or 'E' not in fields[0] or fields[0][0] == '#':
30+
continue
31+
32+
opts, pat, text, sgroups = fields[0:4]
33+
groups = [] # groups as integer ranges
34+
if sgroups == 'NOMATCH':
35+
groups = [None]
36+
elif ',' in sgroups:
37+
noparen = map(lambda s: s.strip('()'), sgroups.split(')('))
38+
for g in noparen:
39+
s, e = map(str.strip, g.split(','))
40+
if s == '?' and e == '?':
41+
groups.append(None)
42+
else:
43+
groups.append((int(s), int(e)))
44+
else:
45+
# This skips tests that should result in an error.
46+
# There aren't many, so I think we can just capture those
47+
# manually. Possibly fix this in future.
48+
continue
49+
50+
if pat == 'SAME':
51+
pat = tests[-1][1]
52+
if '$' in opts:
53+
pat = pat.decode('string_escape')
54+
text = text.decode('string_escape')
55+
if 'i' in opts:
56+
pat = '(?i)%s' % pat
57+
58+
name = '%s_%d' % (basename, lineno)
59+
tests.append((name, pat, text, groups))
60+
return tests
61+
62+
63+
def test_tostr(t):
64+
lineno, pat, text, groups = t
65+
options = map(group_tostr, groups)
66+
return 'mat!{match_%s, r"%s", r"%s", %s}' \
67+
% (lineno, pat, '' if text == "NULL" else text, ', '.join(options))
68+
69+
70+
def group_tostr(g):
71+
if g is None:
72+
return 'None'
73+
else:
74+
return 'Some((%d, %d))' % (g[0], g[1])
75+
76+
77+
if __name__ == '__main__':
78+
parser = argparse.ArgumentParser(
79+
description='Generate match tests from an AT&T POSIX test file.')
80+
aa = parser.add_argument
81+
aa('files', nargs='+',
82+
help='A list of dat AT&T POSIX test files. See src/libregexp/testdata')
83+
args = parser.parse_args()
84+
85+
tests = []
86+
for f in args.files:
87+
tests += read_tests(f)
88+
89+
tpl = '''// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
90+
// file at the top-level directory of this distribution and at
91+
// http://rust-lang.org/COPYRIGHT.
92+
//
93+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
94+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
95+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
96+
// option. This file may not be copied, modified, or distributed
97+
// except according to those terms.
98+
99+
// ignore-tidy-linelength
100+
101+
// DO NOT EDIT. Automatically generated by 'src/etc/regexp-match-tests'
102+
// on {date}.
103+
'''
104+
print(tpl.format(date=str(datetime.datetime.now())))
105+
106+
for f in args.files:
107+
print('// Tests from %s' % path.basename(f))
108+
print_tests(read_tests(f))
109+
print('')

branches/stable/src/etc/tidy.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@
2424

2525
interesting_files = ['.rs', '.py', '.js', '.sh', '.c', '.h']
2626
uninteresting_files = ['miniz.c', 'jquery', 'rust_android_dummy']
27-
stable_whitelist = {
28-
'src/bootstrap',
29-
'src/build_helper',
30-
'src/libcollectionstest',
31-
'src/libcore',
32-
'src/libstd',
33-
'src/rustc/std_shim',
34-
'src/test'
35-
}
3627

3728

3829
def report_error_name_no(name, no, s):
@@ -102,7 +93,6 @@ def interesting_file(f):
10293
file_counts = {ext: 0 for ext in interesting_files}
10394

10495
all_paths = set()
105-
needs_unstable_attr = set()
10696

10797
try:
10898
for (dirpath, dirnames, filenames) in os.walk(src_dir):
@@ -159,9 +149,6 @@ def interesting_file(f):
159149
else:
160150
if "SNAP " in line:
161151
report_warn("unmatched SNAP line: " + line)
162-
search = re.search(r'^#!\[unstable', line)
163-
if search:
164-
needs_unstable_attr.discard(filename)
165152

166153
if cr_flag in line:
167154
check_cr = False
@@ -194,9 +181,6 @@ def interesting_file(f):
194181
check_cr = True
195182
check_tab = True
196183
check_linelength = True
197-
if all(f not in filename for f in stable_whitelist) and \
198-
re.search(r'src/.*/lib\.rs', filename):
199-
needs_unstable_attr.add(filename)
200184

201185
# Put a reasonable limit on the amount of header data we use for
202186
# the licenseck
@@ -211,8 +195,6 @@ def interesting_file(f):
211195
update_counts(current_name)
212196
assert len(current_contents) > 0
213197
do_license_check(current_name, current_contents)
214-
for f in needs_unstable_attr:
215-
report_error_name_no(f, 1, "requires unstable attribute")
216198

217199
except UnicodeDecodeError as e:
218200
report_err("UTF-8 decoding error " + str(e))

branches/stable/src/liballoc_jemalloc/build.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn main() {
5050
.env("AR", &ar)
5151
.env("RANLIB", format!("{} s", ar.display()));
5252

53-
if target.contains("windows") {
53+
if target.contains("windows-gnu") {
5454
// A bit of history here, this used to be --enable-lazy-lock added in
5555
// #14006 which was filed with jemalloc in jemalloc/jemalloc#83 which
5656
// was also reported to MinGW:
@@ -72,19 +72,7 @@ fn main() {
7272
// locking, but requires passing an option due to a historical
7373
// default with jemalloc.
7474
cmd.arg("--disable-lazy-lock");
75-
} else if target.contains("ios") {
76-
cmd.arg("--disable-tls");
77-
} else if target.contains("android") {
78-
// We force android to have prefixed symbols because apparently
79-
// replacement of the libc allocator doesn't quite work. When this was
80-
// tested (unprefixed symbols), it was found that the `realpath`
81-
// function in libc would allocate with libc malloc (not jemalloc
82-
// malloc), and then the standard library would free with jemalloc free,
83-
// causing a segfault.
84-
//
85-
// If the test suite passes, however, without symbol prefixes then we
86-
// should be good to go!
87-
cmd.arg("--with-jemalloc-prefix=je_");
75+
} else if target.contains("ios") || target.contains("android") {
8876
cmd.arg("--disable-tls");
8977
}
9078

@@ -94,6 +82,7 @@ fn main() {
9482

9583
// Turn off broken quarantine (see jemalloc/jemalloc#161)
9684
cmd.arg("--disable-fill");
85+
cmd.arg("--with-jemalloc-prefix=je_");
9786
cmd.arg(format!("--host={}", build_helper::gnu_target(&target)));
9887
cmd.arg(format!("--build={}", build_helper::gnu_target(&host)));
9988

0 commit comments

Comments
 (0)