Skip to content

Commit 5660dad

Browse files
author
Oliver Schneider
committed
---
yaml --- r: 193522 b: refs/heads/beta c: 18f1e40 h: refs/heads/master v: v3
1 parent 6a3a909 commit 5660dad

File tree

501 files changed

+2471
-3911
lines changed

Some content is hidden

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

501 files changed

+2471
-3911
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 2fcdd824efd7e0adc2743b4190c8934b861478eb
34+
refs/heads/beta: 18f1e40eaaf7ccde1333fbdfc9f15c4cf462a2a4
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/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 -C debug-assertions,,$$(CFG_RUSTC_FLAGS))
593+
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(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

branches/beta/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#![feature(path)]
2525
#![feature(os)]
2626
#![feature(io)]
27+
#![feature(fs)]
2728
#![feature(net)]
28-
#![feature(path_ext)]
2929

3030
#![deny(warnings)]
3131

branches/beta/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/concurrency.html).
4+
[the Rust Programming Language book](book/tasks.html).

branches/beta/src/doc/intro.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,7 @@ fn main() {
428428
429429
let guards: Vec<_> = (0..3).map(|i| {
430430
Thread::scoped(move || {
431-
numbers[i] += 1;
432-
println!("numbers[{}] is {}", i, numbers[i]);
431+
for j in 0..3 { numbers[j] += 1 }
433432
});
434433
}).collect();
435434
}
@@ -438,12 +437,10 @@ fn main() {
438437
It gives us this error:
439438
440439
```text
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
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 });
447444
```
448445
449446
It mentions that "captured outer variable in an `FnMut` closure".

branches/beta/src/doc/reference.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,14 +2555,6 @@ 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-
25662558
If a feature is promoted to a language feature, then all existing programs will
25672559
start to receive compilation warnings about #[feature] directives which enabled
25682560
the new feature (because the directive is no longer necessary). However, if a

branches/beta/src/doc/trpl/arrays-vectors-and-slices.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ 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-
6963
You can get the length of, iterate over, and subscript vectors just like
7064
arrays. In addition, (mutable) vectors can grow automatically:
7165

branches/beta/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 is called the *tuple*.
10-
A tuple is an ordered list of fixed size. Like this:
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:
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 which also would be allowed in an `enum`.
232+
types have been listed which also would be allowed in an `enum`.
233233

234234
```rust
235235
struct Empty;

branches/beta/src/etc/tidy.py

Lines changed: 38 additions & 42 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 check_license
16+
from licenseck import *
1717
import snapshot
1818

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

25-
interesting_files = ['.rs', '.py', '.js', '.sh', '.c', '.h']
26-
uninteresting_files = ['miniz.c', 'jquery', 'rust_android_dummy']
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
2732

2833

2934
def report_error_name_no(name, no, s):
@@ -46,34 +51,6 @@ def do_license_check(name, contents):
4651
if not check_license(name, contents):
4752
report_error_name_no(name, 1, "incorrect license")
4853

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-
7754
current_name = ""
7855
current_contents = ""
7956
check_tab = True
@@ -86,16 +63,28 @@ def interesting_file(f):
8663

8764
src_dir = sys.argv[1]
8865

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

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

95-
all_paths = set()
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()
9685

97-
try:
9886
for (dirpath, dirnames, filenames) in os.walk(src_dir):
87+
9988
# Skip some third-party directories
10089
skippable_dirs = {
10190
'src/jemalloc',
@@ -114,6 +103,14 @@ def interesting_file(f):
114103
if any(d in dirpath for d in skippable_dirs):
115104
continue
116105

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+
117114
file_names = [os.path.join(dirpath, f) for f in filenames
118115
if interesting_file(f)
119116
and not f.endswith("_gen.rs")
@@ -199,11 +196,10 @@ def interesting_file(f):
199196
report_err("UTF-8 decoding error " + str(e))
200197

201198
print
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)
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)
207203
print
208204

209205
sys.exit(err)

branches/beta/src/etc/unicode.py

Lines changed: 12 additions & 21 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_surrogate(n):
88-
return 0xD800 <= n <= 0xDFFF
87+
def is_valid_unicode(n):
88+
return 0 <= n <= 0xD7FF or 0xE000 <= n <= 0x10FFFF
8989

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

99-
udict = {};
100-
range_start = -1;
10199
for line in fileinput.input(f):
102-
data = line.split(';');
103-
if len(data) != 15:
100+
fields = line.split(";")
101+
if len(fields) != 15:
104102
continue
105-
cp = int(data[0], 16);
106-
if is_surrogate(cp):
107-
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,
103+
[code, name, gencat, combine, bidi,
119104
decomp, deci, digit, num, mirror,
120-
old, iso, upcase, lowcase, titlecase ] = udict[code];
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):
111+
continue
121112

122113
# generate char to char direct common and simple conversions
123114
# uppercase to lowercase

branches/beta/src/grammar/parser-lalr.y

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,6 @@ extern char *yytext;
152152
%precedence MOD_SEP
153153
%precedence RARROW ':'
154154
155-
// In where clauses, "for" should have greater precedence when used as
156-
// a higher ranked constraint than when used as the beginning of a
157-
// for_in_type (which is a ty)
158-
%precedence FORTYPE
159-
%precedence FOR
160-
161155
// Binops & unops, and their precedences
162156
%precedence BOX
163157
%precedence BOXPLACE
@@ -588,14 +582,6 @@ item_impl
588582
{
589583
$$ = mk_node("ItemImplNeg", 7, $1, $3, $5, $7, $8, $10, $11);
590584
}
591-
| maybe_unsafe IMPL generic_params trait_ref FOR DOTDOT '{' '}'
592-
{
593-
$$ = mk_node("ItemImplDefault", 3, $1, $3, $4);
594-
}
595-
| maybe_unsafe IMPL generic_params '!' trait_ref FOR DOTDOT '{' '}'
596-
{
597-
$$ = mk_node("ItemImplDefaultNeg", 3, $1, $3, $4);
598-
}
599585
;
600586

601587
maybe_impl_items
@@ -783,14 +769,10 @@ where_predicates
783769
;
784770

785771
where_predicate
786-
: maybe_for_lifetimes lifetime ':' bounds { $$ = mk_node("WherePredicate", 3, $1, $2, $4); }
787-
| maybe_for_lifetimes ty ':' ty_param_bounds { $$ = mk_node("WherePredicate", 3, $1, $2, $4); }
772+
: lifetime ':' bounds { $$ = mk_node("WherePredicate", 2, $1, $3); }
773+
| ty ':' ty_param_bounds { $$ = mk_node("WherePredicate", 2, $1, $3); }
788774
;
789775

790-
maybe_for_lifetimes
791-
: FOR '<' lifetimes '>' { $$ = mk_none(); }
792-
| %prec FORTYPE %empty { $$ = mk_none(); }
793-
794776
ty_params
795777
: ty_param { $$ = mk_node("TyParams", 1, $1); }
796778
| ty_params ',' ty_param { $$ = ext_node($1, 1, $3); }
@@ -1042,8 +1024,7 @@ ty_qualified_path_and_generic_values
10421024
}
10431025
| ty_qualified_path ',' ty_sums maybe_bindings
10441026
{
1045-
$$ = mk_node("GenericValues", 3, mk_none(), mk_node("TySums", 2, $1, $3), $4);
1046-
}
1027+
$$ = mk_node("GenericValues", 3, mk_none(), ext_node(mk_node("TySums", 1, $1), 1, $3), $4); }
10471028
;
10481029

10491030
ty_qualified_path
@@ -1532,35 +1513,31 @@ nonblock_prefix_expr
15321513
;
15331514

15341515
expr_qualified_path
1535-
: '<' ty_sum maybe_as_trait_ref '>' MOD_SEP ident
1516+
: '<' ty_sum AS trait_ref '>' MOD_SEP ident
15361517
{
1537-
$$ = mk_node("ExprQualifiedPath", 3, $2, $3, $6);
1518+
$$ = mk_node("ExprQualifiedPath", 3, $2, $4, $7);
15381519
}
1539-
| '<' ty_sum maybe_as_trait_ref '>' MOD_SEP ident generic_args
1520+
| '<' ty_sum AS trait_ref '>' MOD_SEP ident generic_args
15401521
{
1541-
$$ = mk_node("ExprQualifiedPath", 4, $2, $3, $6, $7);
1522+
$$ = mk_node("ExprQualifiedPath", 4, $2, $4, $7, $8);
15421523
}
1543-
| SHL ty_sum maybe_as_trait_ref '>' MOD_SEP ident maybe_as_trait_ref '>' MOD_SEP ident
1524+
| SHL ty_sum AS trait_ref '>' MOD_SEP ident AS trait_ref '>' MOD_SEP ident
15441525
{
1545-
$$ = mk_node("ExprQualifiedPath", 3, mk_node("ExprQualifiedPath", 3, $2, $3, $6), $7, $10);
1526+
$$ = mk_node("ExprQualifiedPath", 3, mk_node("ExprQualifiedPath", 3, $2, $4, $7), $9, $12);
15461527
}
1547-
| SHL ty_sum maybe_as_trait_ref '>' MOD_SEP ident generic_args maybe_as_trait_ref '>' MOD_SEP ident
1528+
| SHL ty_sum AS trait_ref '>' MOD_SEP ident generic_args AS trait_ref '>' MOD_SEP ident
15481529
{
1549-
$$ = mk_node("ExprQualifiedPath", 3, mk_node("ExprQualifiedPath", 4, $2, $3, $6, $7), $8, $11);
1530+
$$ = mk_node("ExprQualifiedPath", 3, mk_node("ExprQualifiedPath", 4, $2, $4, $7, $8), $10, $13);
15501531
}
1551-
| SHL ty_sum maybe_as_trait_ref '>' MOD_SEP ident maybe_as_trait_ref '>' MOD_SEP ident generic_args
1532+
| SHL ty_sum AS trait_ref '>' MOD_SEP ident AS trait_ref '>' MOD_SEP ident generic_args
15521533
{
1553-
$$ = mk_node("ExprQualifiedPath", 4, mk_node("ExprQualifiedPath", 3, $2, $3, $6), $7, $10, $11);
1534+
$$ = mk_node("ExprQualifiedPath", 4, mk_node("ExprQualifiedPath", 3, $2, $4, $7), $9, $12, $13);
15541535
}
1555-
| SHL ty_sum maybe_as_trait_ref '>' MOD_SEP ident generic_args maybe_as_trait_ref '>' MOD_SEP ident generic_args
1536+
| SHL ty_sum AS trait_ref '>' MOD_SEP ident generic_args AS trait_ref '>' MOD_SEP ident generic_args
15561537
{
1557-
$$ = mk_node("ExprQualifiedPath", 4, mk_node("ExprQualifiedPath", 4, $2, $3, $6, $7), $8, $11, $12);
1538+
$$ = mk_node("ExprQualifiedPath", 4, mk_node("ExprQualifiedPath", 4, $2, $4, $7, $8), $10, $13, $14);
15581539
}
15591540

1560-
maybe_as_trait_ref
1561-
: AS trait_ref { $$ = $2; }
1562-
| %empty { $$ = mk_none(); }
1563-
;
15641541

15651542
lambda_expr
15661543
: %prec LAMBDA

branches/beta/src/jemalloc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit e24a1a025a1f214e40eedafe3b9c7b1d69937922
1+
Subproject commit b001609960ca33047e5cbc5a231c1e24b6041d4b

branches/beta/src/liballoc/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
//! }
4343
//! ```
4444
//!
45-
//! This will print `Cons(1, Box(Cons(2, Box(Nil))))`.
45+
//! This will print `Cons(1i32, Box(Cons(2i32, Box(Nil))))`.
4646
4747
#![stable(feature = "rust1", since = "1.0.0")]
4848

0 commit comments

Comments
 (0)