]> git.lizzy.rs Git - rust.git/commitdiff
Bring compiletest/rustpkg/driver up to date on std vs core
authorAlex Crichton <alex@alexcrichton.com>
Mon, 1 Jul 2013 02:36:55 +0000 (19:36 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 4 Jul 2013 23:30:48 +0000 (16:30 -0700)
14 files changed:
mk/tools.mk
src/compiletest/common.rs
src/compiletest/compiletest.rs
src/compiletest/errors.rs
src/compiletest/header.rs
src/compiletest/procsrv.rs
src/compiletest/runtest.rs
src/compiletest/util.rs
src/driver/driver.rs
src/librusti/rusti.rs
src/librustpkg/api.rs
src/librustpkg/messages.rs
src/librustpkg/package_source.rs
src/librustpkg/util.rs

index 0a901358ac1f07f91ee42a3d6859fe7721d634d7..0e83147501cbfb6b617cbfde47370f238a1a429e 100644 (file)
@@ -50,7 +50,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTPKG_$(4)):            \
                $$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_EXTRALIB_$(4)) \
                $$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTC_$(4))
        @$$(call E, compile_and_link: $$@)
-       $$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
+       $$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) -o $$@ $$< && touch $$@
 
 $$(TBIN$(1)_T_$(4)_H_$(3))/rustpkg$$(X_$(4)):                          \
                $$(DRIVER_CRATE)                                                        \
