diff --git a/mk/crates.mk b/mk/crates.mk index cf985a0d980b4..acb36b2f7da6c 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -65,7 +65,7 @@ HOST_CRATES := syntax syntax_ext proc_macro_tokens proc_macro_plugin syntax_pos TOOLS := compiletest rustdoc rustc rustbook error_index_generator DEPS_core := -DEPS_compiler_builtins := core +DEPS_compiler_builtins := core native:compiler-rt DEPS_alloc := core libc alloc_system DEPS_alloc_system := core libc DEPS_alloc_jemalloc := core libc native:jemalloc @@ -79,11 +79,7 @@ DEPS_panic_unwind := libc alloc unwind DEPS_unwind := libc RUSTFLAGS_compiler_builtins := -lstatic=compiler-rt - -# FIXME(stage0): change this to just `RUSTFLAGS_panic_abort := ...` -RUSTFLAGS1_panic_abort := -C panic=abort -RUSTFLAGS2_panic_abort := -C panic=abort -RUSTFLAGS3_panic_abort := -C panic=abort +RUSTFLAGS_panic_abort := -C panic=abort DEPS_std := core libc rand alloc collections compiler_builtins rustc_unicode \ native:backtrace \ diff --git a/mk/main.mk b/mk/main.mk index 9936c5b59be5c..49fdfc4118df5 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -372,15 +372,12 @@ CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATUR # Turn on feature-staging export CFG_DISABLE_UNSTABLE_FEATURES # Subvert unstable feature lints to do the self-build -export RUSTC_BOOTSTRAP=1 endif ifdef CFG_MUSL_ROOT export CFG_MUSL_ROOT endif -# FIXME: Transitionary measure to bootstrap using the old bootstrap logic. -# Remove this once the bootstrap compiler uses the new login in Issue #36548. -export RUSTC_BOOTSTRAP_KEY=62b3e239 +export RUSTC_BOOTSTRAP := 1 ###################################################################### # Per-stage targets and runner @@ -443,10 +440,7 @@ endif TSREQ$(1)_T_$(2)_H_$(3) = \ $$(HSREQ$(1)_H_$(3)) \ $$(foreach obj,$$(REQUIRED_OBJECTS_$(2)),\ - $$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj)) \ - $$(TLIB0_T_$(2)_H_$(3))/$$(call CFG_STATIC_LIB_NAME_$(2),compiler-rt) -# ^ This copies `libcompiler-rt.a` to the stage0 sysroot -# ^ TODO(stage0) update this to not copy `libcompiler-rt.a` to stage0 + $$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj)) # Prerequisites for a working stageN compiler and libraries, for a specific # target diff --git a/src/Cargo.lock b/src/Cargo.lock index ab1c1c453dd23..bff6ef206775c 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -45,7 +45,6 @@ dependencies = [ "gcc 0.3.38 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", - "md5 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -172,11 +171,6 @@ name = "log" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "md5" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "num_cpus" version = "0.2.13" @@ -686,7 +680,6 @@ dependencies = [ "checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" "checksum libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "044d1360593a78f5c8e5e710beccdc24ab71d1f01bc19a29bcacdba22e8475d8" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" -"checksum md5 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a5539a8dee9b4ae308c9c406a379838b435a8f2c84cf9fedc6d5a576be9888db" "checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" "checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b" "checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796" diff --git a/src/Cargo.toml b/src/Cargo.toml index dbd2f7743dc08..8fb5c70c41bf1 100644 --- a/src/Cargo.toml +++ b/src/Cargo.toml @@ -11,3 +11,20 @@ members = [ "tools/rustbook", "tools/tidy", ] + +# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit +# MSVC when running the compile-fail test suite when a should-fail test panics. +# But hey if this is removed and it gets past the bots, sounds good to me. +[profile.release] +opt-level = 2 +[profile.bench] +opt-level = 2 + +# These options are controlled from our rustc wrapper script, so turn them off +# here and have them controlled elsewhere. +[profile.dev] +debug = false +debug-assertions = false +[profile.test] +debug = false +debug-assertions = false diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 4c9b578c1349d..35f8fb43f7b56 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -29,4 +29,3 @@ getopts = "0.2" rustc-serialize = "0.3" gcc = "0.3.38" libc = "0.2" -md5 = "0.1" diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index 879c383404a4c..b2341f5978704 100644 --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs @@ -20,7 +20,6 @@ use std::io::prelude::*; use std::process::Command; use build_helper::output; -use md5; use Build; @@ -91,20 +90,4 @@ pub fn collect(build: &mut Build) { build.ver_hash = Some(ver_hash); build.short_ver_hash = Some(short_ver_hash); } - - // Calculate this compiler's bootstrap key, which is currently defined as - // the first 8 characters of the md5 of the release string. - let key = md5::compute(build.release.as_bytes()); - build.bootstrap_key = format!("{:02x}{:02x}{:02x}{:02x}", - key[0], key[1], key[2], key[3]); - - // Slurp up the stage0 bootstrap key as we're bootstrapping from an - // otherwise stable compiler. - let mut s = String::new(); - t!(t!(File::open(build.src.join("src/stage0.txt"))).read_to_string(&mut s)); - if let Some(line) = s.lines().find(|l| l.starts_with("rustc_key")) { - if let Some(key) = line.split(": ").nth(1) { - build.bootstrap_key_stage0 = key.to_string(); - } - } } diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 150232e4ab407..b67eab38f5dd2 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -220,7 +220,7 @@ pub fn compiletest(build: &Build, } } } - build.add_bootstrap_key(&mut cmd); + cmd.env("RUSTC_BOOTSTRAP", "1"); cmd.arg("--adb-path").arg("adb"); cmd.arg("--adb-test-dir").arg(ADB_TEST_DIR); diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 236989dbcfeb5..b268686ca6c3b 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -120,8 +120,8 @@ fn build_startup_objects(build: &Build, target: &str, into: &Path) { for file in t!(fs::read_dir(build.src.join("src/rtstartup"))) { let file = t!(file); let mut cmd = Command::new(&compiler_path); - build.add_bootstrap_key(&mut cmd); - build.run(cmd.arg("--target").arg(target) + build.run(cmd.env("RUSTC_BOOTSTRAP", "1") + .arg("--target").arg(target) .arg("--emit=obj") .arg("--out-dir").arg(into) .arg(file.path())); diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 03c74ff081ae0..590c967d147f2 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -22,7 +22,6 @@ extern crate cmake; extern crate filetime; extern crate gcc; extern crate getopts; -extern crate md5; extern crate num_cpus; extern crate rustc_serialize; extern crate toml; @@ -120,8 +119,6 @@ pub struct Build { version: String, package_vers: String, local_rebuild: bool, - bootstrap_key: String, - bootstrap_key_stage0: String, // Probed tools at runtime lldb_version: Option, @@ -205,8 +202,6 @@ impl Build { ver_date: None, version: String::new(), local_rebuild: local_rebuild, - bootstrap_key: String::new(), - bootstrap_key_stage0: String::new(), package_vers: String::new(), cc: HashMap::new(), cxx: HashMap::new(), @@ -438,7 +433,8 @@ impl Build { .env("RUSTDOC_REAL", self.rustdoc(compiler)) .env("RUSTC_FLAGS", self.rustc_flags(target).join(" ")); - self.add_bootstrap_key(&mut cargo); + // Enable usage of unstable features + cargo.env("RUSTC_BOOTSTRAP", "1"); // Specify some various options for build scripts used throughout // the build. @@ -655,14 +651,6 @@ impl Build { add_lib_path(vec![self.rustc_libdir(compiler)], cmd); } - /// Adds the compiler's bootstrap key to the environment of `cmd`. - fn add_bootstrap_key(&self, cmd: &mut Command) { - cmd.env("RUSTC_BOOTSTRAP", "1"); - // FIXME: Transitionary measure to bootstrap using the old bootstrap logic. - // Remove this once the bootstrap compiler uses the new login in Issue #36548. - cmd.env("RUSTC_BOOTSTRAP_KEY", "62b3e239"); - } - /// Returns the compiler's libdir where it stores the dynamic libraries that /// it itself links against. /// diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 07f5e725e2003..9834fca5fdc78 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -89,7 +89,6 @@ #![feature(specialization)] #![feature(staged_api)] #![feature(unboxed_closures)] -#![cfg_attr(stage0, feature(question_mark))] #![feature(never_type)] #![feature(prelude_import)] diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index 03057af4a843b..220051c9d35ea 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -295,7 +295,6 @@ #![cfg_attr(not(stage0), deny(warnings))] #![feature(str_escape)] -#![cfg_attr(stage0, feature(question_mark))] use self::LabelText::*; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index c0ea8d6b1e38b..7c26b710a53cb 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -31,7 +31,6 @@ #![feature(conservative_impl_trait)] #![feature(const_fn)] #![feature(core_intrinsics)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![cfg_attr(stage0, feature(item_like_imports))] #![feature(libc)] #![feature(nonzero)] @@ -41,7 +40,6 @@ #![feature(slice_patterns)] #![feature(staged_api)] #![feature(unboxed_closures)] -#![cfg_attr(stage0, feature(question_mark))] #![cfg_attr(test, feature(test))] extern crate arena; diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index da5f787bdf31e..3dc577b3c647a 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -36,7 +36,6 @@ #![feature(rand)] #![feature(rustc_private)] #![feature(staged_api)] -#![cfg_attr(stage0, feature(question_mark))] #![cfg_attr(test, feature(rand))] extern crate syntax; diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index 2cd709dbd36eb..1ff232da427fc 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -19,14 +19,12 @@ #![allow(non_camel_case_types)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] #![feature(associated_consts)] #![feature(nonzero)] -#![cfg_attr(stage0, feature(question_mark))] #[macro_use] extern crate log; #[macro_use] extern crate syntax; extern crate syntax_pos; diff --git a/src/librustc_const_eval/lib.rs b/src/librustc_const_eval/lib.rs index 3fa60f86c98c4..7a6cc4937232d 100644 --- a/src/librustc_const_eval/lib.rs +++ b/src/librustc_const_eval/lib.rs @@ -22,12 +22,10 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/")] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(rustc_private)] #![feature(staged_api)] #![feature(rustc_diagnostic_macros)] #![feature(slice_patterns)] -#![cfg_attr(stage0, feature(question_mark))] #![feature(box_patterns)] #![feature(box_syntax)] diff --git a/src/librustc_const_math/lib.rs b/src/librustc_const_math/lib.rs index 31fccb41ce573..f667ff23b27a6 100644 --- a/src/librustc_const_math/lib.rs +++ b/src/librustc_const_math/lib.rs @@ -25,7 +25,6 @@ #![feature(rustc_private)] #![feature(staged_api)] -#![cfg_attr(stage0, feature(question_mark))] #[macro_use] extern crate log; #[macro_use] extern crate syntax; diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index a0863e0d29422..b79eca0c22d7e 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -24,14 +24,12 @@ #![cfg_attr(not(stage0), deny(warnings))] #![feature(box_syntax)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(libc)] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(set_stdio)] #![feature(staged_api)] -#![cfg_attr(stage0, feature(question_mark))] extern crate arena; extern crate flate; diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index badee66b83dea..d7c15f550e040 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -21,7 +21,6 @@ #![allow(unused_attributes)] #![feature(rustc_private)] #![feature(staged_api)] -#![cfg_attr(stage0, feature(question_mark))] #![feature(range_contains)] #![feature(libc)] #![feature(unicode)] diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs index 4a5a6b9bea900..b72766bccea21 100644 --- a/src/librustc_incremental/lib.rs +++ b/src/librustc_incremental/lib.rs @@ -19,8 +19,6 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] -#![cfg_attr(stage0, feature(question_mark))] #![feature(rustc_private)] #![feature(staged_api)] #![feature(rand)] diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index ec0a124770c48..6c9a3e99a0458 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -31,7 +31,6 @@ #![cfg_attr(test, feature(test))] #![feature(box_patterns)] #![feature(box_syntax)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index c4ec418f224b5..0229776c94833 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -24,11 +24,11 @@ #![feature(associated_consts)] #![feature(box_syntax)] +#![feature(concat_idents)] #![feature(libc)] #![feature(link_args)] -#![feature(staged_api)] #![feature(linked_from)] -#![feature(concat_idents)] +#![feature(staged_api)] extern crate libc; diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index 2fd40181d7c74..56f3cfc12c97f 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -20,10 +20,8 @@ #![feature(box_patterns)] #![feature(conservative_impl_trait)] #![feature(core_intrinsics)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(proc_macro_internals)] #![feature(proc_macro_lib)] -#![cfg_attr(stage0, feature(question_mark))] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 62e405564dbb7..617bd81d96a2c 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -22,12 +22,10 @@ Rust MIR: a lowered representation of Rust. Also: an experiment! #![feature(associated_consts)] #![feature(box_patterns)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![cfg_attr(stage0, feature(item_like_imports))] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] -#![cfg_attr(stage0, feature(question_mark))] #[macro_use] extern crate log; extern crate graphviz as dot; diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs index 039a76d25c7e1..525d49ddd820c 100644 --- a/src/librustc_passes/lib.rs +++ b/src/librustc_passes/lib.rs @@ -23,7 +23,6 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(rustc_diagnostic_macros)] #![feature(staged_api)] #![feature(rustc_private)] diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 4020c45f59e1a..1071203af2bc5 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -17,7 +17,6 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 058c8266a35e9..0259e5bedae30 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -19,7 +19,6 @@ #![feature(associated_consts)] #![feature(borrow_state)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 389892193c330..7a2b74c06db8a 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -18,7 +18,6 @@ #![cfg_attr(not(stage0), deny(warnings))] #![feature(custom_attribute)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![allow(unused_attributes)] #![feature(rustc_private)] #![feature(staged_api)] diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index d0cb302e1ab1f..0e7ead30a933a 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -29,7 +29,6 @@ #![feature(cell_extras)] #![feature(const_fn)] #![feature(custom_attribute)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![allow(unused_attributes)] #![feature(libc)] #![feature(quote)] @@ -38,7 +37,6 @@ #![feature(slice_patterns)] #![feature(staged_api)] #![feature(unicode)] -#![cfg_attr(stage0, feature(question_mark))] use rustc::dep_graph::WorkProduct; diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 049add6f0620c..dfa662590297f 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -77,12 +77,10 @@ This API is completely unstable and subject to change. #![feature(box_patterns)] #![feature(box_syntax)] #![feature(conservative_impl_trait)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(quote)] #![feature(rustc_diagnostic_macros)] #![feature(rustc_private)] #![feature(staged_api)] -#![cfg_attr(stage0, feature(question_mark))] #[macro_use] extern crate log; #[macro_use] extern crate syntax; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 60ce7ea53953a..5073baa420e82 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -20,7 +20,6 @@ #![feature(box_patterns)] #![feature(box_syntax)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(libc)] #![feature(rustc_private)] #![feature(set_stdio)] @@ -28,7 +27,6 @@ #![feature(staged_api)] #![feature(test)] #![feature(unicode)] -#![cfg_attr(stage0, feature(question_mark))] extern crate arena; extern crate getopts; diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 884f24ddc4c75..d432ed42066a1 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -35,7 +35,6 @@ Core encoding and decoding interfaces. #![feature(specialization)] #![feature(staged_api)] #![feature(unicode)] -#![cfg_attr(stage0, feature(question_mark))] #![cfg_attr(test, feature(test))] // test harness access diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 12dbbe3c46918..8132b1392602f 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -249,7 +249,6 @@ #![feature(const_fn)] #![feature(core_float)] #![feature(core_intrinsics)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(dropck_parametricity)] #![feature(float_extras)] #![feature(float_from_str_radix)] @@ -276,7 +275,6 @@ #![feature(panic_unwind)] #![feature(placement_in_syntax)] #![feature(prelude_import)] -#![cfg_attr(stage0, feature(question_mark))] #![feature(rand)] #![feature(raw)] #![feature(repr_simd)] diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 7a9347ded1255..3e8dfda4a9a58 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -32,10 +32,8 @@ #![feature(staged_api)] #![feature(str_escape)] #![feature(unicode)] -#![cfg_attr(stage0, feature(question_mark))] #![feature(rustc_diagnostic_macros)] #![feature(specialization)] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] extern crate core; extern crate serialize; diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index e83fd55cd714b..66d6c0570ace7 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -19,7 +19,6 @@ html_root_url = "https://doc.rust-lang.org/nightly/")] #![cfg_attr(not(stage0), deny(warnings))] -#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))] #![feature(proc_macro_lib)] #![feature(proc_macro_internals)] #![feature(rustc_private)] diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index d6e45aa0b9f0c..44067b3132c1d 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -27,7 +27,6 @@ #![allow(unused_attributes)] #![feature(rustc_private)] #![feature(staged_api)] -#![cfg_attr(stage0, feature(question_mark))] #![feature(specialization)] use std::cell::{Cell, RefCell}; diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs index caef808f474ec..01daa938142b1 100644 --- a/src/libterm/lib.rs +++ b/src/libterm/lib.rs @@ -59,7 +59,6 @@ #![cfg_attr(windows, feature(libc))] // Handle rustfmt skips #![feature(custom_attribute)] -#![cfg_attr(stage0, feature(question_mark))] #![allow(unused_attributes)] use std::io::prelude::*; diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 8749a64e5fdb4..142ae86c6a30d 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -38,7 +38,6 @@ #![feature(rustc_private)] #![feature(set_stdio)] #![feature(staged_api)] -#![cfg_attr(stage0, feature(question_mark))] #![feature(panic_unwind)] extern crate getopts; diff --git a/src/rustc/Cargo.toml b/src/rustc/Cargo.toml index 24499cb8f08c2..dce1a0a8ec858 100644 --- a/src/rustc/Cargo.toml +++ b/src/rustc/Cargo.toml @@ -11,17 +11,6 @@ path = "rustc.rs" name = "rustdoc" path = "rustdoc.rs" -[profile.release] -opt-level = 2 -[profile.bench] -opt-level = 2 - -# These options are controlled from our rustc wrapper script, so turn them off -# here and have them controlled elsewhere. -[profile.dev] -debug = false -debug-assertions = false - # All optional dependencies so the features passed to this Cargo.toml select # what should actually be built. [dependencies] diff --git a/src/rustc/std_shim/Cargo.toml b/src/rustc/std_shim/Cargo.toml index b4b7acc4e66b8..18680dc4fd9a1 100644 --- a/src/rustc/std_shim/Cargo.toml +++ b/src/rustc/std_shim/Cargo.toml @@ -28,17 +28,6 @@ authors = ["The Rust Project Developers"] name = "std_shim" path = "lib.rs" -[profile.release] -opt-level = 2 -[profile.bench] -opt-level = 2 - -# These options are controlled from our rustc wrapper script, so turn them off -# here and have them controlled elsewhere. -[profile.dev] -debug = false -debug-assertions = false - [dependencies] std = { path = "../../libstd" } core = { path = "../../libcore" } diff --git a/src/rustc/test_shim/Cargo.toml b/src/rustc/test_shim/Cargo.toml index 87f2ccd51e885..ac7842770f5bb 100644 --- a/src/rustc/test_shim/Cargo.toml +++ b/src/rustc/test_shim/Cargo.toml @@ -12,16 +12,5 @@ authors = ["The Rust Project Developers"] name = "test_shim" path = "lib.rs" -[profile.release] -opt-level = 2 -[profile.bench] -opt-level = 2 - -# These options are controlled from our rustc wrapper script, so turn them off -# here and have them controlled elsewhere. -[profile.dev] -debug = false -debug-assertions = false - [dependencies] test = { path = "../../libtest" } diff --git a/src/stage0.txt b/src/stage0.txt index ac2050a6fc8f1..223974186b1df 100644 --- a/src/stage0.txt +++ b/src/stage0.txt @@ -12,5 +12,5 @@ # tarball for a stable release you'll likely see `1.x.0-$date` where `1.x.0` was # released on `$date` -rustc: beta-2016-09-28 -cargo: nightly-2016-09-26 +rustc: beta-2016-11-16 +cargo: nightly-2016-11-16 diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index e05d57365f875..227b695635dce 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -4,12 +4,6 @@ name = "compiletest" version = "0.0.0" build = "build.rs" -# Curiously, this will segfault if compiled with opt-level=3 on 64-bit MSVC when -# running the compile-fail test suite when a should-fail test panics. But hey if -# this is removed and it gets past the bots, sounds good to me. -[profile.release] -opt-level = 2 - [dependencies] log = "0.3" env_logger = { version = "0.3.5", default-features = false } diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 806363679d174..d8681c9d6ed24 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -16,8 +16,6 @@ #![feature(test)] #![feature(libc)] -#![cfg_attr(stage0, feature(question_mark))] - #![deny(warnings)] extern crate libc; diff --git a/src/vendor/md5/.cargo-checksum.json b/src/vendor/md5/.cargo-checksum.json deleted file mode 100644 index 5d44203c12cf8..0000000000000 --- a/src/vendor/md5/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",".gitignore":"944bf600c6230664922a011cbca026699969f2f89f6c7ff689835836ccd7b1de",".travis.yml":"3d7b50e89ac6ecc0c3a31273c1785a905aa528ccf70503973bf34fa49537519f","Cargo.toml":"7ed65153877c1057bac21ad6483ae2f6feb7713da2516f788528c81c222e1686","LICENSE.txt":"2362080adc3f0fb1a071ffe7dc5557cbb420058f319e284d53213a1e05687242","README.md":"f96785f9a0782f425cde37f0e4ec577f1097f92c38af291509e3953c20e9b87f","benches/lib.rs":"7ae37fded40473821a1e0d898d3e978efddfd1a2d2efcd550b84089932c8db23","src/lib.rs":"208c67b843ebbc02be1649dd40235088bf87d00c1a336a162118b4f352a03cb0"},"package":"a5539a8dee9b4ae308c9c406a379838b435a8f2c84cf9fedc6d5a576be9888db"} \ No newline at end of file diff --git a/src/vendor/md5/.cargo-ok b/src/vendor/md5/.cargo-ok deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/src/vendor/md5/.gitignore b/src/vendor/md5/.gitignore deleted file mode 100644 index fa8d85ac52f19..0000000000000 --- a/src/vendor/md5/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Cargo.lock -target diff --git a/src/vendor/md5/.travis.yml b/src/vendor/md5/.travis.yml deleted file mode 100644 index f68b0f3293bfd..0000000000000 --- a/src/vendor/md5/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: rust -sudo: required - -after_success: curl https://stainless-steel.github.io/travis/after_success.sh | bash - -env: - global: - secure: wq8fhRMctnvAck7rhva9151pveqKYK9uER9Dytdz1UIzWGbtuS5vpGdgc7txW/xtdyuLGbioPvziCvFvoQbGd3NfWpRM1fo4AIwaOxFpKgPPywgFrlBtqp1XmBmJUaAxcwMtQCbY7f0Q48ycQZsmuXRQSkMEXlXURNh8us96MP5Rm9B4UndArVUe/tEXqy8SNKFMHqKja6okvDg03hRDtfQtk8lu1+QkguA5Zd0tpNBw9UjxoUn/FL0yCP0hq0VP6It680hRAJmhpJ8XRayGvbb+PX2VZNcgHpMxtsoY2zAR5j+I6mVwjC8VMIeUMQQbu6yUeFrDQYpBC9d4syRupluNLLzbxzl3Pb6yUYjT6deniRJA5H4Bs5V68a5/wTaapmqkAUIZKiPYpQr4L0MGSyHvLuWf1L3WdOmJkUvsPUIJExqEpNFRhEPIc7a5ZcyzeFFYRTa1VnMaNlLB0ZP5fF5Mgjmh0cvq88LnrSZI9t3obJMD4F0GKLuI2tJM57WWCHETWziAtQ2h2Cx8J/tivH/zT78yrkzl4tX5garFG4C2OWDdyhX/8zFG197RYKb9fI802um9FHXO6fpq1G3GUH8sZhDZYn3MeexGvbKI0Rb48toBl7EjbPaIuE/PE4O0UoK5WJqJCS2lBgZMs64phcRef7/sRHga4znBea75TTI= - -notifications: - email: false diff --git a/src/vendor/md5/Cargo.toml b/src/vendor/md5/Cargo.toml deleted file mode 100644 index 30e221473a8bc..0000000000000 --- a/src/vendor/md5/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "md5" -version = "0.1.1" -authors = ["Ivan Ukhov "] -license = "MIT" -repository = "https://github.com/stainless-steel/md5" -homepage = "https://github.com/stainless-steel/md5" -documentation = "https://stainless-steel.github.io/md5" -description = "The package provides the MD5 hash function." diff --git a/src/vendor/md5/LICENSE.txt b/src/vendor/md5/LICENSE.txt deleted file mode 100644 index 73b5827524faf..0000000000000 --- a/src/vendor/md5/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright 2015 Ivan Ukhov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/src/vendor/md5/README.md b/src/vendor/md5/README.md deleted file mode 100644 index 6104556dc6f1c..0000000000000 --- a/src/vendor/md5/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# MD5 [![Version][version-img]][version-url] [![Status][status-img]][status-url] - -The package provides the [MD5][1] hash function. - -## [Documentation][doc] - -## Contributing - -1. Fork the project. -2. Implement your idea. -3. Open a pull request. - -[1]: https://en.wikipedia.org/wiki/MD5 - -[version-img]: https://img.shields.io/crates/v/md5.svg -[version-url]: https://crates.io/crates/md5 -[status-img]: https://travis-ci.org/stainless-steel/md5.svg?branch=master -[status-url]: https://travis-ci.org/stainless-steel/md5 -[doc]: https://stainless-steel.github.io/md5 diff --git a/src/vendor/md5/benches/lib.rs b/src/vendor/md5/benches/lib.rs deleted file mode 100644 index 6e898085b0f9e..0000000000000 --- a/src/vendor/md5/benches/lib.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(test)] - -extern crate md5; -extern crate test; - -#[bench] fn compute_0001000(bencher: &mut test::Bencher) { compute( 1000, bencher); } -#[bench] fn compute_0010000(bencher: &mut test::Bencher) { compute( 10000, bencher); } -#[bench] fn compute_0100000(bencher: &mut test::Bencher) { compute( 100000, bencher); } -#[bench] fn compute_1000000(bencher: &mut test::Bencher) { compute(1_000000, bencher); } - -fn compute(size: usize, bencher: &mut test::Bencher) { - let data = &vec![0xFFu8; size][..]; - bencher.iter(|| { - test::black_box(md5::compute(data)); - }); -} diff --git a/src/vendor/md5/src/lib.rs b/src/vendor/md5/src/lib.rs deleted file mode 100644 index 5f28269ccea53..0000000000000 --- a/src/vendor/md5/src/lib.rs +++ /dev/null @@ -1,340 +0,0 @@ -//! The [MD5][1] hash function. -//! -//! [1]: https://en.wikipedia.org/wiki/MD5 - -// The implementation is based on: -// http://people.csail.mit.edu/rivest/Md5.c - -use std::convert::From; -use std::io::{Result, Write}; -use std::mem; - -/// A digest. -pub type Digest = [u8; 16]; - -/// A context. -#[derive(Copy)] -pub struct Context { - handled: [u32; 2], - buffer: [u32; 4], - input: [u8; 64], -} - -impl Clone for Context { - #[inline] - fn clone(&self) -> Context { *self } -} - -const PADDING: [u8; 64] = [ - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -]; - -impl Context { - /// Create a context for computing a digest. - #[inline] - pub fn new() -> Context { - Context { - handled: [0, 0], - buffer: [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476], - input: unsafe { mem::uninitialized() }, - } - } - - /// Consume data. - pub fn consume(&mut self, data: &[u8]) { - let mut input: [u32; 16] = unsafe { mem::uninitialized() }; - let mut k = ((self.handled[0] >> 3) & 0x3F) as usize; - - let length = data.len() as u32; - if (self.handled[0] + (length << 3)) < self.handled[0] { - self.handled[1] += 1; - } - self.handled[0] += length << 3; - self.handled[1] += length >> 29; - - for &value in data { - self.input[k] = value; - k += 1; - if k != 0x40 { - continue; - } - let mut j = 0; - for i in 0..16 { - input[i] = ((self.input[j + 3] as u32) << 24) | - ((self.input[j + 2] as u32) << 16) | - ((self.input[j + 1] as u32) << 8) | - ((self.input[j ] as u32) ); - j += 4; - } - transform(&mut self.buffer, &input); - k = 0; - } - } - - /// Finalize and return the digest. - pub fn compute(mut self) -> Digest { - let mut input: [u32; 16] = unsafe { mem::uninitialized() }; - let k = ((self.handled[0] >> 3) & 0x3F) as usize; - - input[14] = self.handled[0]; - input[15] = self.handled[1]; - - self.consume(&PADDING[..(if k < 56 { 56 - k } else { 120 - k })]); - - let mut j = 0; - for i in 0..14 { - input[i] = ((self.input[j + 3] as u32) << 24) | - ((self.input[j + 2] as u32) << 16) | - ((self.input[j + 1] as u32) << 8) | - ((self.input[j ] as u32) ); - j += 4; - } - transform(&mut self.buffer, &input); - - let mut digest: Digest = unsafe { mem::uninitialized() }; - - let mut j = 0; - for i in 0..4 { - digest[j ] = ((self.buffer[i] ) & 0xFF) as u8; - digest[j + 1] = ((self.buffer[i] >> 8) & 0xFF) as u8; - digest[j + 2] = ((self.buffer[i] >> 16) & 0xFF) as u8; - digest[j + 3] = ((self.buffer[i] >> 24) & 0xFF) as u8; - j += 4; - } - - digest - } -} - -impl Write for Context { - #[inline] - fn write(&mut self, data: &[u8]) -> Result { - self.consume(data); - Ok(data.len()) - } - - #[inline] - fn flush(&mut self) -> Result<()> { - Ok(()) - } -} - -impl From for Digest { - #[inline] - fn from(context: Context) -> Digest { - context.compute() - } -} - -/// Compute the digest of data. -#[inline] -pub fn compute(data: &[u8]) -> Digest { - let mut context = Context::new(); - context.consume(data); - context.compute() -} - -fn transform(buffer: &mut [u32; 4], input: &[u32; 16]) { - let (mut a, mut b, mut c, mut d) = (buffer[0], buffer[1], buffer[2], buffer[3]); - - macro_rules! add( - ($a:expr, $b:expr) => ($a.wrapping_add($b)); - ); - macro_rules! rotate( - ($x:expr, $n:expr) => (($x << $n) | ($x >> (32 - $n))); - ); - - { - macro_rules! F( - ($x:expr, $y:expr, $z:expr) => (($x & $y) | (!$x & $z)); - ); - macro_rules! T( - ($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({ - $a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac); - $a = rotate!($a, $s); - $a = add!($a, $b); - }); - ); - - const S1: u32 = 7; - const S2: u32 = 12; - const S3: u32 = 17; - const S4: u32 = 22; - - T!(a, b, c, d, input[ 0], S1, 3614090360); - T!(d, a, b, c, input[ 1], S2, 3905402710); - T!(c, d, a, b, input[ 2], S3, 606105819); - T!(b, c, d, a, input[ 3], S4, 3250441966); - T!(a, b, c, d, input[ 4], S1, 4118548399); - T!(d, a, b, c, input[ 5], S2, 1200080426); - T!(c, d, a, b, input[ 6], S3, 2821735955); - T!(b, c, d, a, input[ 7], S4, 4249261313); - T!(a, b, c, d, input[ 8], S1, 1770035416); - T!(d, a, b, c, input[ 9], S2, 2336552879); - T!(c, d, a, b, input[10], S3, 4294925233); - T!(b, c, d, a, input[11], S4, 2304563134); - T!(a, b, c, d, input[12], S1, 1804603682); - T!(d, a, b, c, input[13], S2, 4254626195); - T!(c, d, a, b, input[14], S3, 2792965006); - T!(b, c, d, a, input[15], S4, 1236535329); - } - - { - macro_rules! F( - ($x:expr, $y:expr, $z:expr) => (($x & $z) | ($y & !$z)); - ); - macro_rules! T( - ($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({ - $a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac); - $a = rotate!($a, $s); - $a = add!($a, $b); - }); - ); - - const S1: u32 = 5; - const S2: u32 = 9; - const S3: u32 = 14; - const S4: u32 = 20; - - T!(a, b, c, d, input[ 1], S1, 4129170786); - T!(d, a, b, c, input[ 6], S2, 3225465664); - T!(c, d, a, b, input[11], S3, 643717713); - T!(b, c, d, a, input[ 0], S4, 3921069994); - T!(a, b, c, d, input[ 5], S1, 3593408605); - T!(d, a, b, c, input[10], S2, 38016083); - T!(c, d, a, b, input[15], S3, 3634488961); - T!(b, c, d, a, input[ 4], S4, 3889429448); - T!(a, b, c, d, input[ 9], S1, 568446438); - T!(d, a, b, c, input[14], S2, 3275163606); - T!(c, d, a, b, input[ 3], S3, 4107603335); - T!(b, c, d, a, input[ 8], S4, 1163531501); - T!(a, b, c, d, input[13], S1, 2850285829); - T!(d, a, b, c, input[ 2], S2, 4243563512); - T!(c, d, a, b, input[ 7], S3, 1735328473); - T!(b, c, d, a, input[12], S4, 2368359562); - } - - { - macro_rules! F( - ($x:expr, $y:expr, $z:expr) => ($x ^ $y ^ $z); - ); - macro_rules! T( - ($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({ - $a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac); - $a = rotate!($a, $s); - $a = add!($a, $b); - }); - ); - - const S1: u32 = 4; - const S2: u32 = 11; - const S3: u32 = 16; - const S4: u32 = 23; - - T!(a, b, c, d, input[ 5], S1, 4294588738); - T!(d, a, b, c, input[ 8], S2, 2272392833); - T!(c, d, a, b, input[11], S3, 1839030562); - T!(b, c, d, a, input[14], S4, 4259657740); - T!(a, b, c, d, input[ 1], S1, 2763975236); - T!(d, a, b, c, input[ 4], S2, 1272893353); - T!(c, d, a, b, input[ 7], S3, 4139469664); - T!(b, c, d, a, input[10], S4, 3200236656); - T!(a, b, c, d, input[13], S1, 681279174); - T!(d, a, b, c, input[ 0], S2, 3936430074); - T!(c, d, a, b, input[ 3], S3, 3572445317); - T!(b, c, d, a, input[ 6], S4, 76029189); - T!(a, b, c, d, input[ 9], S1, 3654602809); - T!(d, a, b, c, input[12], S2, 3873151461); - T!(c, d, a, b, input[15], S3, 530742520); - T!(b, c, d, a, input[ 2], S4, 3299628645); - } - - { - macro_rules! F( - ($x:expr, $y:expr, $z:expr) => ($y ^ ($x | !$z)); - ); - macro_rules! T( - ($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({ - $a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac); - $a = rotate!($a, $s); - $a = add!($a, $b); - }); - ); - - const S1: u32 = 6; - const S2: u32 = 10; - const S3: u32 = 15; - const S4: u32 = 21; - - T!(a, b, c, d, input[ 0], S1, 4096336452); - T!(d, a, b, c, input[ 7], S2, 1126891415); - T!(c, d, a, b, input[14], S3, 2878612391); - T!(b, c, d, a, input[ 5], S4, 4237533241); - T!(a, b, c, d, input[12], S1, 1700485571); - T!(d, a, b, c, input[ 3], S2, 2399980690); - T!(c, d, a, b, input[10], S3, 4293915773); - T!(b, c, d, a, input[ 1], S4, 2240044497); - T!(a, b, c, d, input[ 8], S1, 1873313359); - T!(d, a, b, c, input[15], S2, 4264355552); - T!(c, d, a, b, input[ 6], S3, 2734768916); - T!(b, c, d, a, input[13], S4, 1309151649); - T!(a, b, c, d, input[ 4], S1, 4149444226); - T!(d, a, b, c, input[11], S2, 3174756917); - T!(c, d, a, b, input[ 2], S3, 718787259); - T!(b, c, d, a, input[ 9], S4, 3951481745); - } - - buffer[0] = add!(buffer[0], a); - buffer[1] = add!(buffer[1], b); - buffer[2] = add!(buffer[2], c); - buffer[3] = add!(buffer[3], d); -} - -#[cfg(test)] -mod tests { - macro_rules! digest( - ($string:expr) => ({ - let mut context = ::Context::new(); - context.consume($string.as_bytes()); - let mut digest = String::with_capacity(2 * 16); - for x in &context.compute()[..] { - digest.push_str(&format!("{:02x}", x)); - } - digest - }); - ); - - #[test] - fn compute() { - let inputs = [ - "", - "a", - "abc", - "message digest", - "abcdefghijklmnopqrstuvwxyz", - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", - "12345678901234567890123456789012345678901234567890123456789012345678901234567890", - ]; - - let outputs = [ - "d41d8cd98f00b204e9800998ecf8427e", - "0cc175b9c0f1b6a831c399e269772661", - "900150983cd24fb0d6963f7d28e17f72", - "f96b697d7cb7938d525a2f31aaf161d0", - "c3fcd3d76192e4007dfb496cca67e13b", - "d174ab98d277d9f5a5611c2c9f419d9f", - "57edf4a22be3c955ac49da2e2107b67a", - ]; - - for (input, &output) in inputs.iter().zip(outputs.iter()) { - assert_eq!(&digest!(input)[..], output); - } - } -}