Skip to content

Commit b238325

Browse files
committed
---
yaml --- r: 224383 b: refs/heads/beta c: 6fec7b7 h: refs/heads/master i: 224381: e921e6e 224379: 49b31e7 224375: 766ad7e 224367: 3deeb06 224351: f9b5128 224319: 2202ccb 224255: a084676 v: v3
1 parent b745110 commit b238325

File tree

219 files changed

+2954
-7984
lines changed

Some content is hidden

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

219 files changed

+2954
-7984
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 2449823268a886b2faa899ffb794e8396fc02278
26+
refs/heads/beta: 6fec7b7854b0598c82af68587ba163e406c3e17c
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 938f5d7af401e2d8238522fed4a612943b6e77fd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66
*.rs rust
77
src/etc/pkg/rust-logo.ico binary
88
src/etc/pkg/rust-logo.png binary
9-
src/rt/msvc/* -whitespace
10-
src/rt/valgrind/* -whitespace
119
*.woff binary

branches/beta/configure

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,9 @@ valopt llvm-root "" "set LLVM root"
601601
valopt python "" "set path to python"
602602
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
603603
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
604-
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path"
604+
valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path (deprecated)"
605+
valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path"
606+
valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
605607
valopt release-channel "dev" "the name of the release channel to build"
606608
valopt musl-root "/usr/local" "MUSL root installation directory"
607609

@@ -1112,20 +1114,24 @@ do
11121114
fi
11131115

11141116
case $i in
1115-
arm-linux-androideabi)
1116-
1117-
if [ ! -f $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-gcc ]
1118-
then
1119-
err "NDK $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-gcc not found"
1120-
fi
1121-
if [ ! -f $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-g++ ]
1122-
then
1123-
err "NDK $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-g++ not found"
1124-
fi
1125-
if [ ! -f $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-ar ]
1117+
*android*)
1118+
upper_snake_target=$(echo "$i" | tr '[:lower:]' '[:upper:]' | tr '\-' '\_')
1119+
eval ndk=\$"CFG_${upper_snake_target}_NDK"
1120+
if [ -z "$ndk" ]
11261121
then
1127-
err "NDK $CFG_ANDROID_CROSS_PATH/bin/arm-linux-androideabi-ar not found"
1122+
ndk=$CFG_ANDROID_CROSS_PATH
1123+
eval "CFG_${upper_snake_target}_NDK"=$CFG_ANDROID_CROSS_PATH
1124+
warn "generic/default Android NDK option is deprecated (use --$i-ndk option instead)"
11281125
fi
1126+
1127+
# Perform a basic sanity check of the NDK
1128+
for android_ndk_tool in "$ndk/bin/$i-gcc" "$ndk/bin/$i-g++" "$ndk/bin/$i-ar"
1129+
do
1130+
if [ ! -f $android_ndk_tool ]
1131+
then
1132+
err "NDK tool $android_ndk_tool not found (bad or missing --$i-ndk option?)"
1133+
fi
1134+
done
11291135
;;
11301136

11311137
arm-apple-darwin)
@@ -1177,8 +1183,13 @@ do
11771183
# INCLUDE and LIB variables for MSVC so we can set those in the
11781184
# build system as well.
11791185
install=$(reg QUERY \
1180-
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
1186+
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0' \
11811187
-v InstallDir)
1188+
if [ -z "$install" ]; then
1189+
install=$(reg QUERY \
1190+
'HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\12.0' \
1191+
-v InstallDir)
1192+
fi
11821193
need_ok "couldn't find visual studio install root"
11831194
CFG_MSVC_ROOT=$(echo "$install" | grep InstallDir | sed 's/.*REG_SZ[ ]*//')
11841195
CFG_MSVC_ROOT=$(dirname "$CFG_MSVC_ROOT")
@@ -1460,12 +1471,22 @@ do
14601471

14611472
msg "configuring LLVM with:"
14621473
msg "$CMAKE_ARGS"
1474+
case "$CFG_MSVC_ROOT" in
1475+
*14.0*)
1476+
generator="Visual Studio 14 2015"
1477+
;;
1478+
*12.0*)
1479+
generator="Visual Studio 12 2013"
1480+
;;
1481+
*)
1482+
err "can't determine generator for LLVM cmake"
1483+
;;
1484+
esac
14631485
case "$t" in
14641486
x86_64-*)
1465-
generator="Visual Studio 12 2013 Win64"
1487+
generator="$generator Win64"
14661488
;;
14671489
i686-*)
1468-
generator="Visual Studio 12 2013"
14691490
;;
14701491
*)
14711492
err "can only build LLVM for x86 platforms"
@@ -1667,7 +1688,8 @@ putvar CFG_HOST
16671688
putvar CFG_TARGET
16681689
putvar CFG_LIBDIR_RELATIVE
16691690
putvar CFG_DISABLE_MANAGE_SUBMODULES
1670-
putvar CFG_ANDROID_CROSS_PATH
1691+
putvar CFG_AARCH64_LINUX_ANDROID_NDK
1692+
putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
16711693
putvar CFG_MANDIR
16721694

