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 #69056

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
91cf0e7
Don't requery the param_env of a union
matthewjasper Jan 30, 2020
570c161
Remove unnecessary features in rustc_ty
matthewjasper Jan 30, 2020
3973322
Add IS_MANUALLY_DROP to AdtFlags
matthewjasper Jan 30, 2020
d196521
Improve needs_drop query
matthewjasper Jan 30, 2020
d20646b
Address review comments
matthewjasper Jan 31, 2020
465b862
Use correct `ParamEnv` in `Instance::resolve`
matthewjasper Feb 1, 2020
6bf2cc2
Avoid instantiating many `Parser` structs in `generic_extension`.
nnethercote Feb 4, 2020
f840a95
Remove the `Cow` from `Directory`.
nnethercote Feb 5, 2020
2a13b24
Change condition ordering in `parse_tt`.
nnethercote Feb 5, 2020
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
3eb5241
Apply suggestions from code review
matthewjasper Feb 9, 2020
842938a
cache adt_drop_tys
matthewjasper Feb 9, 2020
202d401
miri: simplify singed operator overflow detection
RalfJung Feb 9, 2020
28f85c6
bring back extra check for int_min%-1
RalfJung Feb 9, 2020
7d2f6ae
miri: equip unary_op with overflow detection
RalfJung Feb 8, 2020
ae23f70
const-prop: use overflowing_unary_op for overflowing checking of unar…
RalfJung Feb 9, 2020
b434d7e
add test that checks overflows on arithmetic operators
RalfJung Feb 10, 2020
1ddb050
div/rem overflow tests: also test i128
RalfJung Feb 10, 2020
d6c5a04
some more tests for i128 oveflow behavior
RalfJung Feb 10, 2020
b8893df
preallocate 2 Vecs in traits; tweak WfPredicates::normalize
ljedrz Feb 10, 2020
9e78ce0
handle TerminatorKind::Yield by returning Err(Unpromotable)
chrissimpkins Feb 10, 2020
75afd0b
use `dyn Trait` more in tests
Centril Feb 10, 2020
fc3ecb2
add issue 69017 test
chrissimpkins Feb 10, 2020
8d79921
parser: Remove `Parser::prev_token_kind`
petrochenkov Feb 10, 2020
25de80a
Remove common usage pattern from `AllocRef`
TimDiekmann Feb 10, 2020
97d1f8d
Add missing `_zeroed` varants to `AllocRef`
TimDiekmann Feb 10, 2020
53b16fb
add main function to issue-69017 test
chrissimpkins Feb 10, 2020
c561d23
remove outdated comment
RalfJung Feb 10, 2020
c38b4b6
Specify opt-level in test
matthewjasper Feb 10, 2020
6575abc
Don't rustfmt the vendor directory.
ehuss Feb 11, 2020
98b3d21
Rollup merge of #68679 - matthewjasper:needs-type-op, r=varkor
jonas-schievink Feb 11, 2020
2125b06
Rollup merge of #68848 - nnethercote:hasten-macro-parsing, r=petroche…
jonas-schievink Feb 11, 2020
7b4772a
Rollup merge of #68947 - chrissimpkins:python-fmt, r=alexcrichton
jonas-schievink Feb 11, 2020
98e8d78
Rollup merge of #69002 - RalfJung:miri-op-overflow, r=oli-obk,wesleyw…
jonas-schievink Feb 11, 2020
cede9c1
Rollup merge of #69022 - ljedrz:traits_tweak_vecs, r=petrochenkov
jonas-schievink Feb 11, 2020
fc25e05
Rollup merge of #69026 - TimDiekmann:common-usage, r=Amanieu
jonas-schievink Feb 11, 2020
9e72cc8
Rollup merge of #69027 - TimDiekmann:zeroed-alloc, r=Amanieu
jonas-schievink Feb 11, 2020
ff8d628
Rollup merge of #69031 - Centril:dyntest, r=eddyb
jonas-schievink Feb 11, 2020
3cf7cd8
Rollup merge of #69032 - chrissimpkins:ice-yield-println-#69017, r=pe…
jonas-schievink Feb 11, 2020
8fcb1a3
Rollup merge of #69034 - petrochenkov:notokind, r=Centril
jonas-schievink Feb 11, 2020
4f1f2b5
Rollup merge of #69047 - ehuss:rustfmt-vendor, r=Centril
jonas-schievink Feb 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions rustfmt.toml
Expand Up @@ -7,6 +7,7 @@ merge_derives = false
# tidy only checks files which are not ignored, each entry follows gitignore style
ignore = [
"build",
"/vendor/",

# tests for now are not formatted, as they are sometimes pretty-printing constrained
# (and generally rustfmt can move around comments in UI-testing incompatible ways)
Expand Down
9 changes: 4 additions & 5 deletions src/bootstrap/bootstrap.py
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
Expand Up @@ -392,11 +392,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
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
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
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
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
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
Expand Up @@ -11,7 +11,6 @@

import sys
import os
import datetime
import stat


Expand Down