Skip to content

Commit 23a5fb8

Browse files
authored
Merge branch 'master' into pep8-bootstrap
2 parents a263a78 + 264aafe commit 23a5fb8

File tree

94 files changed

+897
-790
lines changed

Some content is hidden

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

94 files changed

+897
-790
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Snapshot binaries are currently built and tested on several platforms:
193193
You may find that other platforms work, but these are our officially
194194
supported build environments that are most likely to work.
195195

196-
Rust currently needs between 600MiB and 1.5GiB to build, depending on platform.
196+
Rust currently needs between 600MiB and 1.5GiB of RAM to build, depending on platform.
197197
If it hits swap, it will take a very long time to build.
198198

199199
There is more advice about hacking on Rust in [CONTRIBUTING.md].

src/bootstrap/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The script accepts commands, flags, and arguments to determine what to do:
3939
```
4040

4141
If files are dirty that would normally be rebuilt from stage 0, that can be
42-
overidden using `--keep-stage 0`. Using `--keep-stage n` will skip all steps
42+
overridden using `--keep-stage 0`. Using `--keep-stage n` will skip all steps
4343
that belong to stage n or earlier:
4444

4545
```

src/bootstrap/bin/rustc.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ extern crate bootstrap;
3131

3232
use std::env;
3333
use std::ffi::OsString;
34-
use std::io;
35-
use std::io::prelude::*;
3634
use std::str::FromStr;
3735
use std::path::PathBuf;
3836
use std::process::{Command, ExitStatus};
@@ -270,7 +268,7 @@ fn main() {
270268
}
271269

272270
if verbose > 1 {
273-
writeln!(&mut io::stderr(), "rustc command: {:?}", cmd).unwrap();
271+
eprintln!("rustc command: {:?}", cmd);
274272
}
275273

276274
// Actually run the compiler!