16731695
# Avoid spurious warnings from clang by feeding it original source on

branches/beta/mk/cfg/aarch64-linux-android.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# aarch64-linux-android configuration
22
# CROSS_PREFIX_aarch64-linux-android-
3-
CC_aarch64-linux-android=$(CFG_ANDROID_CROSS_PATH)/bin/aarch64-linux-android-gcc
4-
CXX_aarch64-linux-android=$(CFG_ANDROID_CROSS_PATH)/bin/aarch64-linux-android-g++
5-
CPP_aarch64-linux-android=$(CFG_ANDROID_CROSS_PATH)/bin/aarch64-linux-android-gcc -E
6-
AR_aarch64-linux-android=$(CFG_ANDROID_CROSS_PATH)/bin/aarch64-linux-android-ar
3+
CC_aarch64-linux-android=$(CFG_AARCH64_LINUX_ANDROID_NDK)/bin/aarch64-linux-android-gcc
4+
CXX_aarch64-linux-android=$(CFG_AARCH64_LINUX_ANDROID_NDK)/bin/aarch64-linux-android-g++
5+
CPP_aarch64-linux-android=$(CFG_AARCH64_LINUX_ANDROID_NDK)/bin/aarch64-linux-android-gcc -E
6+
AR_aarch64-linux-android=$(CFG_AARCH64_LINUX_ANDROID_NDK)/bin/aarch64-linux-android-ar
77
CFG_LIB_NAME_aarch64-linux-android=lib$(1).so
88
CFG_STATIC_LIB_NAME_aarch64-linux-android=lib$(1).a
99
CFG_LIB_GLOB_aarch64-linux-android=lib$(1)-*.so

branches/beta/mk/cfg/arm-linux-androideabi.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# arm-linux-androideabi configuration
2-
CC_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc
3-
CXX_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-g++
4-
CPP_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc -E
5-
AR_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-ar
2+
CC_arm-linux-androideabi=$(CFG_ARM_LINUX_ANDROIDEABI_NDK)/bin/arm-linux-androideabi-gcc
3+
CXX_arm-linux-androideabi=$(CFG_ARM_LINUX_ANDROIDEABI_NDK)/bin/arm-linux-androideabi-g++
4+
CPP_arm-linux-androideabi=$(CFG_ARM_LINUX_ANDROIDEABI_NDK)/bin/arm-linux-androideabi-gcc -E
5+
AR_arm-linux-androideabi=$(CFG_ARM_LINUX_ANDROIDEABI_NDK)/bin/arm-linux-androideabi-ar
66
CFG_LIB_NAME_arm-linux-androideabi=lib$(1).so
77
CFG_STATIC_LIB_NAME_arm-linux-androideabi=lib$(1).a
88
CFG_LIB_GLOB_arm-linux-androideabi=lib$(1)-*.so

branches/beta/src/doc/trpl/choosing-your-guarantees.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The main guarantee provided here is that the data will not be destroyed until al
8181
are out of scope.
8282

8383
This should be used when we wish to dynamically allocate and share some data (read-only) between
84-
various portions of yur program, where it is not certain which portion will finish using the pointer
84+
various portions of your program, where it is not certain which portion will finish using the pointer
8585
last. It's a viable alternative to `&T` when `&T` is either impossible to statically check for
8686
correctness, or creates extremely unergonomic code where the programmer does not wish to spend the
8787
development cost of working with.

