Skip to content

Commit 8a3ea01

Browse files
committed
Resolve merge conflict
2 parents 5fc2522 + 6d841da commit 8a3ea01

File tree

110 files changed

+1690
-712
lines changed

Some content is hidden

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

110 files changed

+1690
-712
lines changed

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ valopt i686-linux-android-ndk "" "i686-linux-android NDK standalone path"
479479
valopt arm-linux-androideabi-ndk "" "arm-linux-androideabi NDK standalone path"
480480
valopt armv7-linux-androideabi-ndk "" "armv7-linux-androideabi NDK standalone path"
481481
valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
482+
valopt x86_64-linux-android-ndk "" "x86_64-linux-android NDK standalone path"
482483
valopt nacl-cross-path "" "NaCl SDK path (Pepper Canary is recommended). Must be absolute!"
483484
valopt musl-root "/usr/local" "MUSL root installation directory (deprecated)"
484485
valopt musl-root-x86_64 "" "x86_64-unknown-linux-musl install directory"
@@ -746,6 +747,7 @@ putvar CFG_AARCH64_LINUX_ANDROID_NDK
746747
putvar CFG_ARM_LINUX_ANDROIDEABI_NDK
747748
putvar CFG_ARMV7_LINUX_ANDROIDEABI_NDK
748749
putvar CFG_I686_LINUX_ANDROID_NDK
750+
putvar CFG_X86_64_LINUX_ANDROID_NDK
749751
putvar CFG_NACL_CROSS_PATH
750752
putvar CFG_MANDIR
751753
putvar CFG_DOCDIR

rls

Submodule rls updated from 016cbc5 to 6ecff95

src/bootstrap/compile.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &st
151151
if !up_to_date(src_file, dst_file) {
152152
let mut cmd = Command::new(&compiler_path);
153153
build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
154+
.arg("--cfg").arg(format!("stage{}", compiler.stage))
154155
.arg("--target").arg(target)
155156
.arg("--emit=obj")
156157
.arg("--out-dir").arg(dst_dir)

src/bootstrap/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,12 @@ impl Config {
570570
.or_insert(Target::default());
571571
target.ndk = Some(parse_configure_path(value));
572572
}
573+
"CFG_X86_64_LINUX_ANDROID_NDK" if value.len() > 0 => {
574+
let target = "x86_64-linux-android".to_string();
575+
let target = self.target_config.entry(target)
576+
.or_insert(Target::default());
577+
target.ndk = Some(parse_configure_path(value));
578+
}
573579
"CFG_LOCAL_RUST_ROOT" if value.len() > 0 => {
574580
let path = parse_configure_path(value);
575581
self.rustc = Some(push_exe_path(path.clone(), &["bin", "rustc"]));

src/ci/docker/dist-android/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,18 @@ RUN curl -o /usr/local/bin/sccache \
3636
chmod +x /usr/local/bin/sccache
3737

3838
ENV TARGETS=arm-linux-androideabi
39+
ENV TARGETS=$TARGETS,armv7-linux-androideabi
3940
ENV TARGETS=$TARGETS,i686-linux-android
4041
ENV TARGETS=$TARGETS,aarch64-linux-android
41-
ENV TARGETS=$TARGETS,armv7-linux-androideabi
42+
ENV TARGETS=$TARGETS,x86_64-linux-android
4243

4344
ENV RUST_CONFIGURE_ARGS \
4445
--target=$TARGETS \
4546
--enable-extended \
4647
--arm-linux-androideabi-ndk=/android/ndk-arm-9 \
4748
--armv7-linux-androideabi-ndk=/android/ndk-arm-9 \
4849
--i686-linux-android-ndk=/android/ndk-x86-9 \
49-
--aarch64-linux-android-ndk=/android/ndk-aarch64
50+
--aarch64-linux-android-ndk=/android/ndk-arm64-21 \
51+
--x86_64-linux-android-ndk=/android/ndk-x86_64-21
5052

5153
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

src/ci/docker/dist-android/install-ndk.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
2525
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
2626
--platform=android-21 \
2727
--toolchain=aarch64-linux-android-4.9 \
28-
--install-dir=/android/ndk-aarch64 \
28+
--install-dir=/android/ndk-arm64-21 \
2929
--ndk-dir=/android/android-ndk-r11c \
3030
--arch=arm64
3131
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
@@ -34,5 +34,11 @@ bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
3434
--install-dir=/android/ndk-x86-9 \
3535
--ndk-dir=/android/android-ndk-r11c \
3636
--arch=x86
37+
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
38+
--platform=android-21 \
39+
--toolchain=x86_64-4.9 \
40+
--install-dir=/android/ndk-x86_64-21 \
41+
--ndk-dir=/android/android-ndk-r11c \
42+
--arch=x86_64
3743

3844
rm -rf ./android-ndk-r11c-linux-x86_64.zip ./android-ndk-r11c

src/doc/unstable-book/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
- [prelude_import](language-features/prelude-import.md)
7272
- [proc_macro](language-features/proc-macro.md)
7373
- [quote](language-features/quote.md)
74+
- [repr_align](language-features/repr-align.md)
7475
- [repr_simd](language-features/repr-simd.md)
7576
- [rustc_attrs](language-features/rustc-attrs.md)
7677
- [rustc_diagnostic_macros](language-features/rustc-diagnostic-macros.md)
@@ -224,4 +225,3 @@
224225
- [windows_net](library-features/windows-net.md)
225226
- [windows_stdio](library-features/windows-stdio.md)
226227
- [zero_one](library-features/zero-one.md)
227-
>>>>>> Add top level sections to the Unstable Book.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# `repr_align`
2+
3+
The tracking issue for this feature is: [#33626]
4+
5+
[#33626]: https://github.com/rust-lang/rust/issues/33626
6+
7+
------------------------
8+
9+
10+
11+

src/etc/rust-gdb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ RUSTC_SYSROOT=`rustc --print=sysroot`
1717
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
1818

1919
# Run GDB with the additional arguments that load the pretty printers
20-
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" gdb \
20+
# Set the environment variable `RUST_GDB` to overwrite the call to a
21+
# different/specific command (defaults to `gdb`).
22+
RUST_GDB="${RUST_GDB:-gdb}"
23+
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" ${RUST_GDB} \
2124
-d "$GDB_PYTHON_MODULE_DIRECTORY" \
2225
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
2326
"$@"

src/libcollections/btree/set.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ pub struct Difference<'a, T: 'a> {
138138
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Difference<'a, T> {
139139
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
140140
f.debug_tuple("Difference")
141-
.field(&self.clone())
141+
.field(&self.a)
142+
.field(&self.b)
142143
.finish()
143144
}
144145
}
@@ -160,7 +161,8 @@ pub struct SymmetricDifference<'a, T: 'a> {
160161
impl<'a, T: 'a + fmt::Debug> fmt::Debug for SymmetricDifference<'a, T> {
161162
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
162163
f.debug_tuple("SymmetricDifference")
163-
.field(&self.clone())
164+
.field(&self.a)
165+
.field(&self.b)
164166
.finish()
165167
}
166168
}
@@ -182,7 +184,8 @@ pub struct Intersection<'a, T: 'a> {
182184
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Intersection<'a, T> {
183185
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
184186
f.debug_tuple("Intersection")
185-
.field(&self.clone())
187+
.field(&self.a)
188+
.field(&self.b)
186189
.finish()
187190
}
188191
}
@@ -204,7 +207,8 @@ pub struct Union<'a, T: 'a> {
204207
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Union<'a, T> {
205208
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
206209
f.debug_tuple("Union")
207-
.field(&self.clone())
210+
.field(&self.a)
211+
.field(&self.b)
208212
.finish()
209213
}
210214
}

