Skip to content

Commit cd5441f

Browse files
committed
Auto merge of #69088 - JohnTitor:rollup-x7bk7h7, r=JohnTitor
Rollup of 11 pull requests Successful merges: - #67695 (Added dyn and true keyword docs) - #68487 ([experiment] Support linking from a .rlink file) - #68554 (Split lang_items to crates `rustc_hir` and `rustc_passes`.) - #68937 (Test failure of unchecked arithmetic intrinsics in const eval) - #68947 (Python script PEP8 style guide space formatting and minor Python source cleanup) - #68999 (remove dependency on itertools) - #69026 (Remove common usage pattern from `AllocRef`) - #69027 (Add missing `_zeroed` varants to `AllocRef`) - #69058 (Preparation for allocator aware `Box`) - #69070 (Add self to .mailmap) - #69077 (Fix outdated doc comment.) Failed merges: r? @ghost
2 parents 7cba853 + 486856f commit cd5441f

Some content is hidden

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

57 files changed

+1201
-1024
lines changed

.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ James Deng <[email protected]> <[email protected]>
114114
115115
James Perry <[email protected]>
116116
Jason Fager <[email protected]>
117+
117118
118119
119120
Jason Toffaletti <[email protected]> Jason Toffaletti <[email protected]>

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -3552,6 +3552,7 @@ dependencies = [
35523552
"log",
35533553
"rustc",
35543554
"rustc_ast_pretty",
3555+
"rustc_codegen_ssa",
35553556
"rustc_codegen_utils",
35563557
"rustc_data_structures",
35573558
"rustc_error_codes",
@@ -3629,6 +3630,7 @@ version = "0.0.0"
36293630
name = "rustc_hir"
36303631
version = "0.0.0"
36313632
dependencies = [
3633+
"lazy_static 1.4.0",
36323634
"rustc_ast_pretty",
36333635
"rustc_data_structures",
36343636
"rustc_errors",
@@ -3748,7 +3750,6 @@ dependencies = [
37483750
name = "rustc_macros"
37493751
version = "0.1.0"
37503752
dependencies = [
3751-
"itertools 0.8.0",
37523753
"proc-macro2 1.0.3",
37533754
"quote 1.0.2",
37543755
"syn 1.0.11",
@@ -3812,7 +3813,6 @@ name = "rustc_mir_build"
38123813
version = "0.0.0"
38133814
dependencies = [
38143815
"arena",
3815-
"itertools 0.8.0",
38163816
"log",
38173817
"rustc",
38183818
"rustc_apfloat",

src/bootstrap/bootstrap.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _download(path, url, probably_big, verbose, exception):
8080
option = "-s"
8181
run(["curl", option,
8282
"-y", "30", "-Y", "10", # timeout if speed is < 10 bytes/sec for > 30 seconds
83-
"--connect-timeout", "30", # timeout if cannot connect within 30 seconds
83+
"--connect-timeout", "30", # timeout if cannot connect within 30 seconds
8484
"--retry", "3", "-Sf", "-o", path, url],
8585
verbose=verbose,
8686
exception=exception)
@@ -332,7 +332,6 @@ def __init__(self):
332332
self.use_vendored_sources = ''
333333
self.verbose = False
334334

335-
336335
def download_stage0(self):
337336
"""Fetch the build system for Rust, written in Rust
338337
@@ -351,7 +350,7 @@ def support_xz():
351350
try:
352351
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
353352
temp_path = temp_file.name
354-
with tarfile.open(temp_path, "w:xz") as tar:
353+
with tarfile.open(temp_path, "w:xz"):
355354
pass
356355
return True
357356
except tarfile.CompressionError:
@@ -825,7 +824,7 @@ def check_vendored_status(self):
825824
if not os.path.exists(vendor_dir):
826825
print('error: vendoring required, but vendor directory does not exist.')
827826
print(' Run `cargo vendor` without sudo to initialize the '
828-
'vendor directory.')
827+
'vendor directory.')
829828
raise Exception("{} not found".format(vendor_dir))
830829

831830
if self.use_vendored_sources:
@@ -839,7 +838,7 @@ def check_vendored_status(self):
839838
"\n"
840839
"[source.vendored-sources]\n"
841840
"directory = '{}/vendor'\n"
842-
.format(self.rust_root))
841+
.format(self.rust_root))
843842
else:
844843
if os.path.exists('.cargo'):
845844
shutil.rmtree('.cargo')

src/bootstrap/configure.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -393,11 +393,12 @@ def set(key, value):
393393

394394

395395
def is_number(value):
396-
try:
397-
float(value)
398-
return True
399-
except ValueError:
400-
return False
396+
try:
397+
float(value)
398+
return True
399+
except ValueError:
400+
return False
401+
401402

402403
# Here we walk through the constructed configuration we have from the parsed
403404
# command line arguments. We then apply each piece of configuration by

src/ci/cpu-usage-over-time.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ def idle_since(self, prev):
148148
print('unknown platform', sys.platform)
149149
sys.exit(1)
150150

151-
cur_state = State();
151+
cur_state = State()
152152
print("Time,Idle")
153153
while True:
154-
time.sleep(1);
155-
next_state = State();
154+
time.sleep(1)
155+
next_state = State()
156156
now = datetime.datetime.utcnow().isoformat()
157157
idle = next_state.idle_since(cur_state)
158158
print("%s,%s" % (now, idle))

src/etc/debugger_pretty_printers_common.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ def __classify_struct(self):
212212
# REGULAR STRUCT
213213
return TYPE_KIND_REGULAR_STRUCT
214214

215-
216215
def __classify_union(self):
217216
assert self.get_dwarf_type_kind() == DWARF_TYPE_CODE_UNION
218217

@@ -233,7 +232,6 @@ def __classify_union(self):
233232
else:
234233
return TYPE_KIND_REGULAR_UNION
235234

236-
237235
def __conforms_to_field_layout(self, expected_fields):
238236
actual_fields = self.get_fields()
239237
actual_field_count = len(actual_fields)
@@ -363,6 +361,7 @@ def extract_tail_head_ptr_and_cap_from_std_vecdeque(vec_val):
363361
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
364362
return (tail, head, data_ptr, capacity)
365363

364+
366365
def extract_length_and_ptr_from_slice(slice_val):
367366
assert (slice_val.type.get_type_kind() == TYPE_KIND_SLICE or
368367
slice_val.type.get_type_kind() == TYPE_KIND_STR_SLICE)
@@ -376,8 +375,10 @@ def extract_length_and_ptr_from_slice(slice_val):
376375
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
377376
return (length, data_ptr)
378377

378+
379379
UNQUALIFIED_TYPE_MARKERS = frozenset(["(", "[", "&", "*"])
380380

381+
381382
def extract_type_name(qualified_type_name):
382383
"""Extracts the type name from a fully qualified path"""
383384
if qualified_type_name[0] in UNQUALIFIED_TYPE_MARKERS:
@@ -393,6 +394,7 @@ def extract_type_name(qualified_type_name):
393394
else:
394395
return qualified_type_name[index + 2:]
395396

397+
396398
try:
397399
compat_str = unicode # Python 2
398400
except NameError:

src/etc/dec2flt_table.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
even larger, and it's already uncomfortably large (6 KiB).
1515
"""
1616
from __future__ import print_function
17-
import sys
1817
from math import ceil, log
1918
from fractions import Fraction
2019
from collections import namedtuple
@@ -82,6 +81,7 @@ def error(f, e, z):
8281
ulp_err = abs_err / Fraction(2) ** z.exp
8382
return float(ulp_err)
8483

84+
8585
HEADER = """
8686
//! Tables of approximations of powers of ten.
8787
//! DO NOT MODIFY: Generated by `src/etc/dec2flt_table.py`

src/etc/gdb_rust_pretty_printing.py

+23-20
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
if sys.version_info[0] >= 3:
1010
xrange = range
1111

12-
rust_enabled = 'set language rust' in gdb.execute('complete set language ru', to_string = True)
12+
rust_enabled = 'set language rust' in gdb.execute('complete set language ru', to_string=True)
1313

1414
# The btree pretty-printers fail in a confusing way unless
1515
# https://sourceware.org/bugzilla/show_bug.cgi?id=21763 is fixed.
@@ -21,9 +21,10 @@
2121
if int(_match.group(1)) > 8 or (int(_match.group(1)) == 8 and int(_match.group(2)) >= 1):
2222
gdb_81 = True
2323

24-
#===============================================================================
24+
# ===============================================================================
2525
# GDB Pretty Printing Module for Rust
26-
#===============================================================================
26+
# ===============================================================================
27+
2728

2829
class GdbType(rustpp.Type):
2930

@@ -133,39 +134,39 @@ def rust_pretty_printer_lookup_function(gdb_val):
133134

134135
if type_kind == rustpp.TYPE_KIND_REGULAR_STRUCT:
135136
return RustStructPrinter(val,
136-
omit_first_field = False,
137-
omit_type_name = False,
138-
is_tuple_like = False)
137+
omit_first_field=False,
138+
omit_type_name=False,
139+
is_tuple_like=False)
139140

140141
if type_kind == rustpp.TYPE_KIND_STRUCT_VARIANT:
141142
return RustStructPrinter(val,
142-
omit_first_field = True,
143-
omit_type_name = False,
144-
is_tuple_like = False)
143+
omit_first_field=True,
144+
omit_type_name=False,
145+
is_tuple_like=False)
145146

146147
if type_kind == rustpp.TYPE_KIND_STR_SLICE:
147148
return RustStringSlicePrinter(val)
148149

149150
if type_kind == rustpp.TYPE_KIND_TUPLE:
150151
return RustStructPrinter(val,
151-
omit_first_field = False,
152-
omit_type_name = True,
153-
is_tuple_like = True)
152+
omit_first_field=False,
153+
omit_type_name=True,
154+
is_tuple_like=True)
154155

155156
if type_kind == rustpp.TYPE_KIND_TUPLE_STRUCT:
156157
return RustStructPrinter(val,
157-
omit_first_field = False,
158-
omit_type_name = False,
159-
is_tuple_like = True)
158+
omit_first_field=False,
159+
omit_type_name=False,
160+
is_tuple_like=True)
160161

161162
if type_kind == rustpp.TYPE_KIND_CSTYLE_VARIANT:
162163
return RustCStyleVariantPrinter(val.get_child_at_index(0))
163164

164165
if type_kind == rustpp.TYPE_KIND_TUPLE_VARIANT:
165166
return RustStructPrinter(val,
166-
omit_first_field = True,
167-
omit_type_name = False,
168-
is_tuple_like = True)
167+
omit_first_field=True,
168+
omit_type_name=False,
169+
is_tuple_like=True)
169170

170171
if type_kind == rustpp.TYPE_KIND_SINGLETON_ENUM:
171172
variant = get_field_at_index(gdb_val, 0)
@@ -189,9 +190,9 @@ def rust_pretty_printer_lookup_function(gdb_val):
189190
return None
190191

191192

192-
#=------------------------------------------------------------------------------
193+
# =------------------------------------------------------------------------------
193194
# Pretty Printer Classes
194-
#=------------------------------------------------------------------------------
195+
# =------------------------------------------------------------------------------
195196
class RustEmptyPrinter(object):
196197
def __init__(self, val):
197198
self.__val = val
@@ -355,6 +356,7 @@ def children_of_node(boxed_node, height, want_values):
355356
else:
356357
yield keys[i]['value']['value']
357358

359+
358360
class RustStdBTreeSetPrinter(object):
359361
def __init__(self, val):
360362
self.__val = val
@@ -429,6 +431,7 @@ def to_string(self):
429431
def display_hint(self):
430432
return "string"
431433

434+
432435
class RustCStyleVariantPrinter(object):
433436
def __init__(self, val):
434437
assert val.type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_ENUM

src/etc/generate-deriving-span-tests.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
sample usage: src/etc/generate-deriving-span-tests.py
99
"""
1010

11-
import os, stat
11+
import os
12+
import stat
1213

1314
TEST_DIR = os.path.abspath(
1415
os.path.join(os.path.dirname(__file__), '../test/ui/derives/'))
@@ -56,15 +57,17 @@
5657

5758
ENUM_TUPLE, ENUM_STRUCT, STRUCT_FIELDS, STRUCT_TUPLE = range(4)
5859

60+
5961
def create_test_case(type, trait, super_traits, error_count):
6062
string = [ENUM_STRING, ENUM_STRUCT_VARIANT_STRING, STRUCT_STRING, STRUCT_TUPLE_STRING][type]
6163
all_traits = ','.join([trait] + super_traits)
6264
super_traits = ','.join(super_traits)
6365
error_deriving = '#[derive(%s)]' % super_traits if super_traits else ''
6466

6567
errors = '\n'.join('//~%s ERROR' % ('^' * n) for n in range(error_count))
66-
code = string.format(traits = all_traits, errors = errors)
67-
return TEMPLATE.format(error_deriving=error_deriving, code = code)
68+
code = string.format(traits=all_traits, errors=errors)
69+
return TEMPLATE.format(error_deriving=error_deriving, code=code)
70+
6871

6972
def write_file(name, string):
7073
test_file = os.path.join(TEST_DIR, 'derives-span-%s.rs' % name)
@@ -86,10 +89,10 @@ def write_file(name, string):
8689

8790
traits = {
8891
'Default': (STRUCT, [], 1),
89-
'FromPrimitive': (0, [], 0), # only works for C-like enums
92+
'FromPrimitive': (0, [], 0), # only works for C-like enums
9093

91-
'Decodable': (0, [], 0), # FIXME: quoting gives horrible spans
92-
'Encodable': (0, [], 0), # FIXME: quoting gives horrible spans
94+
'Decodable': (0, [], 0), # FIXME: quoting gives horrible spans
95+
'Encodable': (0, [], 0), # FIXME: quoting gives horrible spans
9396
}
9497

9598
for (trait, supers, errs) in [('Clone', [], 1),

src/etc/generate-keyword-tests.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import sys
1313
import os
14-
import datetime
1514
import stat
1615

1716

0 commit comments

Comments
 (0)