Skip to content

Commit aa6933a

Browse files
committed
---
yaml --- r: 193821 b: refs/heads/beta c: 1760e87 h: refs/heads/master i: 193819: f50236c v: v3
1 parent cfed3ef commit aa6933a

File tree

148 files changed

+2226
-1789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+2226
-1789
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 90f06ae33fdf34e60c29cbd38dd3ec7be6b3badb
34+
refs/heads/beta: 1760e8749a46d8b64f8411a08a79d90e2b5f966e
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/configure

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,10 @@ case $CFG_CPUTYPE in
461461
CFG_CPUTYPE=aarch64
462462
;;
463463

464-
powerpc)
464+
# At some point, when ppc64[le] support happens, this will need to do
465+
# something clever. For now it's safe to assume that we're only ever
466+
# interested in building 32 bit.
467+
powerpc | ppc | ppc64)
465468
CFG_CPUTYPE=powerpc
466469
;;
467470

@@ -823,11 +826,11 @@ then
823826
LLVM_VERSION=$($LLVM_CONFIG --version)
824827

825828
case $LLVM_VERSION in
826-
(3.[2-6]*)
829+
(3.[5-6]*)
827830
msg "found ok version of LLVM: $LLVM_VERSION"
828831
;;
829832
(*)
830-
err "bad LLVM version: $LLVM_VERSION, need >=3.0svn"
833+
err "bad LLVM version: $LLVM_VERSION, need >=3.5"
831834
;;
832835
esac
833836
fi

branches/beta/mk/llvm.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ $$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
4444
touch -r $$@.start_time $$@ && rm $$@.start_time
4545

4646
ifeq ($$(CFG_ENABLE_LLVM_STATIC_STDCPP),1)
47-
LLVM_STDCPP_LOCATION_$(1) = $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
48-
-print-file-name=libstdc++.a)
47+
LLVM_STDCPP_RUSTFLAGS_$(1) = -L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
48+
-print-file-name=libstdc++.a))"
4949
else
50-
LLVM_STDCPP_LOCATION_$(1) =
50+
LLVM_STDCPP_RUSTFLAGS_$(1) =
5151
endif
5252

5353

branches/beta/mk/main.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)
@@ -290,6 +290,7 @@ LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
290290
LLVM_BINDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --bindir)
291291
LLVM_INCDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --includedir)
292292
LLVM_LIBDIR_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libdir)
293+
LLVM_LIBDIR_RUSTFLAGS_$(1)=-L "$$(LLVM_LIBDIR_$(1))"
293294
LLVM_LIBS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --libs $$(LLVM_COMPONENTS))
294295
LLVM_LDFLAGS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --ldflags)
295296
# On FreeBSD, it may search wrong headers (that are for pre-installed LLVM),

branches/beta/mk/target.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8484
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) \
8585
$$(RUST_LIB_FLAGS_ST$(1)) \
8686
-L "$$(RT_OUTPUT_DIR_$(2))" \
87-
-L "$$(LLVM_LIBDIR_$(2))" \
88-
-L "$$(dir $$(LLVM_STDCPP_LOCATION_$(2)))" \
87+
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
88+
$$(LLVM_STDCPP_RUSTFLAGS_$(2)) \
8989
$$(RUSTFLAGS_$(4)) \
9090
--out-dir $$(@D) \
9191
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \

branches/beta/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
372372
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
373373
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
374374
-L "$$(RT_OUTPUT_DIR_$(2))" \
375-
-L "$$(LLVM_LIBDIR_$(2))" \
375+
$$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \
376376
$$(RUSTFLAGS_$(4))
377377

378378
endef

branches/beta/src/compiletest/compiletest.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#![feature(std_misc)]
2121
#![feature(test)]
2222
#![feature(core)]
23-
#![feature(io)]
2423
#![feature(net)]
2524
#![feature(path_ext)]
2625

@@ -34,7 +33,6 @@ extern crate log;
3433