src/libcollections/enum_set.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ pub struct Iter<E> {
225225
impl<E: fmt::Debug> fmt::Debug for Iter<E> {
226226
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
227227
f.debug_tuple("Iter")
228-
.field(&self.clone())
228+
.field(&self.index)
229+
.field(&self.bits)
229230
.finish()
230231
}
231232
}

src/libcollections/linked_list.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct Iter<'a, T: 'a> {
7575
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
7676
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7777
f.debug_tuple("Iter")
78-
.field(&self.clone())
78+
.field(&self.len)
7979
.finish()
8080
}
8181
}
@@ -107,7 +107,8 @@ pub struct IterMut<'a, T: 'a> {
107107
impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
108108
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
109109
f.debug_tuple("IterMut")
110-
.field(self.clone())
110+
.field(&self.list)
111+
.field(&self.len)
111112
.finish()
112113
}
113114
}
@@ -129,7 +130,7 @@ pub struct IntoIter<T> {
129130
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
130131
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
131132
f.debug_tuple("IntoIter")
132-
.field(self.clone())
133+
.field(&self.list)
133134
.finish()
134135
}
135136
}
@@ -1128,7 +1129,7 @@ pub struct FrontPlace<'a, T: 'a> {
11281129
impl<'a, T: 'a + fmt::Debug> fmt::Debug for FrontPlace<'a, T> {
11291130
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11301131
f.debug_tuple("FrontPlace")
1131-
.field(self.clone())
1132+
.field(&self.list)
11321133
.finish()
11331134
}
11341135
}
@@ -1183,7 +1184,7 @@ pub struct BackPlace<'a, T: 'a> {
11831184
impl<'a, T: 'a + fmt::Debug> fmt::Debug for BackPlace<'a, T> {
11841185
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
11851186
f.debug_tuple("BackPlace")
1186-
.field(self.clone())
1187+
.field(&self.list)
11871188
.finish()
11881189
}
11891190
}

