Skip to content

Commit 6bbee81

Browse files
committed
---
yaml --- r: 161527 b: refs/heads/snap-stage3 c: 64d58dc h: refs/heads/master i: 161525: 434375d 161523: 309304e 161519: 9604ff6 v: v3
1 parent 4ff283d commit 6bbee81

File tree

212 files changed

+5096
-4823
lines changed

Some content is hidden

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

212 files changed

+5096
-4823
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: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 74fb798a200dc82cf5b4a18065e3ea565229adc3
4+
refs/heads/snap-stage3: 64d58dcac2e57bd93c868ea9d49a8b877e1be5df
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/mk/crates.mk

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
56-
HOST_CRATES := syntax rustc rustc_trans rustdoc regex_macros fmt_macros \
57-
rustc_llvm rustc_back
56+
RUSTC_CRATES := rustc rustc_typeck rustc_driver rustc_trans rustc_back rustc_llvm
57+
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
5858
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5959
TOOLS := compiletest rustdoc rustc
6060

@@ -67,12 +67,16 @@ DEPS_std := core libc rand alloc collections rustrt unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
6969
DEPS_syntax := std term serialize log fmt_macros arena libc
70-
DEPS_rustc_trans := rustc rustc_back rustc_llvm libc
70+
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back \
71+
rustc_typeck log syntax serialize rustc_llvm rustc_trans
72+
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
73+
log syntax serialize rustc_llvm
74+
DEPS_rustc_typeck := rustc syntax
7175
DEPS_rustc := syntax flate arena serialize getopts rbml \
7276
time log graphviz rustc_llvm rustc_back
7377
DEPS_rustc_llvm := native:rustllvm libc std
7478
DEPS_rustc_back := std syntax rustc_llvm flate log libc
75-
DEPS_rustdoc := rustc rustc_trans native:hoedown serialize getopts \
79+
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
7680
test time
7781
DEPS_flate := std native:miniz
7882
DEPS_arena := std
@@ -94,7 +98,7 @@ DEPS_fmt_macros = std
9498

9599
TOOL_DEPS_compiletest := test getopts
96100
TOOL_DEPS_rustdoc := rustdoc
97-
TOOL_DEPS_rustc := rustc_trans
101+
TOOL_DEPS_rustc := rustc_driver
98102
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
99103
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
100104
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
@@ -110,8 +114,12 @@ ONLY_RLIB_unicode := 1
110114
# You should not need to edit below this line
111115
################################################################################
112116

113-
DOC_CRATES := $(filter-out rustc, $(filter-out rustc_trans, $(filter-out syntax, $(CRATES))))
114-
COMPILER_DOC_CRATES := rustc rustc_trans syntax
117+
DOC_CRATES := $(filter-out rustc, \
118+
$(filter-out rustc_trans, \
119+
$(filter-out rustc_typeck, \
120+
$(filter-out rustc_driver, \
121+
$(filter-out syntax, $(CRATES))))))
122+
COMPILER_DOC_CRATES := rustc rustc_trans rustc_typeck rustc_driver syntax
115123

116124
# This macro creates some simple definitions for each crate being built, just
117125
# some munging of all of the parameters above.

branches/snap-stage3/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $(eval $(call RUST_CRATE,coretest))
2121

2222
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
2323
TEST_DOC_CRATES = $(DOC_CRATES)
24-
TEST_HOST_CRATES = $(HOST_CRATES)
24+
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_trans,$(HOST_CRATES))
2525
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2626

2727
######################################################################

branches/snap-stage3/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ The two values of the boolean type are written `true` and `false`.
522522
### Symbols
523523

524524
```{.ebnf .gram}
525-
symbol : "::" "->"
525+
symbol : "::" | "->"
526526
| '#' | '[' | ']' | '(' | ')' | '{' | '}'
527527
| ',' | ';' ;
528528
```

