Skip to content

Commit 3ad0f8e

Browse files
committed
---
yaml --- r: 228923 b: refs/heads/try c: 523ee8d h: refs/heads/master i: 228921: 61567a2 228919: 487cb6c v: v3
1 parent 93f6e75 commit 3ad0f8e

File tree

219 files changed

+2774
-7972
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

+2774
-7972
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: bd0117523448f9cda8a61c048b9f4ce5372ade15
4+
refs/heads/try: 523ee8d37cb3aed6bbad16760850fa94253c2072
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/.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/try/configure

Lines changed: 23 additions & 18 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

@@ -1003,11 +1005,9 @@ then
10031005
(''|*clang)
10041006
CFG_CLANG_REPORTED_VERSION=$($CFG_CC --version | grep version)
10051007

1006-
if [[ $CFG_CLANG_REPORTED_VERSION == *"(based on LLVM "* ]]
1007-
then
1008+
if echo $CFG_CLANG_REPORTED_VERSION | grep -q "(based on LLVM "; then
10081009
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*(based on LLVM \(.*\))/\1/')
1009-
elif [[ $CFG_CLANG_REPORTED_VERSION == "Apple LLVM"* ]]
1010-
then
1010+
elif echo $CFG_CLANG_REPORTED_VERSION | grep -q "Apple LLVM"; then
10111011
CFG_OSX_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
10121012
else
10131013
CFG_CLANG_VERSION=$(echo $CFG_CLANG_REPORTED_VERSION | sed 's/.*version \(.*\) .*/\1/')
@@ -1112,20 +1112,24 @@ do
11121112
fi
11131113

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

11311135
arm-apple-darwin)
@@ -1682,7 +1686,8 @@ putvar CFG_HOST
16821686
putvar CFG_TARGET
16831687
putvar CFG_LIBDIR_RELATIVE
16841688
putvar CFG_DISABLE_MANAGE_SUBMODULES
1685-
putvar CFG_ANDROID_CROSS_PATH
1689+
putvar CFG_AARCH64_LINUX_ANDROID_NDK
1690+
putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
16861691
putvar CFG_MANDIR
16871692

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

branches/try/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/try/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/try/src/doc/trpl/choosing-your-guarantees.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ allowed to share references to this by the regular borrowing rules, checked at c
4242

4343
## `&T` and `&mut T`
4444

45-
These are immutable and mutable references respectively. They follow the &lquo;read-write lock&rquo;
45+
These are immutable and mutable references respectively. They follow the “read-write lock”
4646
pattern, such that one may either have only one mutable reference to some data, or any number of
4747
immutable ones, but not both. This guarantee is enforced at compile time, and has no visible cost at
4848
runtime. In most cases these two pointer types suffice for sharing cheap references between sections
@@ -108,7 +108,7 @@ increment the inner reference count and return a copy of the `Rc<T>`.
108108

109109
# Cell types
110110

111-
&lquo;Cell&rquo;s provide interior mutability. In other words, they contain data which can be manipulated even
111+
`Cell`s provide interior mutability. In other words, they contain data which can be manipulated even
112112
if the type cannot be obtained in a mutable form (for example, when it is behind an `&`-ptr or
113113
`Rc<T>`).
114114

@@ -127,7 +127,8 @@ If a field is wrapped in `Cell`, it's a nice indicator that the chunk of data is
127127
stay the same between the time you first read it and when you intend to use it.
128128

