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 7 pull requests #36684

Merged
merged 29 commits into from
Sep 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0d3d23b
add stronger warning to CString::from_raw
durka Aug 26, 2016
d742894
Fix wording for out-of-crate macro error
Sep 15, 2016
b19c9ec
This installs documentation not man pages
Sep 15, 2016
a6d804e
Browsers do not consistently handle non-integer values for font-size.
grimreaper Sep 18, 2016
8de97dd
simplify python code
grimreaper Sep 18, 2016
f7811c1
Fix order of @import
grimreaper Sep 18, 2016
266ef88
pep8 prefers triple quoted with double quotes
grimreaper Sep 18, 2016
1a67298
prefer tuple to array
grimreaper Sep 18, 2016
3545785
Remove unused code
grimreaper Sep 18, 2016
733fe1d
make functions static where possible
grimreaper Sep 18, 2016
22c66c4
modern style classes
grimreaper Sep 18, 2016
1a4a723
remove useless semicolon from python
grimreaper Sep 18, 2016
73d2653
duplicate the
grimreaper Sep 18, 2016
101d987
add missing semi-colon
grimreaper Sep 18, 2016
ccb78d2
border-color > border
grimreaper Sep 18, 2016
4f11a39
invisible isn't a tag
grimreaper Sep 18, 2016
9c3cf06
inherit from object
grimreaper Sep 18, 2016
fad6a09
remove duplicate duplicate words
grimreaper Sep 18, 2016
0c252ff
per timnn
grimreaper Sep 18, 2016
e0d554a
Add regression test for #9837.
frewsxcv Sep 18, 2016
313fb8f
Replace 'e.g.' by 'i.e.'
GuillaumeGomez Sep 19, 2016
3b97344
Minor `VecDeque` doc examples cleanup.
frewsxcv Sep 23, 2016
f45283b
Rollup merge of #36018 - durka:patch-28, r=steveklabnik
GuillaumeGomez Sep 23, 2016
f17bdb7
Rollup merge of #36498 - jonathandturner:macro_std_lib, r=nikomatsakis
GuillaumeGomez Sep 23, 2016
677ede2
Rollup merge of #36500 - orbea:docdir, r=nikomatsakis
GuillaumeGomez Sep 23, 2016
d56b116
Rollup merge of #36559 - grimreaper:eax/fix/r1, r=nikomatsakis
GuillaumeGomez Sep 23, 2016
9b7c375
Rollup merge of #36566 - frewsxcv:9837, r=nikomatsakis
GuillaumeGomez Sep 23, 2016
812f908
Rollup merge of #36578 - GuillaumeGomez:fix_typo, r=steveklabnik
GuillaumeGomez Sep 23, 2016
f342ece
Rollup merge of #36664 - frewsxcv:vec-deque, r=GuillaumeGomez
GuillaumeGomez Sep 23, 2016
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
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
valopt_nosave host "${CFG_BUILD}" "GNUs ./configure syntax LLVM host triples"
valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
valopt_nosave mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
valopt_nosave docdir "${CFG_PREFIX}/share/doc/rust" "install man pages in PATH"
valopt_nosave docdir "${CFG_PREFIX}/share/doc/rust" "install documentation in PATH"

# On Windows this determines root of the subtree for target libraries.
# Host runtime libs always go to 'bin'.
Expand Down
11 changes: 6 additions & 5 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def stage0_data(rust_root):
def format_build_time(duration):
return str(datetime.timedelta(seconds=int(duration)))

class RustBuild:

class RustBuild(object):
def download_stage0(self):
cache_dst = os.path.join(self.build_dir, "cache")
rustc_cache = os.path.join(cache_dst, self.stage0_rustc_date())
Expand All @@ -142,7 +143,7 @@ def download_stage0(self):
os.makedirs(cargo_cache)