branches/beta/src/doc/trpl/compiler-plugins.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
6161
("I", 1)];
6262
6363
let text = match args {
64-
[TtToken(_, token::Ident(s, _))] => token::get_ident(s).to_string(),
64+
[TtToken(_, token::Ident(s, _))] => s.to_string(),
6565
_ => {
6666
cx.span_err(sp, "argument should be a single identifier");
6767
return DummyResult::any(sp);
@@ -186,8 +186,7 @@ impl LintPass for Pass {
186186
}
187187
188188
fn check_item(&mut self, cx: &Context, it: &ast::Item) {
189-
let name = token::get_ident(it.ident);
190-
if name.get() == "lintme" {
189+
if it.ident.name == "lintme" {
191190
cx.span_lint(TEST_LINT, it.span, "item is named 'lintme'");
192191
}
193192
}

branches/beta/src/doc/trpl/crates-and-modules.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ Hello in English: Hello!
355355
Goodbye in English: Goodbye.
356356
```
357357
358+
`pub` also applies to `struct`s and their member fields. In keeping with Rust’s
359+
tendency toward safety, simply making a `struct` public won't automatically
360+
make its members public: you must mark the fields individually with `pub`.
361+
358362
Now that our functions are public, we can use them. Great! However, typing out
359363
`phrases::english::greetings::hello()` is very long and repetitive. Rust has
360364
another keyword for importing names into the current scope, so that you can

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -347,40 +347,50 @@ easiest just to show an example:
347347

348348
```rust
349349
trait Foo {
350-
fn bar(&self);
350+
fn is_valid(&self) -> bool;
351351

352-
fn baz(&self) { println!("We called baz."); }
352+
fn is_invalid(&self) -> bool { !self.is_valid() }
353353
}
354354
```
355355

356-
Implementors of the `Foo` trait need to implement `bar()`, but they don’t
357-
need to implement `baz()`. They’ll get this default behavior. They can
356+
Implementors of the `Foo` trait need to implement `is_valid()`, but they don’t
357+
need to implement `is_invalid()`. They’ll get this default behavior. They can
358358
override the default if they so choose:
359359

360360
```rust
361361
# trait Foo {
362-
# fn bar(&self);
363-
# fn baz(&self) { println!("We called baz."); }
362+
# fn is_valid(&self) -> bool;
363+
#
364+
# fn is_invalid(&self) -> bool { !self.is_valid() }
364365
# }
365366
struct UseDefault;
366367

367368
impl Foo for UseDefault {
368-
fn bar(&self) { println!("We called bar."); }
369+
fn is_valid(&self) -> bool {
370+
println!("Called UseDefault.is_valid.");
371+
true
372+
}
369373
}
370374

371375
struct OverrideDefault;
372376

373377
impl Foo for OverrideDefault {
374-
fn bar(&self) { println!("We called bar."); }
378+
fn is_valid(&self) -> bool {
379+
println!("Called OverrideDefault.is_valid.");
380+
true
381+
}
375382

376-
fn baz(&self) { println!("Override baz!"); }
383+
fn is_invalid(&self) -> bool {
384+
println!("Called OverrideDefault.is_invalid!");
385+
true // this implementation is a self-contradiction!
386+
}
377387
}
378388

379389
let default = UseDefault;
380-
default.baz(); // prints "We called baz."
390+
assert!(!default.is_invalid()); // prints "Called UseDefault.is_valid."
381391

382392
let over = OverrideDefault;
383-
over.baz(); // prints "Override baz!"
393+
assert!(over.is_invalid()); // prints "Called OverrideDefault.is_invalid!"
384394
```
385395

386396
# Inheritance

branches/beta/src/liballoc/boxed.rs

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
use core::prelude::*;
5757

5858
use heap;
59+
use raw_vec::RawVec;
5960

6061
use core::any::Any;
6162
use core::cmp::Ordering;
@@ -65,7 +66,7 @@ use core::marker::{self, Unsize};
6566
use core::mem;
6667
use core::ops::{CoerceUnsized, Deref, DerefMut};
6768
use core::ops::{Placer, Boxed, Place, InPlace, BoxPlace};
68-
use core::ptr::Unique;
69+
use core::ptr::{self, Unique};
6970
use core::raw::{TraitObject};
7071

7172
/// A value that represents the heap. This is the default place that the `box`
@@ -86,10 +87,13 @@ use core::raw::{TraitObject};
8687
#[lang = "exchange_heap"]
8788
#[unstable(feature = "box_heap",
8889
reason = "may be renamed; uncertain about custom allocator design")]
90+
#[allow(deprecated)]
8991
pub const HEAP: ExchangeHeapSingleton =
9092
ExchangeHeapSingleton { _force_singleton: () };
9193

9294
/// This the singleton type used solely for `boxed::HEAP`.
95+
#[unstable(feature = "box_heap",
96+
reason = "may be renamed; uncertain about custom allocator design")]
9397
#[derive(Copy, Clone)]
9498
pub struct ExchangeHeapSingleton { _force_singleton: () }
9599

@@ -297,7 +301,7 @@ impl<T: Clone> Clone for Box<T> {
297301
/// let y = x.clone();
298302
/// ```
299303
#[inline]
300-
fn clone(&self) -> Box<T> { box (HEAP) {(**self).clone()} }
304+
fn clone(&self) -> Box<T> { box {(**self).clone()} }
301305
/// Copies `source`'s contents into `self` without creating a new allocation.
302306
///
303307
/// # Examples
@@ -511,3 +515,55 @@ impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+Send+'a> {
511515
}
512516

513517
impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Box<U>> for Box<T> {}
518+
519+
#[stable(feature = "box_slice_clone", since = "1.3.0")]
520+
impl<T: Clone> Clone for Box<[T]> {
521+
fn clone(&self) -> Self {
522+
let mut new = BoxBuilder {
523+
data: RawVec::with_capacity(self.len()),
524+
len: 0
525+
};
526+
527+
let mut target = new.data.ptr();
528+
529+
for item in self.iter() {
530+
unsafe {
531+
ptr::write(target, item.clone());
532+
target = target.offset(1);
533+
};
534+
535+
new.len += 1;
536+
}
537+
538+
return unsafe { new.into_box() };
539+
540+
// Helper type for responding to panics correctly.
541+
struct BoxBuilder<T> {
542+
data: RawVec<T>,
543+
len: usize,
544+
}
545+
546+
impl<T> BoxBuilder<T> {
547+
unsafe fn into_box(self) -> Box<[T]> {
548+
let raw = ptr::read(&self.data);
549+
mem::forget(self);
550+
raw.into_box()
551+
}
552+
}
553+
554+
impl<T> Drop for BoxBuilder<T> {
555+
fn drop(&mut self) {
556+
let mut data = self.data.ptr();
557+
let max = unsafe { data.offset(self.len as isize) };
558+
559+
while data != max {
560+
unsafe {
561+
ptr::read(data);
562+
data = data.offset(1);
563+
}
564+
}
565+
}
566+
}
567+
}
568+
}
569+

branches/beta/src/liballoc/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@
7070
test(no_crate_inject))]
7171
#![no_std]
7272