src/bootstrap/bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def get_toml(self, key):
499499
500500
If the key does not exists, the result is None:
501501
502-
>>> rb.get_toml("key3") == None
502+
>>> rb.get_toml("key3") is None
503503
True
504504
"""
505505
for line in self.config_toml.splitlines():

src/bootstrap/configure.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def set(key, value):
358358

359359

360360
# Here we walk through the constructed configuration we have from the parsed
361-
# command line arguemnts. We then apply each piece of configuration by
361+
# command line arguments. We then apply each piece of configuration by
362362
# basically just doing a `sed` to change the various configuration line to what
363363
# we've got configure.
364364
def to_toml(value):
@@ -372,7 +372,7 @@ def to_toml(value):
372372
elif isinstance(value, str):
373373
return "'" + value + "'"
374374
else:
375-
raise 'no toml'
375+
raise RuntimeError('no toml')
376376

377377

378378
def configure_section(lines, config):
@@ -392,9 +392,9 @@ def configure_section(lines, config):
392392
for section_key in config:
393393
section_config = config[section_key]
394394
if section_key not in sections:
395-
raise RuntimeError("config key {} not in sections".format(key))
395+
raise RuntimeError("config key {} not in sections".format(section_key))
396396

397-
if section_key == 'target':
397+
if __key == 'target':
398398
for target in section_config:
399399
configure_section(targets[target], section_config[target])
400400
else:

src/ci/docker/scripts/android-sdk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ download_sysimage() {
3131
# Keep printing yes to accept the licenses
3232
while true; do echo yes; sleep 10; done | \
3333
/android/sdk/tools/android update sdk -a --no-ui \
34-
--filter "$filter"
34+
--filter "$filter" --no-https
3535
}
3636

3737
create_avd() {

src/etc/lldb_batchmode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def execute_command(command_interpreter, command):
8181

8282
if res.Succeeded():
8383
if res.HasResult():
84-
print(normalize_whitespace(res.GetOutput()), end='\n')
84+
print(normalize_whitespace(res.GetOutput() or ''), end='\n')
8585

8686
# If the command introduced any breakpoints, make sure to register
8787
# them with the breakpoint

src/grammar/lexer.l

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -85,43 +85,60 @@ ident [a-zA-Z\x80-\xff_][a-zA-Z0-9\x80-\xff_]*
8585
<blockcomment>(.|\n) { }
8686

8787
_ { return UNDERSCORE; }
88+
abstract { return ABSTRACT; }
89+
alignof { return ALIGNOF; }
8890
as { return AS; }
91+
become { return BECOME; }
8992
box { return BOX; }
9093
break { return BREAK; }
94+
catch { return CATCH; }
9195
const { return CONST; }
9296
continue { return CONTINUE; }
9397
crate { return CRATE; }
98+
default { return DEFAULT; }
99+
do { return DO; }
94100
else { return ELSE; }
95101
enum { return ENUM; }
96102
extern { return EXTERN; }
97103
false { return FALSE; }
104+
final { return FINAL; }
98105
fn { return FN; }
99106
for { return FOR; }
100107
if { return IF; }
101108
impl { return IMPL; }
102109
in { return IN; }
103110
let { return LET; }
104111
loop { return LOOP; }
112+
macro { return MACRO; }
105113
match { return MATCH; }
106114
mod { return MOD; }
107115
move { return MOVE; }
108116
mut { return MUT; }
117+
offsetof { return OFFSETOF; }
118+
override { return OVERRIDE; }
109119
priv { return PRIV; }
110120
proc { return PROC; }
121+
pure { return PURE; }
111122
pub { return PUB; }
112123
ref { return REF; }
113124
return { return RETURN; }
114125
self { return SELF; }
126+
sizeof { return SIZEOF; }
115127
static { return STATIC; }
116128
struct { return STRUCT; }
129+
super { return SUPER; }
117130
trait { return TRAIT; }
118131
true { return TRUE; }
119132
type { return TYPE; }
120133
typeof { return TYPEOF; }
134+
union { return UNION; }
121135
unsafe { return UNSAFE; }
136+
unsized { return UNSIZED; }
122137
use { return USE; }
138+
virtual { return VIRTUAL; }
123139
where { return WHERE; }
124140
while { return WHILE; }
141+
yield { return YIELD; }
125142

126143
{ident} { return IDENT; }
127144

@@ -189,25 +206,25 @@ while { return WHILE; }
189206
\>\>= { return SHREQ; }
190207
\> { return '>'; }
191208

192-
\x27 { BEGIN(ltorchar); yymore(); }
193-
<ltorchar>static { BEGIN(INITIAL); return STATIC_LIFETIME; }
194-
<ltorchar>{ident} { BEGIN(INITIAL); return LIFETIME; }
195-
<ltorchar>\\[nrt\\\x27\x220]\x27 { BEGIN(suffix); return LIT_CHAR; }
196-
<ltorchar>\\x[0-9a-fA-F]{2}\x27 { BEGIN(suffix); return LIT_CHAR; }
197-
<ltorchar>\\u\{[0-9a-fA-F]?{6}\}\x27 { BEGIN(suffix); return LIT_CHAR; }
198-
<ltorchar>.\x27 { BEGIN(suffix); return LIT_CHAR; }
199-
<ltorchar>[\x80-\xff]{2,4}\x27 { BEGIN(suffix); return LIT_CHAR; }
200-
<ltorchar><<EOF>> { BEGIN(INITIAL); return -1; }
209+
\x27 { BEGIN(ltorchar); yymore(); }
210+
<ltorchar>static { BEGIN(INITIAL); return STATIC_LIFETIME; }
211+
<ltorchar>{ident} { BEGIN(INITIAL); return LIFETIME; }
212+
<ltorchar>\\[nrt\\\x27\x220]\x27 { BEGIN(suffix); return LIT_CHAR; }
213+
<ltorchar>\\x[0-9a-fA-F]{2}\x27 { BEGIN(suffix); return LIT_CHAR; }
214+
<ltorchar>\\u\{([0-9a-fA-F]_*){1,6}\}\x27 { BEGIN(suffix); return LIT_CHAR; }
215+
<ltorchar>.\x27 { BEGIN(suffix); return LIT_CHAR; }
216+
<ltorchar>[\x80-\xff]{2,4}\x27 { BEGIN(suffix); return LIT_CHAR; }
217+
<ltorchar><<EOF>> { BEGIN(INITIAL); return -1; }
201218

202219
b\x22 { BEGIN(bytestr); yymore(); }
203220
<bytestr>\x22 { BEGIN(suffix); return LIT_BYTE_STR; }
204221

205-
<bytestr><<EOF>> { return -1; }
206-
<bytestr>\\[n\nrt\\\x27\x220] { yymore(); }
207-
<bytestr>\\x[0-9a-fA-F]{2} { yymore(); }
208-
<bytestr>\\u\{[0-9a-fA-F]?{6}\} { yymore(); }
209-
<bytestr>\\[^n\nrt\\\x27\x220] { return -1; }
210-
<bytestr>(.|\n) { yymore(); }
222+
<bytestr><<EOF>> { return -1; }
223+
<bytestr>\\[n\nrt\\\x27\x220] { yymore(); }
224+
<bytestr>\\x[0-9a-fA-F]{2} { yymore(); }
225+
<bytestr>\\u\{([0-9a-fA-F]_*){1,6}\} { yymore(); }
226+
<bytestr>\\[^n\nrt\\\x27\x220] { return -1; }
227+
<bytestr>(.|\n) { yymore(); }
211228

212229
br\x22 { BEGIN(rawbytestr_nohash); yymore(); }
213230
<rawbytestr_nohash>\x22 { BEGIN(suffix); return LIT_BYTE_STR_RAW; }
@@ -252,13 +269,13 @@ br/# {
252269
}
253270
<rawbytestr><<EOF>> { return -1; }
254271

255-
b\x27 { BEGIN(byte); yymore(); }
256-
<byte>\\[nrt\\\x27\x220]\x27 { BEGIN(INITIAL); return LIT_BYTE; }
257-
<byte>\\x[0-9a-fA-F]{2}\x27 { BEGIN(INITIAL); return LIT_BYTE; }
258-
<byte>\\u[0-9a-fA-F]{4}\x27 { BEGIN(INITIAL); return LIT_BYTE; }
259-
<byte>\\U[0-9a-fA-F]{8}\x27 { BEGIN(INITIAL); return LIT_BYTE; }
260-
<byte>.\x27 { BEGIN(INITIAL); return LIT_BYTE; }
261-
<byte><<EOF>> { BEGIN(INITIAL); return -1; }
272+
b\x27 { BEGIN(byte); yymore(); }
273+
<byte>\\[nrt\\\x27\x220]\x27 { BEGIN(INITIAL); return LIT_BYTE; }
274+
<byte>\\x[0-9a-fA-F]{2}\x27 { BEGIN(INITIAL); return LIT_BYTE; }
275+
<byte>\\u([0-9a-fA-F]_*){4}\x27 { BEGIN(INITIAL); return LIT_BYTE; }
276+
<byte>\\U([0-9a-fA-F]_*){8}\x27 { BEGIN(INITIAL); return LIT_BYTE; }
277+
<byte>.\x27 { BEGIN(INITIAL); return LIT_BYTE; }
278+
<byte><<EOF>> { BEGIN(INITIAL); return -1; }
262279

263280
r\x22 { BEGIN(rawstr); yymore(); }
264281
<rawstr>\x22 { BEGIN(suffix); return LIT_STR_RAW; }
@@ -310,12 +327,12 @@ r/# {
310327
\x22 { BEGIN(str); yymore(); }
311328
<str>\x22 { BEGIN(suffix); return LIT_STR; }
312329

313-
<str><<EOF>> { return -1; }
314-
<str>\\[n\nr\rt\\\x27\x220] { yymore(); }
315-
<str>\\x[0-9a-fA-F]{2} { yymore(); }
316-
<str>\\u\{[0-9a-fA-F]?{6}\} { yymore(); }
317-
<str>\\[^n\nrt\\\x27\x220] { return -1; }
318-
<str>(.|\n) { yymore(); }
330+
<str><<EOF>> { return -1; }
331+
<str>\\[n\nr\rt\\\x27\x220] { yymore(); }
332+
<str>\\x[0-9a-fA-F]{2} { yymore(); }
333+
<str>\\u\{([0-9a-fA-F]_*){1,6}\} { yymore(); }
334+
<str>\\[^n\nrt\\\x27\x220] { return -1; }
335+
<str>(.|\n) { yymore(); }
319336

320337
\<- { return LARROW; }
321338
-\> { return RARROW; }

0 commit comments

Comments
 (0)