Skip to content

Commit e886c08

Browse files
committed
---
yaml --- r: 189274 b: refs/heads/master c: 31af637 h: refs/heads/master v: v3
1 parent 832e4ba commit e886c08

File tree

516 files changed

+4045
-2510
lines changed

Some content is hidden

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

516 files changed

+4045
-2510
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f0897aa17f98ff41f1eb6a3af40d84123d3d89d5
2+
refs/heads/master: 31af63748bbe62adab6bed6008deca67911bd0d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 270a677d4d698916f5ad103f0afc3c070b8dbeb4
55
refs/heads/try: 649d35e4d830b27806705dc5352c86ab6d6fd1a1

trunk/configure

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,15 +697,17 @@ probe CFG_ADB adb
697697

698698
if [ ! -z "$CFG_PANDOC" ]
699699
then
700-
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc\(.exe\)\? ' |
701-
# extract the first 2 version fields, ignore everything else
702-
sed 's/pandoc\(.exe\)\? \([0-9]*\)\.\([0-9]*\).*/\2 \3/')
700+
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' |
701+
# Extract "MAJOR MINOR" from Pandoc's version number
702+
sed -E 's/pandoc(.exe)? ([0-9]+)\.([0-9]+).*/\2 \3/')
703703

704704
MIN_PV_MAJOR="1"
705705
MIN_PV_MINOR="9"
706+
706707
# these patterns are shell globs, *not* regexps
707708
PV_MAJOR=${PV_MAJOR_MINOR% *}
708709
PV_MINOR=${PV_MAJOR_MINOR#* }
710+
709711
if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
710712
then
711713
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"

trunk/mk/main.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.0.0
1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=.2
21+
CFG_PRERELEASE_VERSION=
2222

2323
CFG_FILENAME_EXTRA=4e7c5e5c
2424

@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)

trunk/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
590590

591591
# The tests select when to use debug configuration on their own;
592592
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
593-
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
593+
CTEST_RUSTC_FLAGS := $$(subst -C debug-assertions,,$$(CFG_RUSTC_FLAGS))
594594

595595
# The tests cannot be optimized while the rest of the compiler is optimized, so
596596
# filter out the optimization (if any) from rustc and then figure out if we need

trunk/src/compiletest/compiletest.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
#![feature(unicode)]
2323
#![feature(core)]
2424
#![feature(path)]
25-
#![feature(os)]
2625
#![feature(io)]
27-
#![feature(fs)]
2826
#![feature(net)]
27+
#![feature(path_ext)]
2928

3029
#![deny(warnings)]
3130

trunk/src/compiletest/runtest.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use procsrv;
2020
use util::logv;
2121

