Auto merge of #34689 - alexcrichton:fix-nightlies, r=alexcrichton

First attempt to fix nightlies

This is just https://github.com/rust-lang/rust/pull/34669 but I added some comments so it can land.
This commit is contained in:
bors 2016-07-06 14:05:35 -07:00 committed by GitHub
commit 801d2682df

View File

@ -10,8 +10,15 @@
import gdb
import re
import sys
import debugger_pretty_printers_common as rustpp
# We want a version of `range` which doesn't allocate an intermediate list,
# specifically it should use a lazy iterator. In Python 2 this was `xrange`, but
# if we're running with Python 3 then we need to use `range` instead.
if sys.version_info.major >= 3:
xrange = range
#===============================================================================
# GDB Pretty Printing Module for Rust
#===============================================================================
@ -215,7 +222,7 @@ class RustSlicePrinter:
assert data_ptr.type.get_dwarf_type_kind() == rustpp.DWARF_TYPE_CODE_PTR
raw_ptr = data_ptr.get_wrapped_value()
for index in range(0, length):
for index in xrange(0, length):
yield (str(index), (raw_ptr + index).dereference())
@ -244,7 +251,7 @@ class RustStdVecPrinter:
def children(self):
(length, data_ptr, cap) = rustpp.extract_length_ptr_and_cap_from_std_vec(self.__val)
gdb_ptr = data_ptr.get_wrapped_value()
for index in range(0, length):
for index in xrange(0, length):
yield (str(index), (gdb_ptr + index).dereference())