73-
// SNAP d4432b3
74-
#![allow(unused_features)] // until feature(placement_in_syntax) is in snap
7573
#![feature(allocator)]
7674
#![feature(box_syntax)]
7775
#![feature(coerce_unsized)]
7876
#![feature(core)]
7977
#![feature(core_intrinsics)]
8078
#![feature(core_prelude)]
79+
#![feature(core_slice_ext)]
8180
#![feature(custom_attribute)]
8281
#![feature(fundamental)]
8382
#![feature(lang_items)]

branches/beta/src/libcollections/slice.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,12 +762,16 @@ impl<T> [T] {
762762

763763
/// Find the first index containing a matching value.
764764
#[unstable(feature = "slice_position_elem")]
765+
#[deprecated(since = "1.3.0",
766+
reason = "less idiomatic than .iter().position()")]
765767
pub fn position_elem(&self, t: &T) -> Option<usize> where T: PartialEq {
766768
core_slice::SliceExt::position_elem(self, t)
767769
}
768770

769771
/// Find the last index containing a matching value.
770772
#[unstable(feature = "slice_position_elem")]
773+
#[deprecated(since = "1.3.0",
774+
reason = "less idiomatic than .iter().rev().position()")]
771775
pub fn rposition_elem(&self, t: &T) -> Option<usize> where T: PartialEq {
772776
core_slice::SliceExt::rposition_elem(self, t)
773777
}
@@ -1009,6 +1013,8 @@ impl<T> [T] {
10091013
/// ```
10101014
#[unstable(feature = "move_from",
10111015
reason = "uncertain about this API approach")]
1016+
#[deprecated(since = "1.3.0",
1017+
reason = "unclear that it must belong in the standard library")]
10121018
#[inline]
10131019
pub fn move_from(&mut self, mut src: Vec<T>, start: usize, end: usize) -> usize {
10141020
for (a, b) in self.iter_mut().zip(&mut src[start .. end]) {

branches/beta/src/libcollections/str.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ impl str {
553553
/// ```
554554
#[unstable(feature = "slice_chars",
555555
reason = "may have yet to prove its worth")]
556+
#[deprecated(since = "1.3.0",
557+
reason = "can be implemented with char_indices and \
558+
hasn't seen enough use to justify inclusion")]
556559
pub fn slice_chars(&self, begin: usize, end: usize) -> &str {
557560
core_str::StrExt::slice_chars(self, begin, end)
558561
}
@@ -1666,6 +1669,8 @@ impl str {
16661669
/// ```
16671670
#[unstable(feature = "subslice_offset",
16681671
reason = "awaiting convention about comparability of arbitrary slices")]
1672+
#[deprecated(since = "1.3.0",
1673+
reason = "replaced with other pattern-related methods")]
16691674
pub fn subslice_offset(&self, inner: &str) -> usize {
16701675
core_str::StrExt::subslice_offset(self, inner)
16711676
}

0 commit comments

Comments
 (0)