3534
use std::env;
3635
use std::fs;
37-
use std::old_io;
3836
use std::path::{Path, PathBuf};
3937
use std::thunk::Thunk;
4038
use getopts::{optopt, optflag, reqopt};
@@ -246,7 +244,11 @@ pub fn run_tests(config: &Config) {
246244
// sadly osx needs some file descriptor limits raised for running tests in
247245
// parallel (especially when we have lots and lots of child processes).
248246
// For context, see #8904
249-
old_io::test::raise_fd_limit();
247+
#[allow(deprecated)]
248+
fn raise_fd_limit() {
249+
std::old_io::test::raise_fd_limit();
250+
}
251+
raise_fd_limit();
250252
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
251253
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
252254
env::set_var("__COMPAT_LAYER", "RunAsInvoker");

branches/beta/src/compiletest/runtest.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ use std::io::BufReader;
2626
use std::io::prelude::*;
2727
use std::iter::repeat;
2828
use std::net::TcpStream;
29-
use std::old_io::timer;
3029
use std::path::{Path, PathBuf};
3130
use std::process::{Command, Output, ExitStatus};
3231
use std::str;
@@ -452,7 +451,11 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
452451
.expect(&format!("failed to exec `{:?}`", config.adb_path));
453452
loop {
454453
//waiting 1 second for gdbserver start
455-
timer::sleep(Duration::milliseconds(1000));
454+
#[allow(deprecated)]
455+
fn sleep() {
456+
::std::old_io::timer::sleep(Duration::milliseconds(1000));
457+
}
458+
sleep();
456459
if TcpStream::connect("127.0.0.1:5039").is_ok() {
457460
break
458461
}

branches/beta/src/doc/trpl/closures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ is that a moving closure always takes ownership of all variables that
6868
it uses. Ordinary closures, in contrast, just create a reference into
6969
the enclosing stack frame. Moving closures are most useful with Rust's
7070
concurrency features, and so we'll just leave it at this for
71-
now. We'll talk about them more in the "Threads" section of the guide.
71+
now. We'll talk about them more in the "Concurrency" chapter of the book.
7272

7373
## Accepting closures as arguments
7474

branches/beta/src/doc/trpl/concurrency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ fn main() {
339339
});
340340
}
341341
342-
rx.recv().ok().expect("Could not recieve answer");
342+
rx.recv().ok().expect("Could not receive answer");
343343
}
344344
```
345345

branches/beta/src/doc/trpl/hello-cargo.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ Hello, world!
8585
Bam! We build our project with `cargo build`, and run it with
8686
`./target/debug/hello_world`. This hasn't bought us a whole lot over our simple use
8787
of `rustc`, but think about the future: when our project has more than one
88-
file, we would need to call `rustc` more than once, and pass it a bunch of options to
88+
file, we would need to call `rustc` more than once and pass it a bunch of options to
8989
tell it to build everything together. With Cargo, as our project grows, we can
90-
just `cargo build` and it'll work the right way. When you're project is finally ready for release, you can use `cargo build --release` to compile your crates with optimizations.
90+
just `cargo build`, and it'll work the right way. When your project is finally
91+
ready for release, you can use `cargo build --release` to compile your crates with
92+
optimizations.
9193

9294
You'll also notice that Cargo has created a new file: `Cargo.lock`.
9395

branches/beta/src/doc/trpl/method-syntax.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ impl CircleBuilder {
187187
}
188188
189189
fn coordinate(&mut self, coordinate: f64) -> &mut CircleBuilder {
190-
self.coordinate = coordinate;
191-
self
190+
self.coordinate = coordinate;
191+
self
192192
}
193193
194194
fn radius(&mut self, radius: f64) -> &mut CircleBuilder {
195-
self.radius = radius;
196-
self
195+
self.radius = radius;
196+
self
197197
}
198198
199199
fn finalize(&self) -> Circle {

branches/beta/src/etc/gdb_rust_pretty_printing.py

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ def rust_pretty_printer_lookup_function(val):
2727
if type_code == gdb.TYPE_CODE_STRUCT:
2828
struct_kind = classify_struct(val.type)
2929

30+
if struct_kind == STRUCT_KIND_SLICE:
31+
return RustSlicePrinter(val)
32+
3033
if struct_kind == STRUCT_KIND_STR_SLICE:
3134
return RustStringSlicePrinter(val)
3235

36+
if struct_kind == STRUCT_KIND_STD_VEC:
37+
return RustStdVecPrinter(val)
38+
39+
if struct_kind == STRUCT_KIND_STD_STRING:
40+
return RustStdStringPrinter(val)
41+
3342
if struct_kind == STRUCT_KIND_TUPLE:
3443
return RustTuplePrinter(val)
3544

@@ -172,6 +181,28 @@ def children(self):
172181
def display_hint(self):
173182
return "array"
174183

184+
class RustSlicePrinter:
185+
def __init__(self, val):
186+
self.val = val
187+
188+
def display_hint(self):
189+
return "array"
190+
191+
def to_string(self):
192+
length = int(self.val["length"])
193+
return self.val.type.tag + ("(len: %i)" % length)
194+
195+
def children(self):
196+
cs = []
197+
length = int(self.val["length"])
198+
data_ptr = self.val["data_ptr"]
199+
assert data_ptr.type.code == gdb.TYPE_CODE_PTR
200+
pointee_type = data_ptr.type.target()
201+
202+
for index in range(0, length):
203+
cs.append((str(index), (data_ptr + index).dereference()))
204+
205+
return cs
175206

176207
class RustStringSlicePrinter:
177208
def __init__(self, val):
@@ -181,6 +212,35 @@ def to_string(self):
181212
slice_byte_len = self.val["length"]
182213
return '"%s"' % self.val["data_ptr"].string(encoding="utf-8", length=slice_byte_len)
183214

215+
class RustStdVecPrinter:
216+
def __init__(self, val):
217+
self.val = val
218+
219+
def display_hint(self):
220+
return "array"
221+
222+
def to_string(self):
223+
length = int(self.val["len"])
224+
cap = int(self.val["cap"])
225+
return self.val.type.tag + ("(len: %i, cap: %i)" % (length, cap))
226+
227+
def children(self):
228+
cs = []
229+
(length, data_ptr) = extract_length_and_data_ptr_from_std_vec(self.val)
230+
pointee_type = data_ptr.type.target()
231+
232+
for index in range(0, length):
233+
cs.append((str(index), (data_ptr + index).dereference()))
234+
return cs
235+
236+
class RustStdStringPrinter:
237+
def __init__(self, val):
238+
self.val = val
239+
240+
def to_string(self):
241+
(length, data_ptr) = extract_length_and_data_ptr_from_std_vec(self.val["vec"])
242+
return '"%s"' % data_ptr.string(encoding="utf-8", length=length)
243+
184244

185245
class RustCStyleEnumPrinter:
186246
def __init__(self, val):
@@ -204,19 +264,38 @@ def to_string(self):
204264
STRUCT_KIND_TUPLE_VARIANT = 3
205265
STRUCT_KIND_STRUCT_VARIANT = 4
206266
STRUCT_KIND_CSTYLE_VARIANT = 5
207-
STRUCT_KIND_STR_SLICE = 6
267+
STRUCT_KIND_SLICE = 6
268+
STRUCT_KIND_STR_SLICE = 7
269+
STRUCT_KIND_STD_VEC = 8
270+
STRUCT_KIND_STD_STRING = 9
208271

209272

210273
def classify_struct(type):
274+
# print("\nclassify_struct: tag=%s\n" % type.tag)
211275
if type.tag == "&str":
212276
return STRUCT_KIND_STR_SLICE
213277

278+
if type.tag.startswith("&[") and type.tag.endswith("]"):
279+
return STRUCT_KIND_SLICE
280+
214281
fields = list(type.fields())
215282
field_count = len(fields)
216283

217284
if field_count == 0:
218285
return STRUCT_KIND_REGULAR_STRUCT
219286

287+
if (field_count == 3 and
288+
fields[0].name == "ptr" and
289+
fields[1].name == "len" and
290+
fields[2].name == "cap" and
291+
type.tag.startswith("Vec<")):
292+
return STRUCT_KIND_STD_VEC
293+
294+
if (field_count == 1 and
295+
fields[0].name == "vec" and
296+
type.tag == "String"):
297+
return STRUCT_KIND_STD_STRING
298+
220299
if fields[0].name == "RUST$ENUM$DISR":
221300
if field_count == 1:
222301
return STRUCT_KIND_CSTYLE_VARIANT
@@ -254,3 +333,11 @@ def get_field_at_index(val, index):
254333
return field
255334
i += 1
256335
return None
336+
337+
def extract_length_and_data_ptr_from_std_vec(vec_val):
338+
length = int(vec_val["len"])
339+
vec_ptr_val = vec_val["ptr"]
340+
unique_ptr_val = vec_ptr_val[first_field(vec_ptr_val)]
341+
data_ptr = unique_ptr_val[first_field(unique_ptr_val)]
342+
assert data_ptr.type.code == gdb.TYPE_CODE_PTR
343+
return (length, data_ptr)

branches/beta/src/liballoc/heap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ mod imp {
198198
extern {}
199199

200200
extern {
201+
#[allocator]
201202
fn je_mallocx(size: size_t, flags: c_int) -> *mut c_void;
202203
fn je_rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
203204
fn je_xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;

branches/beta/src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969

7070
#![feature(no_std)]
7171
#![no_std]
72+
#![feature(allocator)]
7273
#![feature(lang_items, unsafe_destructor)]
7374
#![feature(box_syntax)]
7475
#![feature(optin_builtin_traits)]

branches/beta/src/libcollections/btree/node.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,8 @@ impl<K, V> Node<K, V> {
348348
#[inline]
349349
pub fn as_slices<'a>(&'a self) -> (&'a [K], &'a [V]) {
350350
unsafe {(
351-
mem::transmute(raw::Slice {
352-
data: *self.keys as *const K,
353-
len: self.len()
354-
}),
355-
mem::transmute(raw::Slice {
356-
data: *self.vals as *const V,
357-
len: self.len()
358-
})
351+
slice::from_raw_parts(*self.keys, self.len()),
352+
slice::from_raw_parts(*self.vals, self.len()),
359353
)}
360354
}
361355

branches/beta/src/libcollections/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#![feature(unsafe_destructor)]
3434
#![feature(unique)]
3535
#![feature(unsafe_no_drop_flag)]
36+
#![feature(step_by)]
3637
#![cfg_attr(test, feature(rand, rustc_private, test))]
3738
#![cfg_attr(test, allow(deprecated))] // rand
3839

branches/beta/src/libcollections/slice.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ use core::clone::Clone;
9292
use core::cmp::Ordering::{self, Greater, Less};
9393
use core::cmp::{self, Ord, PartialEq};
9494
use core::iter::{Iterator, IteratorExt};
95-
use core::iter::{range_step, MultiplicativeIterator};
95+
use core::iter::MultiplicativeIterator;
9696
use core::marker::Sized;
9797
use core::mem::size_of;
9898
use core::mem;
@@ -1387,7 +1387,7 @@ fn merge_sort<T, F>(v: &mut [T], mut compare: F) where F: FnMut(&T, &T) -> Order
13871387
// We could hardcode the sorting comparisons here, and we could
13881388
// manipulate/step the pointers themselves, rather than repeatedly
13891389
// .offset-ing.
1390-
for start in range_step(0, len, insertion) {
1390+
for start in (0.. len).step_by(insertion) {
13911391
// start <= i < len;
13921392
for i in start..cmp::min(start + insertion, len) {
13931393
// j satisfies: start <= j <= i;
@@ -1427,7 +1427,7 @@ fn merge_sort<T, F>(v: &mut [T], mut compare: F) where F: FnMut(&T, &T) -> Order
14271427
// a time, placing the result in `buf_tmp`.
14281428

14291429
// 0 <= start <= len.
1430-
for start in range_step(0, len, 2 * width) {
1430+
for start in (0..len).step_by(2 * width) {
14311431
// manipulate pointers directly for speed (rather than
14321432
// using a `for` loop with `range` and `.offset` inside
14331433
// that loop).

0 commit comments

Comments
 (0)