src/libcollections/tests/vec.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ fn test_extend() {
8484
let mut v = Vec::new();
8585
let mut w = Vec::new();
8686

87+
v.extend(w.clone());
88+
assert_eq!(v, &[]);
89+
8790
v.extend(0..3);
8891
for i in 0..3 {
8992
w.push(i)
@@ -100,6 +103,25 @@ fn test_extend() {
100103

101104
v.extend(w.clone()); // specializes to `append`
102105
assert!(v.iter().eq(w.iter().chain(w.iter())));
106+
107+
// Zero sized types
108+
#[derive(PartialEq, Debug)]
109+
struct Foo;
110+
111+
let mut a = Vec::new();
112+
let b = vec![Foo, Foo];
113+
114+
a.extend(b);
115+
assert_eq!(a, &[Foo, Foo]);
116+
117+
// Double drop
118+
let mut count_x = 0;
119+
{
120+
let mut x = Vec::new();
121+
let y = vec![DropCounter { count: &mut count_x }];
122+
x.extend(y);
123+
}
124+
assert_eq!(count_x, 1);
103125
}
104126

105127
#[test]

src/libcollections/vec.rs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,18 +1041,22 @@ impl<T> Vec<T> {
10411041
#[inline]
10421042
#[stable(feature = "append", since = "1.4.0")]
10431043
pub fn append(&mut self, other: &mut Self) {
1044-
self.reserve(other.len());
1045-
let len = self.len();
1046-
unsafe {
1047-
ptr::copy_nonoverlapping(other.as_ptr(), self.get_unchecked_mut(len), other.len());
1048-
}
1049-
1050-
self.len += other.len();
10511044
unsafe {
1045+
self.append_elements(other.as_slice() as _);
10521046
other.set_len(0);
10531047
}
10541048
}
10551049

1050+
/// Appends elements to `Self` from other buffer.
1051+
#[inline]
1052+
unsafe fn append_elements(&mut self, other: *const [T]) {
1053+
let count = (*other).len();
1054+
self.reserve(count);
1055+
let len = self.len();
1056+
ptr::copy_nonoverlapping(other as *const T, self.get_unchecked_mut(len), count);
1057+
self.len += count;
1058+
}
1059+
10561060
/// Create a draining iterator that removes the specified range in the vector
10571061
/// and yields the removed items.
10581062
///
@@ -1738,7 +1742,7 @@ impl<T, I> SpecExtend<T, I> for Vec<T>
17381742
vector
17391743
}
17401744

1741-
fn spec_extend(&mut self, iterator: I) {
1745+
default fn spec_extend(&mut self, iterator: I) {
17421746
// This is the case for a TrustedLen iterator.
17431747
let (low, high) = iterator.size_hint();
17441748
if let Some(high_value) = high {
@@ -1783,6 +1787,13 @@ impl<T> SpecExtend<T, IntoIter<T>> for Vec<T> {
17831787
vector
17841788
}
17851789
}
1790+
1791+
fn spec_extend(&mut self, mut iterator: IntoIter<T>) {
1792+
unsafe {
1793+
self.append_elements(iterator.as_slice() as _);
1794+
}
1795+
iterator.ptr = iterator.end;
1796+
}
17861797
}
17871798

17881799
impl<'a, T: 'a, I> SpecExtend<&'a T, I> for Vec<T>

src/libcollections/vec_deque.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,9 @@ pub struct Iter<'a, T: 'a> {
19131913
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> {
19141914
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
19151915
f.debug_tuple("Iter")
1916-
.field(&self.clone())
1916+
.field(&self.ring)
1917+
.field(&self.tail)
1918+
.field(&self.head)
19171919
.finish()
19181920
}
19191921
}
@@ -2000,7 +2002,9 @@ pub struct IterMut<'a, T: 'a> {
20002002
impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> {
20012003
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
20022004
f.debug_tuple("IterMut")
2003-
.field(&self.clone())
2005+
.field(&self.ring)
2006+
.field(&self.tail)
2007+
.field(&self.head)
20042008
.finish()
20052009
}
20062010
}
@@ -2081,7 +2085,7 @@ pub struct IntoIter<T> {
20812085
impl<T: fmt::Debug> fmt::Debug for IntoIter<T> {
20822086
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
20832087
f.debug_tuple("IntoIter")
2084-
.field(&self.clone())
2088+
.field(&self.inner)
20852089
.finish()
20862090
}
20872091
}
@@ -2139,7 +2143,9 @@ pub struct Drain<'a, T: 'a> {
21392143
impl<'a, T: 'a + fmt::Debug> fmt::Debug for Drain<'a, T> {
21402144
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
21412145
f.debug_tuple("Drain")
2142-
.field(&self.clone())
2146+
.field(&self.after_tail)
2147+
.field(&self.after_head)
2148+
.field(&self.iter)
21432149
.finish()
21442150
}
21452151
}

0 commit comments

Comments
 (0)