branches/snap-stage3/src/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
extern crate "rustdoc" as this;
1313

1414
#[cfg(rustc)]
15-
extern crate "rustc_trans" as this;
15+
extern crate "rustc_driver" as this;
1616

1717
fn main() { this::main() }

branches/snap-stage3/src/etc/licenseck.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
"rt/isaac/randport.cpp", # public domain
3939
"rt/isaac/rand.h", # public domain
4040
"rt/isaac/standard.h", # public domain
41-
"libstd/sync/mpsc_queue.rs", # BSD
42-
"libstd/sync/spsc_queue.rs", # BSD
43-
"libstd/sync/mpmc_bounded_queue.rs", # BSD
41+
"libstd/comm/mpsc_queue.rs", # BSD
42+
"libstd/comm/spsc_queue.rs", # BSD
4443
"test/bench/shootout-binarytrees.rs", # BSD
4544
"test/bench/shootout-chameneos-redux.rs", # BSD
4645
"test/bench/shootout-fannkuch-redux.rs", # BSD

branches/snap-stage3/src/etc/rustup.sh

100644100755
Lines changed: 86 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ flag() {
188188
fi
189189
}
190190

191-
validate_opt () {
191+
validate_opt() {
192192
for arg in $CFG_ARGS
193193
do
194194
isArgValid=0
@@ -230,6 +230,7 @@ validate_opt () {
230230
}
231231

232232
probe_need CFG_CURL curl
233+
probe_need CFG_TAR tar
233234

234235
CFG_SRC_DIR="$(cd $(dirname $0) && pwd)/"
235236
CFG_SELF="$0"
@@ -388,89 +389,109 @@ esac
388389

389390
msg "host triple: ${HOST_TRIPLE}"
390391

391-
PACKAGE_NAME=rust-nightly
392-
PACKAGE_NAME_AND_TRIPLE="${PACKAGE_NAME}-${HOST_TRIPLE}"
393-
TARBALL_NAME="${PACKAGE_NAME_AND_TRIPLE}.tar.gz"
394-
REMOTE_TARBALL="https://static.rust-lang.org/dist/${TARBALL_NAME}"
395-
TMP_DIR="./rustup-tmp-install"
396-
LOCAL_TARBALL="${TMP_DIR}/${TARBALL_NAME}"
397-
LOCAL_INSTALL_DIR="${TMP_DIR}/${PACKAGE_NAME_AND_TRIPLE}"
398-
LOCAL_INSTALL_SCRIPT="${LOCAL_INSTALL_DIR}/install.sh"
392+
CFG_INSTALL_FLAGS=""
393+
if [ -n "${CFG_UNINSTALL}" ]
394+
then
395+
CFG_INSTALL_FLAGS="${CFG_INSTALL_FLAGS} --uninstall"
396+
fi
397+
398+
if [ -n "${CFG_PREFIX}" ]
399+
then
400+
CFG_INSTALL_FLAGS="${CFG_INSTALL_FLAGS} --prefix=${CFG_PREFIX}"
401+
fi
402+
403+
CFG_TMP_DIR="./rustup-tmp-install"
399404

405+
RUST_URL="https://static.rust-lang.org/dist"
406+
RUST_PACKAGE_NAME=rust-nightly
407+
RUST_PACKAGE_NAME_AND_TRIPLE="${RUST_PACKAGE_NAME}-${HOST_TRIPLE}"
408+
RUST_TARBALL_NAME="${RUST_PACKAGE_NAME_AND_TRIPLE}.tar.gz"
409+
RUST_LOCAL_INSTALL_DIR="${CFG_TMP_DIR}/${RUST_PACKAGE_NAME_AND_TRIPLE}"
410+
RUST_LOCAL_INSTALL_SCRIPT="${RUST_LOCAL_INSTALL_DIR}/install.sh"
411+
412+
CARGO_URL="https://static.rust-lang.org/cargo-dist"
400413
CARGO_PACKAGE_NAME=cargo-nightly
401414
CARGO_PACKAGE_NAME_AND_TRIPLE="${CARGO_PACKAGE_NAME}-${HOST_TRIPLE}"
402415
CARGO_TARBALL_NAME="${CARGO_PACKAGE_NAME_AND_TRIPLE}.tar.gz"
403-
CARGO_REMOTE_TARBALL="https://static.rust-lang.org/cargo-dist/${CARGO_TARBALL_NAME}"
404-
CARGO_LOCAL_TARBALL="${TMP_DIR}/${CARGO_TARBALL_NAME}"
405-
CARGO_LOCAL_INSTALL_DIR="${TMP_DIR}/${CARGO_PACKAGE_NAME_AND_TRIPLE}"
416+
CARGO_LOCAL_INSTALL_DIR="${CFG_TMP_DIR}/${CARGO_PACKAGE_NAME_AND_TRIPLE}"
406417
CARGO_LOCAL_INSTALL_SCRIPT="${CARGO_LOCAL_INSTALL_DIR}/install.sh"
407418

408-
rm -Rf "${TMP_DIR}"
409-
need_ok "failed to remove temporary installation directory"
419+
# Fetch the package.
420+
download_package() {
421+
remote_tarball="$1"
422+
local_tarball="$2"
410423

411-
mkdir -p "${TMP_DIR}"
412-
need_ok "failed to create create temporary installation directory"
424+
msg "Downloading ${remote_tarball} to ${local_tarball}"
413425

414-
msg "downloading rust installer"
415-
"${CFG_CURL}" "${REMOTE_TARBALL}" > "${LOCAL_TARBALL}"
416-
if [ $? -ne 0 ]
417-
then
418-
rm -Rf "${TMP_DIR}"
419-
err "failed to download installer"
420-
fi
426+
mkdir -p "${CFG_TMP_DIR}"
427+
need_ok "failed to create create download directory"
421428

422-
if [ -z "${CFG_DISABLE_CARGO}" ]; then
423-
msg "downloading cargo installer"
424-
"${CFG_CURL}" "${CARGO_REMOTE_TARBALL}" > "${CARGO_LOCAL_TARBALL}"
429+
"${CFG_CURL}" -f -o "${local_tarball}" "${remote_tarball}"
425430
if [ $? -ne 0 ]
426431
then
427-
rm -Rf "${TMP_DIR}"
428-
err "failed to download cargo installer"
432+
rm -Rf "${CFG_TMP_DIR}"
433+
err "failed to download installer"
429434
fi
430-
fi
435+
}
431436

437+
# Wrap all the commands needed to install a package.
438+
install_package() {
439+
tarball_name="$1"
440+
install_script="$2"
432441

433-
(cd "${TMP_DIR}" && tar xzf "${TARBALL_NAME}")
434-
if [ $? -ne 0 ]
435-
then
436-
rm -Rf "${TMP_DIR}"
442+
msg "Extracting ${tarball_name}"
443+
(cd "${CFG_TMP_DIR}" && "${CFG_TAR}" -xvf "${tarball_name}")
444+
if [ $? -ne 0 ]; then
445+
rm -Rf "${CFG_TMP_DIR}"
437446
err "failed to unpack installer"
438-
fi
439-
440-
MAYBE_UNINSTALL=
441-
if [ -n "${CFG_UNINSTALL}" ]
442-
then
443-
MAYBE_UNINSTALL="--uninstall"
444-
fi
445-
446-
MAYBE_PREFIX=
447-
if [ -n "${CFG_PREFIX}" ]
448-
then
449-
MAYBE_PREFIX="--prefix=${CFG_PREFIX}"
450-
fi
451-
452-
sh "${LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}" "${MAYBE_PREFIX}"
453-
if [ $? -ne 0 ]
454-
then
455-
rm -Rf "${TMP_DIR}"
456-
err "failed to install Rust"
457-
fi
447+
fi
458448

459-
if [ -z "${CFG_DISABLE_CARGO}" ]; then
460-
(cd "${TMP_DIR}" && tar xzf "${CARGO_TARBALL_NAME}")
449+
sh "${install_script}" "${CFG_INSTALL_FLAGS}"
461450
if [ $? -ne 0 ]
462451
then
463-
rm -Rf "${TMP_DIR}"
464-
err "failed to unpack cargo installer"
452+
rm -Rf "${CFG_TMP_DIR}"
453+
err "failed to install Rust"
465454
fi
455+
}
466456

467-
sh "${CARGO_LOCAL_INSTALL_SCRIPT}" "${MAYBE_UNINSTALL}" "${MAYBE_PREFIX}"
468-
if [ $? -ne 0 ]
469-
then
470-
rm -Rf "${TMP_DIR}"
471-
err "failed to install Cargo"
457+
# It's possible that curl could be interrupted partway though downloading
458+
# `rustup.sh`, truncating the file. This could be especially bad if we were in
459+
# the middle of a line that would run "rm -rf ". To protect against this, we
460+
# wrap up the `rustup.sh` destructive functionality in this helper function,
461+
# which we call as the last thing we do. This means we will not do anything
462+
# unless we have the entire file downloaded.
463+
install_packages() {
464+
rm -Rf "${CFG_TMP_DIR}"
465+
need_ok "failed to remove temporary installation directory"
466+
467+
mkdir -p "${CFG_TMP_DIR}"
468+
need_ok "failed to create create temporary installation directory"
469+
470+
RUST_LOCAL_TARBALL="${CFG_TMP_DIR}/${RUST_TARBALL_NAME}"
471+
CARGO_LOCAL_TARBALL="${CFG_TMP_DIR}/${CARGO_TARBALL_NAME}"
472+
473+
download_package \
474+
"${RUST_URL}/${RUST_TARBALL_NAME}" \
475+
"${RUST_LOCAL_TARBALL}"
476+
477+
if [ -z "${CFG_DISABLE_CARGO}" ]; then
478+
download_package \
479+
"${CARGO_URL}/${CARGO_TARBALL_NAME}" \
480+
"${CARGO_LOCAL_TARBALL}"
472481
fi
473-
fi
474482

475-
rm -Rf "${TMP_DIR}"
476-
need_ok "couldn't rm temporary installation directory"
483+
install_package \
484+
"${RUST_TARBALL_NAME}" \
485+
"${RUST_LOCAL_INSTALL_SCRIPT}"
486+
487+
if [ -z "${CFG_DISABLE_CARGO}" ]; then
488+
install_package \
489+
"${CARGO_TARBALL_NAME}" \
490+
"${CARGO_LOCAL_INSTALL_SCRIPT}"
491+
fi
492+
493+
rm -Rf "${CFG_TMP_DIR}"
494+
need_ok "couldn't rm temporary installation directory"
495+
}
496+
497+
install_packages

branches/snap-stage3/src/libcollections/dlist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,15 +945,15 @@ mod tests {
945945
let mut m = list_from(v.as_slice());
946946
m.rotate_backward(); check_links(&m);
947947
m.rotate_forward(); check_links(&m);
948-
assert_eq!(v.iter().collect::<Vec<&int>>(), m.iter().collect());
948+
assert_eq!(v.iter().collect::<Vec<&int>>(), m.iter().collect::<Vec<_>>());
949949
m.rotate_forward(); check_links(&m);
950950
m.rotate_forward(); check_links(&m);
951951
m.pop_front(); check_links(&m);
952952
m.rotate_forward(); check_links(&m);
953953
m.rotate_backward(); check_links(&m);
954954
m.push_front(9); check_links(&m);
955955
m.rotate_forward(); check_links(&m);
956-
assert_eq!(vec![3i,9,5,1,2], m.into_iter().collect());
956+
assert_eq!(vec![3i,9,5,1,2], m.into_iter().collect::<Vec<_>>());
957957
}
958958

959959
#[test]

branches/snap-stage3/src/libcollections/enum_set.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -397,23 +397,23 @@ mod test {
397397
fn test_iterator() {
398398
let mut e1: EnumSet<Foo> = EnumSet::new();
399399

400-
let elems: Vec<Foo> = e1.iter().collect();
400+
let elems: ::vec::Vec<Foo> = e1.iter().collect();
401401
assert!(elems.is_empty())
402402

403403
e1.insert(A);
404-
let elems = e1.iter().collect();
404+
let elems: ::vec::Vec<_> = e1.iter().collect();
405405
assert_eq!(vec![A], elems)
406406

407407
e1.insert(C);
408-
let elems = e1.iter().collect();
408+
let elems: ::vec::Vec<_> = e1.iter().collect();
409409
assert_eq!(vec![A,C], elems)
410410

411411
e1.insert(C);
412-
let elems = e1.iter().collect();
412+
let elems: ::vec::Vec<_> = e1.iter().collect();
413413
assert_eq!(vec![A,C], elems)
414414

415415
e1.insert(B);
416-
let elems = e1.iter().collect();
416+
let elems: ::vec::Vec<_> = e1.iter().collect();
417417
assert_eq!(vec![A,B,C], elems)
418418
}
419419

@@ -431,35 +431,35 @@ mod test {
431431
e2.insert(C);
432432

433433
let e_union = e1 | e2;
434-
let elems = e_union.iter().collect();
434+
let elems: ::vec::Vec<_> = e_union.iter().collect();
435435
assert_eq!(vec![A,B,C], elems)
436436

437437
let e_intersection = e1 & e2;
438-
let elems = e_intersection.iter().collect();
438+
let elems: ::vec::Vec<_> = e_intersection.iter().collect();
439439
assert_eq!(vec![C], elems)
440440

441441
// Another way to express intersection
442442
let e_intersection = e1 - (e1 - e2);
443-
let elems = e_intersection.iter().collect();
443+
let elems: ::vec::Vec<_> = e_intersection.iter().collect();
444444
assert_eq!(vec![C], elems)
445445

446446
let e_subtract = e1 - e2;
447-
let elems = e_subtract.iter().collect();
447+
let elems: ::vec::Vec<_> = e_subtract.iter().collect();
448448
assert_eq!(vec![A], elems)
449449

450450
// Bitwise XOR of two sets, aka symmetric difference
451451
let e_symmetric_diff = e1 ^ e2;
452-
let elems = e_symmetric_diff.iter().collect();
452+
let elems: ::vec::Vec<_> = e_symmetric_diff.iter().collect();
453453
assert_eq!(vec![A,B], elems)
454454

455455
// Another way to express symmetric difference
456456
let e_symmetric_diff = (e1 - e2) | (e2 - e1);
457-
let elems = e_symmetric_diff.iter().collect();
457+
let elems: ::vec::Vec<_> = e_symmetric_diff.iter().collect();
458458
assert_eq!(vec![A,B], elems)
459459

460460
// Yet another way to express symmetric difference
461461
let e_symmetric_diff = (e1 | e2) - (e1 & e2);
462-
let elems = e_symmetric_diff.iter().collect();
462+
let elems: ::vec::Vec<_> = e_symmetric_diff.iter().collect();
463463
assert_eq!(vec![A,B], elems)
464464
}
465465

branches/snap-stage3/src/libcollections/str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ impl<'a> Ord for MaybeOwned<'a> {
563563
}
564564
}
565565

566+
#[allow(deprecated)]
566567
#[deprecated = "use std::str::CowString"]
567568
impl<'a, S: Str> Equiv<S> for MaybeOwned<'a> {
568569
#[inline]

0 commit comments

Comments
 (0)