129129
```rust
130-
# use std::cell::Cell;
130+
use std::cell::Cell;
131+
131132
let x = Cell::new(1);
132133
let y = &x;
133134
let z = &x;
@@ -185,7 +186,8 @@ any other borrows active when a mutable borrow is active. If the programmer atte
185186
borrow, the thread will panic.
186187

187188
```rust
188-
# use std::cell::RefCell;
189+
use std::cell::RefCell;
190+
189191
let x = RefCell::new(vec![1,2,3,4]);
190192
{
191193
println!("{:?}", *x.borrow())

branches/try/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/try/src/doc/trpl/crates-and-modules.md

Lines changed: 4 additions & 3 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
@@ -517,9 +521,6 @@ of `foo` relative to where we are. If that’s prefixed with `::`, as in
517521
`::foo::bar()`, it refers to a different `foo`, an absolute path from your
518522
crate root.
519523
520-
Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
521-
`use` declarations go first.
522-
523524
This will build and run:
524525
525526
```bash

branches/try/src/doc/trpl/guessing-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ generator, which is local to the particular [thread][concurrency] of execution
499499
we’re in. Because we `use rand::Rng`’d above, it has a `gen_range()` method
500500
available. This method takes two arguments, and generates a number between
501501
them. It’s inclusive on the lower bound, but exclusive on the upper bound,
502-
so we need `1` and `101` to get a number between one and a hundred.
502+
so we need `1` and `101` to get a number ranging from one to a hundred.
503503

504504
[concurrency]: concurrency.html
505505

branches/try/src/doc/trpl/intrinsics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ perform efficient pointer arithmetic, one would import those functions
1111
via a declaration like
1212

1313
```rust
14-
# #![feature(intrinsics)]
14+
#![feature(intrinsics)]
1515
# fn main() {}
1616

1717
extern "rust-intrinsic" {

branches/try/src/liballoc/arc.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ impl<T: ?Sized> Arc<T> {
200200
/// # Examples
201201
///
202202
/// ```
203-
/// # #![feature(arc_weak)]
203+
/// #![feature(arc_weak)]
204+
///
204205
/// use std::sync::Arc;
205206
///
206207
/// let five = Arc::new(5);
@@ -337,7 +338,8 @@ impl<T: Clone> Arc<T> {
337338
/// # Examples
338339
///
339340
/// ```
340-
/// # #![feature(arc_unique)]
341+
/// #![feature(arc_unique)]
342+
///
341343
/// use std::sync::Arc;
342344
///
343345
/// let mut five = Arc::new(5);
@@ -408,7 +410,8 @@ impl<T: ?Sized> Arc<T> {
408410
/// # Examples
409411
///
410412
/// ```
411-
/// # #![feature(arc_unique, alloc)]
413+
/// #![feature(arc_unique, alloc)]
414+
///
412415
/// extern crate alloc;
413416
/// # fn main() {
414417
/// use alloc::arc::Arc;
@@ -555,7 +558,8 @@ impl<T: ?Sized> Weak<T> {
555558
/// # Examples
556559
///
557560
/// ```
558-
/// # #![feature(arc_weak)]
561+
/// #![feature(arc_weak)]
562+
///
559563
/// use std::sync::Arc;
560564
///
561565
/// let five = Arc::new(5);
@@ -599,7 +603,8 @@ impl<T: ?Sized> Clone for Weak<T> {
599603
/// # Examples
600604
///
601605
/// ```
602-
/// # #![feature(arc_weak)]
606+
/// #![feature(arc_weak)]
607+
///
603608
/// use std::sync::Arc;
604609
///
605610
/// let weak_five = Arc::new(5).downgrade();
@@ -626,7 +631,8 @@ impl<T: ?Sized> Drop for Weak<T> {
626631
/// # Examples
627632
///
628633
/// ```
629-
/// # #![feature(arc_weak)]
634+
/// #![feature(arc_weak)]
635+
///
630636
/// use std::sync::Arc;
631637
///
632638
/// {

branches/try/src/liballoc/boxed.rs

Lines changed: 62 additions & 5 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`
@@ -74,7 +75,8 @@ use core::raw::{TraitObject};
7475
/// The following two examples are equivalent:
7576
///
7677
/// ```
77-
/// # #![feature(box_heap)]
78+
/// #![feature(box_heap)]
79+
///
7880
/// #![feature(box_syntax, placement_in_syntax)]
7981
/// use std::boxed::HEAP;
8082
///
@@ -240,7 +242,8 @@ impl<T : ?Sized> Box<T> {
240242
///
241243
/// # Examples
242244
/// ```
243-
/// # #![feature(box_raw)]
245+
/// #![feature(box_raw)]
246+
///
244247
/// let seventeen = Box::new(17u32);
245248
/// let raw = Box::into_raw(seventeen);
246249
/// let boxed_again = unsafe { Box::from_raw(raw) };
@@ -263,7 +266,8 @@ impl<T : ?Sized> Box<T> {
263266
///
264267
/// # Examples
265268
/// ```
266-
/// # #![feature(box_raw)]
269+
/// #![feature(box_raw)]
270+
///
267271
/// use std::boxed;
268272
///
269273
/// let seventeen = Box::new(17u32);
@@ -306,7 +310,8 @@ impl<T: Clone> Clone for Box<T> {
306310
/// # Examples
307311
///
308312
/// ```
309-
/// # #![feature(box_raw)]
313+
/// #![feature(box_raw)]
314+
///
310315
/// let x = Box::new(5);
311316
/// let mut y = Box::new(10);
312317
///
@@ -514,3 +519,55 @@ impl<'a,A,R> FnOnce<A> for Box<FnBox<A,Output=R>+Send+'a> {
514519
}
515520

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

branches/try/src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#![feature(core)]
7777
#![feature(core_intrinsics)]
7878
#![feature(core_prelude)]
79+
#![feature(core_slice_ext)]
7980
#![feature(custom_attribute)]
8081
#![feature(fundamental)]
8182
#![feature(lang_items)]

0 commit comments

Comments
 (0)