Skip to content

Commit

Permalink
Resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Apr 22, 2017
2 parents 5fc2522 + 6d841da commit 8a3ea01
Show file tree
Hide file tree
Showing 110 changed files with 1,690 additions and 712 deletions.
2 changes: 2 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ valopt i686-linux-android-ndk "" "i686-linux-android NDK standalone path"
valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path"
valopt armv7-linux-androideabi-ndk "" "armv7-linux-androideabi NDK standalone path"
valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
valopt x86_64-linux-android-ndk "" "x86_64-linux-android NDK standalone path"
valopt nacl-cross-path "" "NaCl SDK path (Pepper Canary is recommended). Must be absolute!"
valopt musl-root "/usr/local" "MUSL root installation directory (deprecated)"
valopt musl-root-x86_64 "" "x86_64-unknown-linux-musl install directory"
Expand Down Expand Up @@ -746,6 +747,7 @@ putvar CFG_AARCH64_LINUX_ANDROID_NDK
putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
putvar CFG_ARMV7_LINUX_ANDROIDEABI_NDK
putvar CFG_I686_LINUX_ANDROID_NDK
putvar CFG_X86_64_LINUX_ANDROID_NDK
putvar CFG_NACL_CROSS_PATH
putvar CFG_MANDIR
putvar CFG_DOCDIR
Expand Down
2 changes: 1 addition & 1 deletion rls
Submodule rls updated from 016cbc to 6ecff9
1 change: 1 addition & 0 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &st
if !up_to_date(src_file, dst_file) {
let mut cmd = Command::new(&compiler_path);
build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
.arg("--cfg").arg(format!("stage{}", compiler.stage))
.arg("--target").arg(target)
.arg("--emit=obj")
.arg("--out-dir").arg(dst_dir)
Expand Down
6 changes: 6 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,12 @@ impl Config {
.or_insert(Target::default());
target.ndk = Some(parse_configure_path(value));
}
"CFG_X86_64_LINUX_ANDROID_NDK" if value.len() > 0 => {
let target = "x86_64-linux-android".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(parse_configure_path(value));
}
"CFG_LOCAL_RUST_ROOT" if value.len() > 0 => {
let path = parse_configure_path(value);
self.rustc = Some(push_exe_path(path.clone(), &["bin", "rustc"]));
Expand Down
6 changes: 4 additions & 2 deletions src/ci/docker/dist-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@ RUN curl -o /usr/local/bin/sccache \
chmod +x /usr/local/bin/sccache

ENV TARGETS=arm-linux-androideabi
ENV TARGETS=$TARGETS,armv7-linux-androideabi
ENV TARGETS=$TARGETS,i686-linux-android
ENV TARGETS=$TARGETS,aarch64-linux-android
ENV TARGETS=$TARGETS,armv7-linux-androideabi
ENV TARGETS=$TARGETS,x86_64-linux-android

ENV RUST_CONFIGURE_ARGS \
--target=$TARGETS \
--enable-extended \
--arm-linux-androideabi-ndk=/android/ndk-arm-9 \
--armv7-linux-androideabi-ndk=/android/ndk-arm-9 \
--i686-linux-android-ndk=/android/ndk-x86-9 \
--aarch64-linux-android-ndk=/android/ndk-aarch64
--aarch64-linux-android-ndk=/android/ndk-arm64-21 \
--x86_64-linux-android-ndk=/android/ndk-x86_64-21

ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
8 changes: 7 additions & 1 deletion src/ci/docker/dist-android/install-ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
--platform=android-21 \
--toolchain=aarch64-linux-android-4.9 \
--install-dir=/android/ndk-aarch64 \
--install-dir=/android/ndk-arm64-21 \
--ndk-dir=/android/android-ndk-r11c \
--arch=arm64
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
Expand All @@ -34,5 +34,11 @@ bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
--install-dir=/android/ndk-x86-9 \
--ndk-dir=/android/android-ndk-r11c \
--arch=x86
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
--platform=android-21 \
--toolchain=x86_64-4.9 \
--install-dir=/android/ndk-x86_64-21 \
--ndk-dir=/android/android-ndk-r11c \
--arch=x86_64

rm -rf ./android-ndk-r11c-linux-x86_64.zip ./android-ndk-r11c
2 changes: 1 addition & 1 deletion src/doc/unstable-book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
- [prelude_import](language-features/prelude-import.md)
- [proc_macro](language-features/proc-macro.md)
- [quote](language-features/quote.md)
- [repr_align](language-features/repr-align.md)
- [repr_simd](language-features/repr-simd.md)
- [rustc_attrs](language-features/rustc-attrs.md)
- [rustc_diagnostic_macros](language-features/rustc-diagnostic-macros.md)
Expand Down Expand Up @@ -224,4 +225,3 @@
- [windows_net](library-features/windows-net.md)
- [windows_stdio](library-features/windows-stdio.md)
- [zero_one](library-features/zero-one.md)
>>>>>> Add top level sections to the Unstable Book.
11 changes: 11 additions & 0 deletions src/doc/unstable-book/src/language-features/repr-align.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `repr_align`

The tracking issue for this feature is: [#33626]

[#33626]: https://github.com/rust-lang/rust/issues/33626

------------------------




5 changes: 4 additions & 1 deletion src/etc/rust-gdb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ RUSTC_SYSROOT=`rustc --print=sysroot`
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"

# Run GDB with the additional arguments that load the pretty printers
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" gdb \
# Set the environment variable `RUST_GDB` to overwrite the call to a
# different/specific command (defaults to `gdb`).
RUST_GDB="${RUST_GDB:-gdb}"
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" ${RUST_GDB} \
-d "$GDB_PYTHON_MODULE_DIRECTORY" \
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
"$@"
12 changes: 8 additions & 4 deletions src/libcollections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ pub struct Difference<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Difference<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Difference")
.field(&self.clone())
.field(&self.a)
.field(&self.b)
.finish()
}
}
Expand All @@ -160,7 +161,8 @@ pub struct SymmetricDifference<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for SymmetricDifference<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("SymmetricDifference")
.field(&self.clone())
.field(&self.a)
.field(&self.b)
.finish()
}
}
Expand All @@ -182,7 +184,8 @@ pub struct Intersection<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Intersection<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Intersection")
.field(&self.clone())
.field(&self.a)
.field(&self.b)
.finish()
}
}
Expand All @@ -204,7 +207,8 @@ pub struct Union<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Union<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Union")
.field(&self.clone())
.field(&self.a)
.field(&self.b)
.finish()
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/libcollections/enum_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ pub struct Iter<E> {
impl<E: fmt::Debug> fmt::Debug for Iter<E> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Iter")
.field(&self.clone())
.field(&self.index)
.field(&self.bits)
.finish()
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/libcollections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct Iter<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Iter")
.field(&self.clone())
.field(&self.len)
.finish()
}
}
Expand Down Expand Up @@ -107,7 +107,8 @@ pub struct IterMut<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("IterMut")
.field(self.clone())
.field(&self.list)
.field(&self.len)
.finish()
}
}
Expand All @@ -129,7 +130,7 @@ pub struct IntoIter<T> {
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("IntoIter")
.field(self.clone())
.field(&self.list)
.finish()
}
}
Expand Down Expand Up @@ -1128,7 +1129,7 @@ pub struct FrontPlace<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for FrontPlace<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("FrontPlace")
.field(self.clone())
.field(&self.list)
.finish()
}
}
Expand Down Expand Up @@ -1183,7 +1184,7 @@ pub struct BackPlace<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for BackPlace<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("BackPlace")
.field(self.clone())
.field(&self.list)
.finish()
}
}
Expand Down
22 changes: 22 additions & 0 deletions src/libcollections/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ fn test_extend() {
let mut v = Vec::new();
let mut w = Vec::new();

v.extend(w.clone());
assert_eq!(v, &[]);

v.extend(0..3);
for i in 0..3 {
w.push(i)
Expand All @@ -100,6 +103,25 @@ fn test_extend() {

v.extend(w.clone()); // specializes to `append`
assert!(v.iter().eq(w.iter().chain(w.iter())));

// Zero sized types
#[derive(PartialEq, Debug)]
struct Foo;

let mut a = Vec::new();
let b = vec![Foo, Foo];

a.extend(b);
assert_eq!(a, &[Foo, Foo]);

// Double drop
let mut count_x = 0;
{
let mut x = Vec::new();
let y = vec![DropCounter { count: &mut count_x }];
x.extend(y);
}
assert_eq!(count_x, 1);
}

#[test]
Expand Down
27 changes: 19 additions & 8 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,18 +1041,22 @@ impl<T> Vec<T> {
#[inline]
#[stable(feature = "append", since = "1.4.0")]
pub fn append(&mut self, other: &mut Self) {
self.reserve(other.len());
let len = self.len();
unsafe {
ptr::copy_nonoverlapping(other.as_ptr(), self.get_unchecked_mut(len), other.len());
}

self.len += other.len();
unsafe {
self.append_elements(other.as_slice() as _);
other.set_len(0);
}
}

/// Appends elements to `Self` from other buffer.
#[inline]
unsafe fn append_elements(&mut self, other: *const [T]) {
let count = (*other).len();
self.reserve(count);
let len = self.len();
ptr::copy_nonoverlapping(other as *const T, self.get_unchecked_mut(len), count);
self.len += count;
}

/// Create a draining iterator that removes the specified range in the vector
/// and yields the removed items.
///
Expand Down Expand Up @@ -1738,7 +1742,7 @@ impl<T, I> SpecExtend<T, I> for Vec<T>
vector
}

fn spec_extend(&mut self, iterator: I) {
default fn spec_extend(&mut self, iterator: I) {
// This is the case for a TrustedLen iterator.
let (low, high) = iterator.size_hint();
if let Some(high_value) = high {
Expand Down Expand Up @@ -1783,6 +1787,13 @@ impl<T> SpecExtend<T, IntoIter<T>> for Vec<T> {
vector
}
}

fn spec_extend(&mut self, mut iterator: IntoIter<T>) {
unsafe {
self.append_elements(iterator.as_slice() as _);
}
iterator.ptr = iterator.end;
}
}

impl<'a, T: 'a, I> SpecExtend<&'a T, I> for Vec<T>
Expand Down
14 changes: 10 additions & 4 deletions src/libcollections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,9 @@ pub struct Iter<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Iter")
.field(&self.clone())
.field(&self.ring)
.field(&self.tail)
.field(&self.head)
.finish()
}
}
Expand Down Expand Up @@ -2000,7 +2002,9 @@ pub struct IterMut<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("IterMut")
.field(&self.clone())
.field(&self.ring)
.field(&self.tail)
.field(&self.head)
.finish()
}
}
Expand Down Expand Up @@ -2081,7 +2085,7 @@ pub struct IntoIter<T> {
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("IntoIter")
.field(&self.clone())
.field(&self.inner)
.finish()
}
}
Expand Down Expand Up @@ -2139,7 +2143,9 @@ pub struct Drain<'a, T: 'a> {
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Drain<'a, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_tuple("Drain")
.field(&self.clone())
.field(&self.after_tail)
.field(&self.after_head)
.field(&self.iter)
.finish()
}
}
Expand Down
Loading

0 comments on commit 8a3ea01

Please sign in to comment.