if self.rustc().startswith(self.bin_root()) and \
(not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
(not os.path.exists(self.rustc()) or self.rustc_out_of_date()):
if os.path.exists(self.bin_root()):
shutil.rmtree(self.bin_root())
channel = self.stage0_rustc_channel()
Expand All @@ -165,7 +166,7 @@ def download_stage0(self):
f.write(self.stage0_rustc_date())

if self.cargo().startswith(self.bin_root()) and \
(not os.path.exists(self.cargo()) or self.cargo_out_of_date()):
(not os.path.exists(self.cargo()) or self.cargo_out_of_date()):
channel = self.stage0_cargo_channel()
filename = "cargo-{}-{}.tar.gz".format(channel, self.build)
url = "https://static.rust-lang.org/cargo-dist/" + self.stage0_cargo_date()
Expand Down Expand Up @@ -238,8 +239,8 @@ def rustc(self):

def get_string(self, line):
start = line.find('"')
end = start + 1 + line[start+1:].find('"')
return line[start+1:end]
end = start + 1 + line[start + 1:].find('"')
return line[start + 1:end]

def exe_suffix(self):
if sys.platform == 'win32':
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rust.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ em {

footer {
border-top: 1px solid #ddd;
font-size: 14.3px;
font-size: 14px;
font-style: italic;
padding-top: 5px;
margin-top: 3em;
Expand Down
2 changes: 1 addition & 1 deletion src/etc/debugger_pretty_printers_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def extract_length_and_ptr_from_slice(slice_val):
UNQUALIFIED_TYPE_MARKERS = frozenset(["(", "[", "&", "*"])

def extract_type_name(qualified_type_name):
'''Extracts the type name from a fully qualified path'''
"""Extracts the type name from a fully qualified path"""
if qualified_type_name[0] in UNQUALIFIED_TYPE_MARKERS:
return qualified_type_name

Expand Down
20 changes: 11 additions & 9 deletions src/etc/gdb_rust_pretty_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def rust_pretty_printer_lookup_function(gdb_val):
#=------------------------------------------------------------------------------
# Pretty Printer Classes
#=------------------------------------------------------------------------------
class RustStructPrinter:
class RustStructPrinter(object):
def __init__(self, val, omit_first_field, omit_type_name, is_tuple_like):
self.__val = val
self.__omit_first_field = omit_first_field
Expand Down Expand Up @@ -205,11 +205,12 @@ def display_hint(self):
return ""


class RustSlicePrinter:
class RustSlicePrinter(object):
def __init__(self, val):
self.__val = val

def display_hint(self):
@staticmethod
def display_hint():
return "array"

def to_string(self):
Expand All @@ -226,7 +227,7 @@ def children(self):
yield (str(index), (raw_ptr + index).dereference())


class RustStringSlicePrinter:
class RustStringSlicePrinter(object):
def __init__(self, val):
self.__val = val

Expand All @@ -236,11 +237,12 @@ def to_string(self):
return '"%s"' % raw_ptr.string(encoding="utf-8", length=length)


class RustStdVecPrinter:
class RustStdVecPrinter(object):
def __init__(self, val):
self.__val = val

def display_hint(self):
@staticmethod
def display_hint():
return "array"

def to_string(self):
Expand All @@ -255,7 +257,7 @@ def children(self):
yield (str(index), (gdb_ptr + index).dereference())


class RustStdStringPrinter:
class RustStdStringPrinter(object):
def __init__(self, val):
self.__val = val

Expand All @@ -266,7 +268,7 @@ def to_string(self):
length=length)


class RustCStyleVariantPrinter:
class RustCStyleVariantPrinter(object):
def __init__(self, val):
assert val.type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_ENUM
self.__val = val
Expand All @@ -275,7 +277,7 @@ def to_string(self):
return str(self.__val.get_wrapped_value())


class IdentityPrinter:
class IdentityPrinter(object):
def __init__(self, string):
self.string = string

Expand Down
6 changes: 3 additions & 3 deletions src/etc/lldb_batchmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@


def print_debug(s):
"Print something if DEBUG_OUTPUT is True"
"""Print something if DEBUG_OUTPUT is True"""
global DEBUG_OUTPUT
if DEBUG_OUTPUT:
print("DEBUG: " + str(s))


def normalize_whitespace(s):
"Replace newlines, tabs, multiple spaces, etc with exactly one space"
"""Replace newlines, tabs, multiple spaces, etc with exactly one space"""
return re.sub("\s+", " ", s)


Expand All @@ -71,7 +71,7 @@ def breakpoint_callback(frame, bp_loc, dict):


def execute_command(command_interpreter, command):
"Executes a single CLI command"
"""Executes a single CLI command"""
global new_breakpoints
global registered_breakpoints

Expand Down
10 changes: 5 additions & 5 deletions src/etc/lldb_rust_formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ def print_val(lldb_val, internal_dict):
#=--------------------------------------------------------------------------------------------------

def print_struct_val(val, internal_dict, omit_first_field, omit_type_name, is_tuple_like):
'''
"""
Prints a struct, tuple, or tuple struct value with Rust syntax.
Ignores any fields before field_start_index.
'''
"""
assert val.type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_STRUCT

if omit_type_name:
Expand Down Expand Up @@ -221,7 +221,7 @@ def render_child(child_index):
"body": body}

def print_pointer_val(val, internal_dict):
'''Prints a pointer value with Rust syntax'''
"""Prints a pointer value with Rust syntax"""
assert val.type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_PTR
sigil = "&"
type_name = val.type.get_unqualified_type_name()
Expand Down Expand Up @@ -275,8 +275,8 @@ def print_std_string_val(val, internal_dict):
#=--------------------------------------------------------------------------------------------------

def print_array_of_values(array_name, data_ptr_val, length, internal_dict):
'''Prints a contigous memory range, interpreting it as values of the
pointee-type of data_ptr_val.'''
"""Prints a contigous memory range, interpreting it as values of the
pointee-type of data_ptr_val."""

data_ptr_type = data_ptr_val.type
assert data_ptr_type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_PTR
Expand Down
31 changes: 20 additions & 11 deletions src/etc/platform-intrinsics/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,19 @@ class Void(Type):
def __init__(self):
Type.__init__(self, 0)

def compiler_ctor(self):
@staticmethod
def compiler_ctor():
return '::VOID'

def compiler_ctor_ref(self):
return '&' + self.compiler_ctor()

def rust_name(self):
@staticmethod
def rust_name():
return '()'

def type_info(self, platform_info):
@staticmethod
def type_info(platform_info):
return None

def __eq__(self, other):
Expand Down Expand Up @@ -282,7 +285,7 @@ def __eq__(self, other):

class Pointer(Type):
def __init__(self, elem, llvm_elem, const):
self._elem = elem;
self._elem = elem
self._llvm_elem = llvm_elem
self._const = const
Type.__init__(self, BITWIDTH_POINTER)
Expand Down Expand Up @@ -503,7 +506,7 @@ def monomorphise(self):
# must be a power of two
assert width & (width - 1) == 0
def recur(processed, untouched):
if untouched == []:
if not untouched:
ret = processed[0]
args = processed[1:]
yield MonomorphicIntrinsic(self._platform, self.intrinsic, width,
Expand Down Expand Up @@ -756,22 +759,26 @@ class ExternBlock(object):
def __init__(self):
pass

def open(self, platform):
@staticmethod
def open(platform):
return 'extern "platform-intrinsic" {'

def render(self, mono):
@staticmethod
def render(mono):
return ' fn {}{}{};'.format(mono.platform_prefix(),
mono.intrinsic_name(),
mono.intrinsic_signature())

def close(self):
@staticmethod
def close():
return '}'

class CompilerDefs(object):
def __init__(self):
pass

def open(self, platform):
@staticmethod
def open(platform):
return '''\
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
Expand All @@ -798,7 +805,8 @@ def open(self, platform):
if !name.starts_with("{0}") {{ return None }}
Some(match &name["{0}".len()..] {{'''.format(platform.platform_prefix())

def render(self, mono):
@staticmethod
def render(mono):
return '''\
"{}" => Intrinsic {{
inputs: {{ static INPUTS: [&'static Type; {}] = [{}]; &INPUTS }},
Expand All @@ -810,7 +818,8 @@ def render(self, mono):
mono.compiler_ret(),
mono.llvm_name())

def close(self):
@staticmethod
def close():
return '''\
_ => return None,
})
Expand Down
2 changes: 0 additions & 2 deletions src/etc/test-float-parse/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,13 @@ def run(test):


def interact(proc, queue):
line = ""
n = 0
while proc.poll() is None:
line = proc.stdout.readline()
if not line:
continue
assert line.endswith('\n'), "incomplete line: " + repr(line)
queue.put(line)
line = ""
n += 1
if n % UPDATE_EVERY_N == 0:
msg("got", str(n // 1000) + "k", "records")
Expand Down
24 changes: 12 additions & 12 deletions src/etc/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,28 @@ def load_unicode_data(f):
canon_decomp = {}
compat_decomp = {}

udict = {};
range_start = -1;
udict = {}
range_start = -1
for line in fileinput.input(f):
data = line.split(';');
data = line.split(';')
if len(data) != 15:
continue
cp = int(data[0], 16);
cp = int(data[0], 16)
if is_surrogate(cp):
continue
if range_start >= 0:
for i in xrange(range_start, cp):
udict[i] = data;
range_start = -1;
udict[i] = data
range_start = -1
if data[1].endswith(", First>"):
range_start = cp;
continue;
udict[cp] = data;
range_start = cp
continue
udict[cp] = data

for code in udict:
[code_org, name, gencat, combine, bidi,
(code_org, name, gencat, combine, bidi,
decomp, deci, digit, num, mirror,
old, iso, upcase, lowcase, titlecase ] = udict[code];
old, iso, upcase, lowcase, titlecase) = udict[code]

# generate char to char direct common and simple conversions
# uppercase to lowercase
Expand Down Expand Up @@ -382,7 +382,7 @@ def emit_bool_trie(f, name, t_data, is_pub=True):
global bytes_old, bytes_new
bytes_old += 8 * len(t_data)
CHUNK = 64
rawdata = [False] * 0x110000;
rawdata = [False] * 0x110000
for (lo, hi) in t_data:
for cp in range(lo, hi + 1):
rawdata[cp] = True
Expand Down
10 changes: 5 additions & 5 deletions src/libcollections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,18 +726,18 @@ impl<T> VecDeque<T> {
/// ```
/// use std::collections::VecDeque;
///
/// let mut vector: VecDeque<u32> = VecDeque::new();
/// let mut vector = VecDeque::new();
///
/// vector.push_back(0);
/// vector.push_back(1);
/// vector.push_back(2);
///
/// assert_eq!(vector.as_slices(), (&[0u32, 1, 2] as &[u32], &[] as &[u32]));
/// assert_eq!(vector.as_slices(), (&[0, 1, 2][..], &[][..]));
///
/// vector.push_front(10);
/// vector.push_front(9);
///
/// assert_eq!(vector.as_slices(), (&[9u32, 10] as &[u32], &[0u32, 1, 2] as &[u32]));
/// assert_eq!(vector.as_slices(), (&[9, 10][..], &[0, 1, 2][..]));
/// ```
#[inline]
#[stable(feature = "deque_extras_15", since = "1.5.0")]
Expand All @@ -764,7 +764,7 @@ impl<T> VecDeque<T> {
/// ```
/// use std::collections::VecDeque;
///
/// let mut vector: VecDeque<u32> = VecDeque::new();
/// let mut vector = VecDeque::new();
///
/// vector.push_back(0);
/// vector.push_back(1);
Expand All @@ -774,7 +774,7 @@ impl<T> VecDeque<T> {
///
/// vector.as_mut_slices().0[0] = 42;
/// vector.as_mut_slices().1[0] = 24;
/// assert_eq!(vector.as_slices(), (&[42u32, 10] as &[u32], &[24u32, 1] as &[u32]));
/// assert_eq!(vector.as_slices(), (&[42, 10][..], &[24, 1][..]));
/// ```
#[inline]
#[stable(feature = "deque_extras_15", since = "1.5.0")]
Expand Down
Loading