2222
use std::env;
23-
use std::ffi::OsStr;
2423
use std::fmt;
2524
use std::fs::{self, File};
2625
use std::io::BufReader;
@@ -1323,7 +1322,7 @@ fn make_exe_name(config: &Config, testfile: &Path) -> PathBuf {
13231322
let mut f = output_base_name(config, testfile);
13241323
if !env::consts::EXE_SUFFIX.is_empty() {
13251324
let mut fname = f.file_name().unwrap().to_os_string();
1326-
fname.push_os_str(OsStr::from_str(env::consts::EXE_SUFFIX));
1325+
fname.push(env::consts::EXE_SUFFIX);
13271326
f.set_file_name(&fname);
13281327
}
13291328
f
@@ -1433,7 +1432,7 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> PathBuf {
14331432
fn aux_output_dir_name(config: &Config, testfile: &Path) -> PathBuf {
14341433
let f = output_base_name(config, testfile);
14351434
let mut fname = f.file_name().unwrap().to_os_string();
1436-
fname.push_os_str(OsStr::from_str("libaux"));
1435+
fname.push("libaux");
14371436
f.with_file_name(&fname)
14381437
}
14391438

@@ -1647,8 +1646,8 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> PathBuf {
16471646
p.to_path_buf()
16481647
} else {
16491648
let mut stem = p.file_stem().unwrap().to_os_string();
1650-
stem.push_os_str(OsStr::from_str("-"));
1651-
stem.push_os_str(OsStr::from_str(suffix));
1649+
stem.push("-");
1650+
stem.push(suffix);
16521651
p.with_file_name(&stem)
16531652
}
16541653
}

trunk/src/doc/guide-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
% The (old) Rust Threads and Communication Guide
22

33
This content has moved into
4-
[the Rust Programming Language book](book/tasks.html).
4+
[the Rust Programming Language book](book/concurrency.html).

trunk/src/doc/intro.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ fn main() {
428428
429429
let guards: Vec<_> = (0..3).map(|i| {
430430
Thread::scoped(move || {
431-
for j in 0..3 { numbers[j] += 1 }
431+
numbers[i] += 1;
432+
println!("numbers[{}] is {}", i, numbers[i]);
432433
});
433434
}).collect();
434435
}
@@ -437,10 +438,12 @@ fn main() {
437438
It gives us this error:
438439
439440
```text
440-
7:29: 9:10 error: cannot move out of captured outer variable in an `FnMut` closure
441-
7 Thread::scoped(move || {
442-
8 for j in 0..3 { numbers[j] += 1 }
443-
9 });
441+
7:25: 10:6 error: cannot move out of captured outer variable in an `FnMut` closure
442+
7 Thread::scoped(move || {
443+
8 numbers[i] += 1;
444+
9 println!("numbers[{}] is {}", i, numbers[i]);
445+
10 });
446+
error: aborting due to previous error
444447
```
445448
446449
It mentions that "captured outer variable in an `FnMut` closure".

trunk/src/doc/reference.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,6 +2555,14 @@ The currently implemented features of the reference compiler are:
25552555
types, e.g. as the return type of a public function.
25562556
This capability may be removed in the future.
25572557

2558+
* `allow_internal_unstable` - Allows `macro_rules!` macros to be tagged with the
2559+
`#[allow_internal_unstable]` attribute, designed
2560+
to allow `std` macros to call
2561+
`#[unstable]`/feature-gated functionality
2562+
internally without imposing on callers
2563+
(i.e. making them behave like function calls in
2564+
terms of encapsulation).
2565+
25582566
If a feature is promoted to a language feature, then all existing programs will
25592567
start to receive compilation warnings about #[feature] directives which enabled
25602568
the new feature (because the directive is no longer necessary). However, if a

trunk/src/doc/trpl/arrays-vectors-and-slices.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ let v = vec![1, 2, 3]; // v: Vec<i32>
6060
brackets `[]` with `vec!`. Rust allows you to use either in either situation,
6161
this is just convention.)
6262

63+
There's an alternate form of `vec!` for repeating an initial value:
64+
65+
```
66+
let v = vec![0; 10]; // ten zeroes
67+
```
68+
6369
You can get the length of, iterate over, and subscript vectors just like
6470
arrays. In addition, (mutable) vectors can grow automatically:
6571

trunk/src/doc/trpl/compound-data-types.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ strings, but next, let's talk about some more complicated ways of storing data.
66

77
## Tuples
88

9-
The first compound data type we're going to talk about are called *tuples*.
10-
Tuples are an ordered list of a fixed size. Like this:
9+
The first compound data type we're going to talk about is called the *tuple*.
10+
A tuple is an ordered list of fixed size. Like this:
1111

1212
```rust
1313
let x = (1, "hello");
@@ -229,7 +229,7 @@ enum Character {
229229
```
230230

231231
An `enum` variant can be defined as most normal types. Below are some example
232-
types have been listed which also would be allowed in an `enum`.
232+
types which also would be allowed in an `enum`.
233233

234234
```rust
235235
struct Empty;

trunk/src/etc/tidy.py

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import subprocess
1414
import re
1515
import os
16-
from licenseck import *
16+
from licenseck import check_license
1717
import snapshot
1818

1919
err = 0
@@ -22,13 +22,8 @@
2222
tab_flag = "ignore-tidy-tab"
2323
linelength_flag = "ignore-tidy-linelength"
2424

25-
# Be careful to support Python 2.4, 2.6, and 3.x here!
26-
config_proc = subprocess.Popen(["git", "config", "core.autocrlf"],
27-
stdout=subprocess.PIPE)
28-
result = config_proc.communicate()[0]
29-
30-
true = "true".encode('utf8')
31-
autocrlf = result.strip() == true if result is not None else False
25+
interesting_files = ['.rs', '.py', '.js', '.sh', '.c', '.h']
26+
uninteresting_files = ['miniz.c', 'jquery', 'rust_android_dummy']
3227

3328

3429
def report_error_name_no(name, no, s):
@@ -51,6 +46,34 @@ def do_license_check(name, contents):
5146
if not check_license(name, contents):
5247
report_error_name_no(name, 1, "incorrect license")
5348

49+
50+
def update_counts(current_name):
51+
global file_counts
52+
global count_other_linted_files
53+
54+
_, ext = os.path.splitext(current_name)
55+
56+
if ext in interesting_files:
57+
file_counts[ext] += 1
58+
else:
59+
count_other_linted_files += 1
60+
61+
62+
def interesting_file(f):
63+
if any(x in f for x in uninteresting_files):
64+
return False
65+
66+
return any(os.path.splitext(f)[1] == ext for ext in interesting_files)
67+
68+
69+
# Be careful to support Python 2.4, 2.6, and 3.x here!
70+
config_proc = subprocess.Popen(["git", "config", "core.autocrlf"],
71+
stdout=subprocess.PIPE)
72+
result = config_proc.communicate()[0]
73+
74+
true = "true".encode('utf8')
75+
autocrlf = result.strip() == true if result is not None else False
76+
5477
current_name = ""
5578
current_contents = ""
5679
check_tab = True
@@ -63,28 +86,16 @@ def do_license_check(name, contents):
6386

6487
src_dir = sys.argv[1]
6588

66-
try:
67-
count_lines = 0
68-
count_non_blank_lines = 0
89+
count_lines = 0
90+
count_non_blank_lines = 0
91+
count_other_linted_files = 0
6992

70-
interesting_files = ['.rs', '.py', '.js', '.sh', '.c', '.h']
93+
file_counts = {ext: 0 for ext in interesting_files}
7194

72-
file_counts = {ext: 0 for ext in interesting_files}
73-
file_counts['other'] = 0
74-
75-
def update_counts(current_name):
76-
global file_counts
77-
_, ext = os.path.splitext(current_name)
78-
79-
if ext in file_counts:
80-
file_counts[ext] += 1
81-
else:
82-
file_counts['other'] += 1
83-
84-
all_paths = set()
95+
all_paths = set()
8596

97+
try:
8698
for (dirpath, dirnames, filenames) in os.walk(src_dir):
87-
8899
# Skip some third-party directories
89100
skippable_dirs = {
90101
'src/jemalloc',
@@ -103,14 +114,6 @@ def update_counts(current_name):
103114
if any(d in dirpath for d in skippable_dirs):
104115
continue
105116

106-
def interesting_file(f):
107-
if "miniz.c" in f \
108-
or "jquery" in f \
109-
or "rust_android_dummy" in f:
110-
return False
111-
112-
return any(os.path.splitext(f)[1] == ext for ext in interesting_files)
113-
114117
file_names = [os.path.join(dirpath, f) for f in filenames
115118
if interesting_file(f)
116119
and not f.endswith("_gen.rs")
@@ -196,10 +199,11 @@ def interesting_file(f):
196199
report_err("UTF-8 decoding error " + str(e))
197200

198201
print
199-
for ext in file_counts:
200-
print "* linted " + str(file_counts[ext]) + " " + ext + " files"
201-
print "* total lines of code: " + str(count_lines)
202-
print "* total non-blank lines of code: " + str(count_non_blank_lines)
202+
for ext in sorted(file_counts, key=file_counts.get, reverse=True):
203+
print "* linted {} {} files".format(file_counts[ext], ext)
204+
print "* linted {} other files".format(count_other_linted_files)
205+
print "* total lines of code: {}".format(count_lines)
206+
print "* total non-blank lines of code: {}".format(count_non_blank_lines)
203207
print
204208

205209
sys.exit(err)

trunk/src/etc/unicode.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ def fetch(f):
8484
sys.stderr.write("cannot load %s" % f)
8585
exit(1)
8686

87-
def is_valid_unicode(n):
88-
return 0 <= n <= 0xD7FF or 0xE000 <= n <= 0x10FFFF
87+
def is_surrogate(n):
88+
return 0xD800 <= n <= 0xDFFF
8989

9090
def load_unicode_data(f):
9191
fetch(f)
@@ -96,19 +96,28 @@ def load_unicode_data(f):
9696
canon_decomp = {}
9797
compat_decomp = {}
9898

99+
udict = {};
100+
range_start = -1;
99101
for line in fileinput.input(f):
100-
fields = line.split(";")
101-
if len(fields) != 15:
102+
data = line.split(';');
103+
if len(data) != 15:
102104
continue
103-
[code, name, gencat, combine, bidi,
104-
decomp, deci, digit, num, mirror,
105-
old, iso, upcase, lowcase, titlecase ] = fields
106-
107-
code_org = code
108-
code = int(code, 16)
109-
110-
if not is_valid_unicode(code):
105+
cp = int(data[0], 16);
106+
if is_surrogate(cp):
111107
continue
108+
if range_start >= 0:
109+
for i in xrange(range_start, cp):
110+
udict[i] = data;
111+
range_start = -1;
112+
if data[1].endswith(", First>"):
113+
range_start = cp;
114+
continue;
115+
udict[cp] = data;
116+
117+
for code in udict:
118+
[code_org, name, gencat, combine, bidi,
119+
decomp, deci, digit, num, mirror,
120+
old, iso, upcase, lowcase, titlecase ] = udict[code];
112121

113122
# generate char to char direct common and simple conversions
114123
# uppercase to lowercase

0 commit comments

Comments
 (0)