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

Closed
wants to merge 62 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
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
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
9e78ce0
handle TerminatorKind::Yield by returning Err(Unpromotable)
chrissimpkins 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
aeedc9d
Corrected ac_mitigation patch. That patch used the untrusted stack to…
raoulstrackx Feb 7, 2020
236ab6e
sanitize MXCSR/FPU control registers
raoulstrackx Feb 7, 2020
71b9ed4
Avoid jumping to Rust code with user %rsp (reentry_panic)
Feb 10, 2020
c561d23
remove outdated comment
RalfJung Feb 10, 2020
b637c0e
Add initial debug fmt for Backtrace
yaahc Feb 10, 2020
4920456
Get vaguely working with a test for checking output
yaahc Feb 10, 2020
c0ba79e
less noisy format
yaahc Feb 10, 2020
0d5444f
remove unnecessary derives
yaahc Feb 10, 2020
76e6d6f
remove unnecessary Debug impl for BacktraceFrame
yaahc Feb 10, 2020
583dd2c
make it compile
yaahc Feb 10, 2020
8711778
final format cleanups
yaahc Feb 10, 2020
70c9133
remove Some from fn name
yaahc Feb 10, 2020
230ed3e
use debug_map and skip empty frames
yaahc Feb 11, 2020
de25048
add nice alt fmt for debug
yaahc Feb 11, 2020
192b103
make symbol printing consistent with backtrace_rs
yaahc Feb 11, 2020
7064a0e
maximum alternative consistency!
yaahc Feb 11, 2020
6797bfd
rule over the code in libstd with an iron fist
yaahc Feb 11, 2020
c8817aa
backwards again, god damnit
yaahc Feb 11, 2020
76aa29f
Preparation for allocator aware `Box`
TimDiekmann Feb 11, 2020
ec8ee7f
remove intentionally failing test
yaahc Feb 11, 2020
3884311
Add self to .mailmap
Bassetts Feb 11, 2020
df85455
Rollup merge of #68848 - nnethercote:hasten-macro-parsing, r=petroche…
jonas-schievink Feb 11, 2020
84de78e
Rollup merge of #68947 - chrissimpkins:python-fmt, r=alexcrichton
jonas-schievink Feb 11, 2020
eca99ba
Rollup merge of #69002 - RalfJung:miri-op-overflow, r=oli-obk,wesleyw…
jonas-schievink Feb 11, 2020
ec82d15
Rollup merge of #69026 - TimDiekmann:common-usage, r=Amanieu
jonas-schievink Feb 11, 2020
6dcfc75
Rollup merge of #69027 - TimDiekmann:zeroed-alloc, r=Amanieu
jonas-schievink Feb 11, 2020
df7f0c5
Rollup merge of #69032 - chrissimpkins:ice-yield-println-#69017, r=pe…
jonas-schievink Feb 11, 2020
29f780a
Rollup merge of #69034 - petrochenkov:notokind, r=Centril
jonas-schievink Feb 11, 2020
39789c9
Rollup merge of #69038 - yaahc:backtrace-debug, r=dtolnay
jonas-schievink Feb 11, 2020
fe61f59
Rollup merge of #69040 - jethrogb:jb/cleanup-sgx-entry, r=nagisa
jonas-schievink Feb 11, 2020
abe9d82
Rollup merge of #69058 - TimDiekmann:box, r=Amanieu
jonas-schievink Feb 11, 2020
dae1a51
Rollup merge of #69070 - Bassetts:master, r=alexcrichton
jonas-schievink Feb 11, 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
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