index 869657326b7d2d1a2d49f1c8163bf00a334bd3ff..38289f6274180a63c401d0f1754e9481f2f25f75 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use core::prelude::*;
-
 #[deriving(Eq)]
 pub enum mode {
     mode_compile_fail,
index 82206f12fae2e2b47b5adbf45c3f894876823d3a..7d9a7c3ea75dcc75f49b1eadba8af12a6dd7d897 100644 (file)
 #[crate_type = "bin"];
 
 #[allow(non_camel_case_types)];
+#[allow(unrecognized_lint)]; // NOTE: remove after snapshot
+#[deny(warnings)];
 
-#[no_core]; // XXX: Remove after snapshot
-#[no_std];
+extern mod extra;
 
-extern mod core(name = "std", vers = "0.7");
-extern mod extra(name = "extra", vers = "0.7");
-
-use core::prelude::*;
-use core::*;
+use std::os;
 
 use extra::getopts;
 use extra::test;
 
-use core::result::{Ok, Err};
-
 use common::config;
 use common::mode_run_pass;
 use common::mode_run_fail;
 pub mod common;
 pub mod errors;
 
-mod std {
-    pub use core::cmp;
-    pub use core::str;
-    pub use core::sys;
-    pub use core::unstable;
-}
-
 pub fn main() {
     let args = os::args();
     let config = parse_config(args);
@@ -98,8 +86,8 @@ fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
         run_ignored: getopts::opt_present(matches, "ignored"),
         filter:
              if !matches.free.is_empty() {
-                 option::Some(copy matches.free[0])
-             } else { option::None },
+                 Some(copy matches.free[0])
+             } else { None },
         logfile: getopts::opt_maybe_str(matches, "logfile").map(|s| Path(*s)),
         runtool: getopts::opt_maybe_str(matches, "runtool"),
         rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
@@ -148,8 +136,8 @@ pub fn log_config(config: &config) {
 
 pub fn opt_str<'a>(maybestr: &'a Option<~str>) -> &'a str {
     match *maybestr {
-        option::None => "(none)",
-        option::Some(ref s) => {
+        None => "(none)",
+        Some(ref s) => {
             let s: &'a str = *s;
             s
         }
@@ -161,7 +149,7 @@ pub fn opt_str2(maybestr: Option<~str>) -> ~str {
 }
 
 pub fn str_opt(maybestr: ~str) -> Option<~str> {
-    if maybestr != ~"(none)" { option::Some(maybestr) } else { option::None }
+    if maybestr != ~"(none)" { Some(maybestr) } else { None }
 }
 
 pub fn str_mode(s: ~str) -> mode {
@@ -199,8 +187,8 @@ pub fn test_opts(config: &config) -> test::TestOpts {
         logfile: copy config.logfile,
         run_tests: true,
         run_benchmarks: false,
-        save_results: option::None,
-        compare_results: option::None
+        save_results: None,
+        compare_results: None
     }
 }
 
@@ -268,7 +256,7 @@ fn shorten(path: &Path) -> ~str {
 }
 
 pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
-    use core::cell::Cell;
+    use std::cell::Cell;
     let config = Cell::new(copy *config);
     let testfile = Cell::new(testfile.to_str());
     test::DynTestFn(|| { runtest::run(config.take(), testfile.take()) })
index 4649d4dfc3c4b913f1f7f38f5cea63e82bd0a8db..780a917c019b22cca0a31da042d2e1b2aea1e707 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use core::prelude::*;
-
-use core::io;
+use std::io;
 
 pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
 
index ddb68d481167ab895a20e90f540402b76e45059a..9cd489f05766afd2591bffb4be2210a51172efd5 100644 (file)
@@ -8,13 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use core::prelude::*;
-
 use common::config;
 use common;
 
-use core::io;
-use core::os;
+use std::io;
+use std::os;
 
 pub struct TestProps {
     // Lines that should be expected, in order, on standard out
index 93fe258d167ed4a3c43eb4e2602cf2d819dbed71..0e61b45d6199f4795feca9b4be7640664daa34a9 100644 (file)
@@ -8,11 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use core::prelude::*;
-
-use core::os;
-use core::run;
-use core::str;
+use std::os;
+use std::run;
+use std::str;
 
 #[cfg(target_os = "win32")]
 fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
index 8e493fd5396f90dd2716d7273eb5e9e3670d189d..91016ba91fa555a8c5c7ea6d971394cc096d7867 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use core::prelude::*;
-
 use common::mode_run_pass;
 use common::mode_run_fail;
 use common::mode_compile_fail;
 use util;
 use util::logv;
 
-use core::io;
-use core::os;
-use core::uint;
-use core::vec;
+use std::io;
+use std::os;
+use std::uint;
+use std::vec;
 
 pub fn run(config: config, testfile: ~str) {
     if config.verbose {
index 26a62f8a5b22456c58687e690b22dd3265209411..5af469ff8417c17d82865bddd0a18d2e0c4668de 100644 (file)
@@ -8,12 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use core::prelude::*;
-
 use common::config;
 
-use core::io;
-use core::os::getenv;
+use std::io;
+use std::os::getenv;
 
 pub fn make_new_path(path: &str) -> ~str {
 
index 0f61ede4fc59d4ff467e0917ee82707a306f633c..e81a3230e134384101441c8cc6a206a54e5af6e1 100644 (file)
@@ -8,11 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[no_core];
-#[no_std];
-
-extern mod core(name = "std", vers = "0.7");
-
 #[cfg(rustpkg)]
 extern mod this(name = "rustpkg");
 
index bdbbcfc2b665ee9c891e7f92b45cec1cf25166ed..9911ca699dac0e5ca8a71a68e56b2be33c9356e0 100644 (file)
@@ -667,8 +667,10 @@ enum f {}
             fn f() {}
             f()
         ");
+    }
 
-        debug!("simultaneous definitions + expressions are allowed");
+    #[test]
+    fn simultaneous_definition_and_expression() {
         run_program("
             let a = 3; a as u8
         ");
index c36c6390a759fe69010cfa2d06946b259e220344..5233b87f7e4fa62914ccd0117495096204f84fb7 100644 (file)
 use package_source::*;
 use version::Version;
 
-use std::option::*;
 use std::os;
 use std::hashmap::*;
-use std::path::*;
 
 /// Convenience functions intended for calling from pkg.rs
 
index eec33a375355ec585cbde3c71b92f6817d5279ad..96c99a7a0f17edcb4e7e3a8e9c0ee1cf910ef31d 100644 (file)
@@ -10,7 +10,6 @@
 
 use extra::term;
 use std::io;
-use std::result::*;
 
 pub fn note(msg: &str) {
     pretty_message(msg, "note: ", term::color::GREEN, io::stdout())
index 24c1bb9b200f4e21213f25ff6bacd68921038375..b2f608bd352aefb8d9a41a6a3d7582337092f7d7 100644 (file)
@@ -11,7 +11,6 @@
 use target::*;
 use package_id::PkgId;
 use std::path::Path;
-use std::option::*;
 use std::{os, run, str};
 use context::*;
 use crate::Crate;
index 1e99a3fa4bcda2f68ae593a4607d55f18696ef93..8a57cd4b25c0e4106bea66ea67a48bc35438c0d1 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::{libc, os, result, str};
+use std::{os, result};
 use rustc::driver::{driver, session};
 use rustc::metadata::filesearch;
 use extra::getopts::groups::getopts;
@@ -379,6 +379,7 @@ pub fn link_exe(_src: &Path, _dest: &Path) -> bool {
 #[cfg(target_os = "freebsd")]
 #[cfg(target_os = "macos")]
 pub fn link_exe(src: &Path, dest: &Path) -> bool {
+    use std::{libc, str};
     unsafe {
         do str::as_c_str(src.to_str()) |src_buf| {
             do str::as_c_str(dest.to_str()) |dest_buf| {