Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #69088

Merged
merged 45 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3998249
remove unnecessary local variable assignment in context manager
chrissimpkins Feb 8, 2020
19aaf63
PEP8 format spacing
chrissimpkins Feb 8, 2020
6ce8d2b
PEP8 format spacing
chrissimpkins Feb 8, 2020
adde3d4
PEP8 format spacing
chrissimpkins Feb 8, 2020
60889d4
remove unnecessary semicolons
chrissimpkins Feb 8, 2020
e30dd86
PEP8 format spacing
chrissimpkins Feb 8, 2020
f38e270
remove unnecessary sys import
chrissimpkins Feb 8, 2020
d366343
PEP8 format spacing
chrissimpkins Feb 8, 2020
a53f45f
PEP8 format spacing, split import statements
chrissimpkins Feb 8, 2020
8d04b95
remove unnecessary import statement
chrissimpkins Feb 8, 2020
85e3661
PEP8 format spacing, remove unnecessary local variable assignment
chrissimpkins Feb 8, 2020
814aa06
PEP8 format spacing
chrissimpkins Feb 8, 2020
9b10fc4
remove unnecessary import statement, PEP8 format spacing
chrissimpkins Feb 8, 2020
77d158d
shorten comment blocks to < 100 characters
chrissimpkins Feb 8, 2020
25de80a
Remove common usage pattern from `AllocRef`
TimDiekmann Feb 10, 2020
97d1f8d
Add missing `_zeroed` varants to `AllocRef`
TimDiekmann Feb 10, 2020
a47fdb9
Support linking from a .rlink file
Jan 23, 2020
76aa29f
Preparation for allocator aware `Box`
TimDiekmann Feb 11, 2020
3b23d22
remove some dependencies on itertools
andjo403 Feb 11, 2020
3884311
Add self to .mailmap
Bassetts Feb 11, 2020
8e26ad0
Keyword docs
Feb 11, 2020
60aaf90
Move macro enum_from_u32 to rustc_data_structures.
cjgillot Jan 30, 2020
a056817
Move hir::check_attr::Target to librustc_lang_items.
cjgillot Jan 26, 2020
ff36923
Move lang_items definitions to librustc_lang_items.
cjgillot Jan 26, 2020
c04195d
Move get_lang_items query in librustc_passes.
cjgillot Jan 31, 2020
4ecba94
Move weak lang items to librustc_lang_items.
cjgillot Jan 26, 2020
98b46f7
Move weak_lang_items.rs to librustc_passes.
cjgillot Jan 1, 2020
b6f875d
Move weak_lang_items checking to librustc_passes.
cjgillot Dec 28, 2019
443a42a
Nits.
cjgillot Jan 26, 2020
d3b2385
Move it all into rustc_hir.
cjgillot Jan 30, 2020
513eb74
Merge rustc::middle::*lang_items.
cjgillot Jan 30, 2020
fc73e19
Review comments.
cjgillot Feb 11, 2020
ee52fe6
Test failure of unchecked arithmetic intrinsics in const eval
ecstatic-morse Feb 10, 2020
c1ed84e
Fix outdated doc comment.
jumbatm Feb 11, 2020
b6a9aa9
Rollup merge of #67695 - gilescope:truth, r=centril
JohnTitor Feb 12, 2020
344f8d9
Rollup merge of #68487 - 0dvictor:nolink, r=tmandry
JohnTitor Feb 12, 2020
19b0c00
Rollup merge of #68554 - cjgillot:lang_items, r=Zoxc
JohnTitor Feb 12, 2020
4b82b51
Rollup merge of #68937 - ecstatic-morse:unchecked-intrinsics-test, r=…
JohnTitor Feb 12, 2020
931005d
Rollup merge of #68947 - chrissimpkins:python-fmt, r=alexcrichton
JohnTitor Feb 12, 2020
9b51a52
Rollup merge of #68999 - andjo403:itertools, r=Centril
JohnTitor Feb 12, 2020
9bc003d
Rollup merge of #69026 - TimDiekmann:common-usage, r=Amanieu
JohnTitor Feb 12, 2020
a50ccd9
Rollup merge of #69027 - TimDiekmann:zeroed-alloc, r=Amanieu
JohnTitor Feb 12, 2020
5fbfaac
Rollup merge of #69058 - TimDiekmann:box, r=Amanieu
JohnTitor Feb 12, 2020
77a3245
Rollup merge of #69070 - Bassetts:master, r=alexcrichton
JohnTitor Feb 12, 2020
486856f
Rollup merge of #69077 - jumbatm:fix-comment, r=Dylan-DPC
JohnTitor Feb 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ James Deng <[email protected]> <[email protected]>
James Miller <[email protected]> <[email protected]>
James Perry <[email protected]>
Jason Fager <[email protected]>
Jason Liquorish <[email protected]> <[email protected]>
Jason Orendorff <[email protected]> <[email protected]>
Jason Orendorff <[email protected]> <[email protected]>
Jason Toffaletti <[email protected]> Jason Toffaletti <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3552,6 +3552,7 @@ dependencies = [
"log",
"rustc",
"rustc_ast_pretty",
"rustc_codegen_ssa",
"rustc_codegen_utils",
"rustc_data_structures",
"rustc_error_codes",
Expand Down Expand Up @@ -3629,6 +3630,7 @@ version = "0.0.0"
name = "rustc_hir"
version = "0.0.0"
dependencies = [
"lazy_static 1.4.0",
"rustc_ast_pretty",
"rustc_data_structures",
"rustc_errors",
Expand Down Expand Up @@ -3748,7 +3750,6 @@ dependencies = [
name = "rustc_macros"
version = "0.1.0"
dependencies = [
"itertools 0.8.0",
"proc-macro2 1.0.3",
"quote 1.0.2",
"syn 1.0.11",
Expand Down Expand Up @@ -3812,7 +3813,6 @@ name = "rustc_mir_build"
version = "0.0.0"
dependencies = [
"arena",
"itertools 0.8.0",
"log",
"rustc",
"rustc_apfloat",
Expand Down
9 changes: 4 additions & 5 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _download(path, url, probably_big, verbose, exception):
option = "-s"
run(["curl", option,
"-y", "30", "-Y", "10", # timeout if speed is < 10 bytes/sec for > 30 seconds
"--connect-timeout", "30", # timeout if cannot connect within 30 seconds
"--connect-timeout", "30", # timeout if cannot connect within 30 seconds
"--retry", "3", "-Sf", "-o", path, url],
verbose=verbose,
exception=exception)
Expand Down Expand Up @@ -332,7 +332,6 @@ def __init__(self):
self.use_vendored_sources = ''
self.verbose = False


def download_stage0(self):
"""Fetch the build system for Rust, written in Rust

Expand All @@ -351,7 +350,7 @@ def support_xz():
try:
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
temp_path = temp_file.name
with tarfile.open(temp_path, "w:xz") as tar:
with tarfile.open(temp_path, "w:xz"):
pass
return True
except tarfile.CompressionError:
Expand Down Expand Up @@ -825,7 +824,7 @@ def check_vendored_status(self):
if not os.path.exists(vendor_dir):
print('error: vendoring required, but vendor directory does not exist.')
print(' Run `cargo vendor` without sudo to initialize the '
'vendor directory.')
'vendor directory.')
raise Exception("{} not found".format(vendor_dir))

if self.use_vendored_sources:
Expand All @@ -839,7 +838,7 @@ def check_vendored_status(self):
"\n"
"[source.vendored-sources]\n"
"directory = '{}/vendor'\n"
.format(self.rust_root))
.format(self.rust_root))
else:
if os.path.exists('.cargo'):
shutil.rmtree('.cargo')
Expand Down
11 changes: 6 additions & 5 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,12 @@ def set(key, value):


def is_number(value):
try:
float(value)
return True
except ValueError:
return False
try:
float(value)
return True
except ValueError:
return False


# Here we walk through the constructed configuration we have from the parsed
# command line arguments. We then apply each piece of configuration by
Expand Down
6 changes: 3 additions & 3 deletions src/ci/cpu-usage-over-time.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def idle_since(self, prev):
print('unknown platform', sys.platform)
sys.exit(1)

cur_state = State();
cur_state = State()
print("Time,Idle")
while True:
time.sleep(1);
next_state = State();
time.sleep(1)
next_state = State()
now = datetime.datetime.utcnow().isoformat()
idle = next_state.idle_since(cur_state)
print("%s,%s" % (now, idle))
Expand Down
6 changes: 4 additions & 2 deletions src/etc/debugger_pretty_printers_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ def __classify_struct(self):
# REGULAR STRUCT
return TYPE_KIND_REGULAR_STRUCT


def __classify_union(self):
assert self.get_dwarf_type_kind() == DWARF_TYPE_CODE_UNION

Expand All @@ -233,7 +232,6 @@ def __classify_union(self):
else:
return TYPE_KIND_REGULAR_UNION


def __conforms_to_field_layout(self, expected_fields):
actual_fields = self.get_fields()
actual_field_count = len(actual_fields)
Expand Down Expand Up @@ -363,6 +361,7 @@ def extract_tail_head_ptr_and_cap_from_std_vecdeque(vec_val):
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
return (tail, head, data_ptr, capacity)


def extract_length_and_ptr_from_slice(slice_val):
assert (slice_val.type.get_type_kind() == TYPE_KIND_SLICE or
slice_val.type.get_type_kind() == TYPE_KIND_STR_SLICE)
Expand All @@ -376,8 +375,10 @@ def extract_length_and_ptr_from_slice(slice_val):
assert data_ptr.type.get_dwarf_type_kind() == DWARF_TYPE_CODE_PTR
return (length, data_ptr)


UNQUALIFIED_TYPE_MARKERS = frozenset(["(", "[", "&", "*"])


def extract_type_name(qualified_type_name):
"""Extracts the type name from a fully qualified path"""
if qualified_type_name[0] in UNQUALIFIED_TYPE_MARKERS:
Expand All @@ -393,6 +394,7 @@ def extract_type_name(qualified_type_name):
else:
return qualified_type_name[index + 2:]


try:
compat_str = unicode # Python 2
except NameError:
Expand Down
2 changes: 1 addition & 1 deletion src/etc/dec2flt_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
even larger, and it's already uncomfortably large (6 KiB).
"""
from __future__ import print_function
import sys
from math import ceil, log
from fractions import Fraction
from collections import namedtuple
Expand Down Expand Up @@ -82,6 +81,7 @@ def error(f, e, z):
ulp_err = abs_err / Fraction(2) ** z.exp
return float(ulp_err)


HEADER = """
//! Tables of approximations of powers of ten.
//! DO NOT MODIFY: Generated by `src/etc/dec2flt_table.py`
Expand Down
43 changes: 23 additions & 20 deletions src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
if sys.version_info[0] >= 3:
xrange = range

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

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

#===============================================================================
# ===============================================================================
# GDB Pretty Printing Module for Rust
#===============================================================================
# ===============================================================================


class GdbType(rustpp.Type):

Expand Down Expand Up @@ -133,39 +134,39 @@ def rust_pretty_printer_lookup_function(gdb_val):

if type_kind == rustpp.TYPE_KIND_REGULAR_STRUCT:
return RustStructPrinter(val,
omit_first_field = False,
omit_type_name = False,
is_tuple_like = False)
omit_first_field=False,
omit_type_name=False,
is_tuple_like=False)

if type_kind == rustpp.TYPE_KIND_STRUCT_VARIANT:
return RustStructPrinter(val,
omit_first_field = True,
omit_type_name = False,
is_tuple_like = False)
omit_first_field=True,
omit_type_name=False,
is_tuple_like=False)

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

if type_kind == rustpp.TYPE_KIND_TUPLE:
return RustStructPrinter(val,
omit_first_field = False,
omit_type_name = True,
is_tuple_like = True)
omit_first_field=False,
omit_type_name=True,
is_tuple_like=True)

if type_kind == rustpp.TYPE_KIND_TUPLE_STRUCT:
return RustStructPrinter(val,
omit_first_field = False,
omit_type_name = False,
is_tuple_like = True)
omit_first_field=False,
omit_type_name=False,
is_tuple_like=True)

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

if type_kind == rustpp.TYPE_KIND_TUPLE_VARIANT:
return RustStructPrinter(val,
omit_first_field = True,
omit_type_name = False,
is_tuple_like = True)
omit_first_field=True,
omit_type_name=False,
is_tuple_like=True)

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


#=------------------------------------------------------------------------------
# =------------------------------------------------------------------------------
# Pretty Printer Classes
#=------------------------------------------------------------------------------
# =------------------------------------------------------------------------------
class RustEmptyPrinter(object):
def __init__(self, val):
self.__val = val
Expand Down Expand Up @@ -355,6 +356,7 @@ def children_of_node(boxed_node, height, want_values):
else:
yield keys[i]['value']['value']


class RustStdBTreeSetPrinter(object):
def __init__(self, val):
self.__val = val
Expand Down Expand Up @@ -429,6 +431,7 @@ def to_string(self):
def display_hint(self):
return "string"


class RustCStyleVariantPrinter(object):
def __init__(self, val):
assert val.type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_ENUM
Expand Down
15 changes: 9 additions & 6 deletions src/etc/generate-deriving-span-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
sample usage: src/etc/generate-deriving-span-tests.py
"""

import os, stat
import os
import stat

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

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


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

errors = '\n'.join('//~%s ERROR' % ('^' * n) for n in range(error_count))
code = string.format(traits = all_traits, errors = errors)
return TEMPLATE.format(error_deriving=error_deriving, code = code)
code = string.format(traits=all_traits, errors=errors)
return TEMPLATE.format(error_deriving=error_deriving, code=code)


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

traits = {
'Default': (STRUCT, [], 1),
'FromPrimitive': (0, [], 0), # only works for C-like enums
'FromPrimitive': (0, [], 0), # only works for C-like enums

'Decodable': (0, [], 0), # FIXME: quoting gives horrible spans
'Encodable': (0, [], 0), # FIXME: quoting gives horrible spans
'Decodable': (0, [], 0), # FIXME: quoting gives horrible spans
'Encodable': (0, [], 0), # FIXME: quoting gives horrible spans
}

for (trait, supers, errs) in [('Clone', [], 1),
Expand Down
1 change: 0 additions & 1 deletion src/etc/generate-keyword-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import sys
import os
import datetime
import stat


Expand Down
Loading