Skip to content

Commit ee0be3b

Browse files
committed
Auto merge of #21698 - Manishearth:rollup, r=alexcrichton
This should work now.
2 parents a45e117 + c709ed2 commit ee0be3b

File tree

126 files changed

+1204
-1167
lines changed

Some content is hidden

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

126 files changed

+1204
-1167
lines changed

src/compiletest/common.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt;
1313
use std::str::FromStr;
1414

1515
#[cfg(stage0)] // NOTE: remove impl after snapshot
16-
#[derive(Clone, PartialEq, Show)]
16+
#[derive(Clone, Copy, PartialEq, Show)]
1717
pub enum Mode {
1818
CompileFail,
1919
RunFail,
@@ -26,7 +26,7 @@ pub enum Mode {
2626
}
2727

2828
#[cfg(not(stage0))] // NOTE: remove cfg after snapshot
29-
#[derive(Clone, PartialEq, Debug)]
29+
#[derive(Clone, Copy, PartialEq, Debug)]
3030
pub enum Mode {
3131
CompileFail,
3232
RunFail,
@@ -38,9 +38,6 @@ pub enum Mode {
3838
Codegen
3939
}
4040

41-
42-
impl Copy for Mode {}
43-
4441
impl FromStr for Mode {
4542
fn from_str(s: &str) -> Option<Mode> {
4643
match s {

src/doc/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,8 +1680,8 @@ specific type.
16801680
Implementations are defined with the keyword `impl`.
16811681

16821682
```
1683+
# #[derive(Copy)]
16831684
# struct Point {x: f64, y: f64};
1684-
# impl Copy for Point {}
16851685
# type Surface = i32;
16861686
# struct BoundingBox {x: f64, y: f64, width: f64, height: f64};
16871687
# trait Shape { fn draw(&self, Surface); fn bounding_box(&self) -> BoundingBox; }
@@ -2219,7 +2219,7 @@ For any lint check `C`:
22192219

22202220
The lint checks supported by the compiler can be found via `rustc -W help`,
22212221
along with their default settings. [Compiler
2222-
plugins](book/plugin.html#lint-plugins) can provide additional lint checks.
2222+
plugins](book/plugins.html#lint-plugins) can provide additional lint checks.
22232223

22242224
```{.ignore}
22252225
mod m1 {
@@ -4163,4 +4163,4 @@ that have since been removed):
41634163
pattern syntax
41644164

41654165
[ffi]: book/ffi.html
4166-
[plugin]: book/plugin.html
4166+
[plugin]: book/plugins.html

src/doc/trpl/more-strings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,5 +279,5 @@ Many more bytes than graphemes!
279279

280280
# Other Documentation
281281

282-
* [the `&str` API documentation](std/str/index.html)
283-
* [the `String` API documentation](std/string/index.html)
282+
* [the `&str` API documentation](../std/str/index.html)
283+
* [the `String` API documentation](../std/string/index.html)

src/doc/trpl/ownership.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ fn substr<'a>(s: &'a str, until: u32) -> &'a str; // expanded
533533
fn get_str() -> &str; // ILLEGAL, no inputs
534534
535535
fn frob(s: &str, t: &str) -> &str; // ILLEGAL, two inputs
536+
fn frob<'a, 'b>(s: &'a str, t: &'b str) -> &str; // Expanded: Output lifetime is unclear
536537
537538
fn get_mut(&mut self) -> &mut T; // elided
538539
fn get_mut<'a>(&'a mut self) -> &'a mut T; // expanded

src/etc/check-summary.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
if __name__ == '__main__':
1717
summaries = []
18+
1819
def summarise(fname):
1920
summary = {}
2021
with open(fname) as fd:
@@ -27,12 +28,14 @@ def summarise(fname):
2728
# track bench runs
2829
if splitline[1] == 'ns/iter':
2930
status = 'bench'
30-
if not summary.has_key(status):
31+
if status not in summary:
3132
summary[status] = []
3233
summary[status].append(test)
3334
summaries.append((fname, summary))
35+
3436
def count(t):
3537
return sum(map(lambda (f, s): len(s.get(t, [])), summaries))
38+
3639
logfiles = sys.argv[1:]
3740
for files in map(glob.glob, logfiles):
3841
map(summarise, files)
@@ -41,8 +44,9 @@ def count(t):
4144
ignored = count('ignored')
4245
measured = count('bench')
4346
print "summary of %d test runs: %d passed; %d failed; %d ignored; %d measured" % \
44-
(len(logfiles), ok, failed, ignored, measured)
47+
(len(logfiles), ok, failed, ignored, measured)
4548
print ""
49+
4650
if failed > 0:
4751
print "failed tests:"
4852
for f, s in summaries:

src/etc/errorck.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
# Digs error codes out of files named 'diagnostics.rs' across
1212
# the tree, and ensures thare are no duplicates.
1313

14-
import sys, os, re
14+
import sys
15+
import os
16+
import re
1517

1618
src_dir = sys.argv[1]
1719
errcode_map = {}

src/etc/extract_grammar.py

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
import fileinput
1616

17-
collections = { "gram": [],
18-
"keyword": [],
19-
"reserved": [],
20-
"binop": [],
21-
"unop": [] }
17+
collections = {"gram": [],
18+
"keyword": [],
19+
"reserved": [],
20+
"binop": [],
21+
"unop": []}
2222

2323

2424
in_coll = False
@@ -47,66 +47,66 @@
4747
# Define operator symbol-names here
4848

4949
tokens = ["non_star", "non_slash", "non_eol",
50-
"non_single_quote", "non_double_quote", "ident" ]
50+
"non_single_quote", "non_double_quote", "ident"]
5151

5252
symnames = {
53-
".": "dot",
54-
"+": "plus",
55-
"-": "minus",
56-
"/": "slash",
57-
"*": "star",
58-
"%": "percent",
59-
60-
"~": "tilde",
61-
"@": "at",
62-
63-
"!": "not",
64-
"&": "and",
65-
"|": "or",
66-
"^": "xor",
67-
68-
"<<": "lsl",
69-
">>": "lsr",
70-
">>>": "asr",
71-
72-
"&&": "andand",
73-
"||": "oror",
74-
75-
"<" : "lt",
76-
"<=" : "le",
77-
"==" : "eqeq",
78-
">=" : "ge",
79-
">" : "gt",
80-
81-
"=": "eq",
82-
83-
"+=": "plusequal",
84-
"-=": "minusequal",
85-
"/=": "divequal",
86-
"*=": "starequal",
87-
"%=": "percentequal",
88-
89-
"&=": "andequal",
90-
"|=": "orequal",
91-
"^=": "xorequal",
92-
93-
">>=": "lsrequal",
94-
">>>=": "asrequal",
95-
"<<=": "lslequal",
96-
97-
"::": "coloncolon",
98-
99-
"->": "rightarrow",
100-
"<-": "leftarrow",
101-
"<->": "swaparrow",
102-
103-
"//": "linecomment",
104-
"/*": "openblockcomment",
105-
"*/": "closeblockcomment",
106-
"macro_rules": "macro_rules",
107-
"=>" : "eg",
108-
".." : "dotdot",
109-
"," : "comma"
53+
".": "dot",
54+
"+": "plus",
55+
"-": "minus",
56+
"/": "slash",
57+
"*": "star",
58+
"%": "percent",
59+
60+
"~": "tilde",
61+
"@": "at",
62+
63+
"!": "not",
64+
"&": "and",
65+
"|": "or",
66+
"^": "xor",
67+
68+
"<<": "lsl",
69+
">>": "lsr",
70+
">>>": "asr",
71+
72+
"&&": "andand",
73+
"||": "oror",
74+
75+
"<": "lt",
76+
"<=": "le",
77+
"==": "eqeq",
78+
">=": "ge",
79+
">": "gt",
80+
81+
"=": "eq",
82+
83+
"+=": "plusequal",
84+
"-=": "minusequal",
85+
"/=": "divequal",
86+
"*=": "starequal",
87+
"%=": "percentequal",
88+
89+
"&=": "andequal",
90+
"|=": "orequal",
91+
"^=": "xorequal",
92+
93+
">>=": "lsrequal",
94+
">>>=": "asrequal",
95+
"<<=": "lslequal",
96+
97+
"::": "coloncolon",
98+
99+
"->": "rightarrow",
100+
"<-": "leftarrow",
101+
"<->": "swaparrow",
102+
103+
"//": "linecomment",
104+
"/*": "openblockcomment",
105+
"*/": "closeblockcomment",
106+
"macro_rules": "macro_rules",
107+
"=>": "eg",
108+
"..": "dotdot",
109+
",": "comma"
110110
}
111111

112112
lines = []
@@ -126,8 +126,8 @@
126126
+ word)
127127
if word not in tokens:
128128
if (word in collections["keyword"] or
129-
word in collections["reserved"]):
130-
tokens.append(word)
129+
word in collections["reserved"]):
130+
tokens.append(word)
131131
else:
132132
raise Exception("unknown keyword/reserved word: "
133133
+ word)
@@ -149,8 +149,8 @@
149149
print("%start parser, token;")
150150
print("%%token %s ;" % ("\n\t, ".join(tokens)))
151151
for coll in ["keyword", "reserved"]:
152-
print("%s: %s ; " % (coll, "\n\t| ".join(collections[coll])));
152+
print("%s: %s ; " % (coll, "\n\t| ".join(collections[coll])))
153153
for coll in ["binop", "unop"]:
154154
print("%s: %s ; " % (coll, "\n\t| ".join([symnames[x]
155-
for x in collections[coll]])));
156-
print("\n".join(lines));
155+
for x in collections[coll]])))
156+
print("\n".join(lines))

0 commit comments

Comments
 (0)