about summary refs log tree commit diff
path: root/src/compiletest
AgeCommit message (Collapse)AuthorLines
2014-05-12Easier interface for TCP ::connect and ::bind.Tom Lee-5/+1
Prior to this commit, TcpStream::connect and TcpListener::bind took a single SocketAddr argument. This worked well enough, but the API felt a little too "low level" for most simple use cases. A great example is connecting to rust-lang.org on port 80. Rust users would need to: 1. resolve the IP address of rust-lang.org using io::net::addrinfo::get_host_addresses. 2. check for errors 3. if all went well, use the returned IP address and the port number to construct a SocketAddr 4. pass this SocketAddr to TcpStream::connect. I'm modifying the type signature of TcpStream::connect and TcpListener::bind so that the API is a little easier to use. TcpStream::connect now accepts two arguments: a string describing the host/IP of the host we wish to connect to, and a u16 representing the remote port number. Similarly, TcpListener::bind has been modified to take two arguments: a string describing the local interface address (e.g. "0.0.0.0" or "127.0.0.1") and a u16 port number. Here's how to port your Rust code to use the new TcpStream::connect API: // old ::connect API let addr = SocketAddr{ip: Ipv4Addr{127, 0, 0, 1}, port: 8080}; let stream = TcpStream::connect(addr).unwrap() // new ::connect API (minimal change) let addr = SocketAddr{ip: Ipv4Addr{127, 0, 0, 1}, port: 8080}; let stream = TcpStream::connect(addr.ip.to_str(), addr.port()).unwrap() // new ::connect API (more compact) let stream = TcpStream::connect("127.0.0.1", 8080).unwrap() // new ::connect API (hostname) let stream = TcpStream::connect("rust-lang.org", 80) Similarly, for TcpListener::bind: // old ::bind API let addr = SocketAddr{ip: Ipv4Addr{0, 0, 0, 0}, port: 8080}; let mut acceptor = TcpListener::bind(addr).listen(); // new ::bind API (minimal change) let addr = SocketAddr{ip: Ipv4Addr{0, 0, 0, 0}, port: 8080}; let mut acceptor = TcpListener::bind(addr.ip.to_str(), addr.port()).listen() // new ::bind API (more compact) let mut acceptor = TcpListener::bind("0.0.0.0", 8080).listen() [breaking-change]
2014-05-08Handle breakage after libcore splitKevin Ballard-3/+3
API Changes: - &[T] and ~[T] no longer support the addition operator (+)
2014-05-07debuginfo: Split debuginfo autotests into debuginfo-gdb and debuginfo-lldbMichael Woerister-70/+219
2014-05-06Fail on internal compiler errors in compile-failRicho Healey-0/+10
2014-05-01remove leftover obsolete string literalsDaniel Micay-1/+1
2014-04-24test: Add an option to not capture outputAlex Crichton-2/+5
A new flag to the test runner, --nocapture, can be passed to instruct that the output of tests should not be captured by default. The behavior can also be triggered via a RUST_TEST_NOCAPTURE environment variable being set. Closes #13374
2014-04-21auto merge of #13553 : aochagavia/rust/pr, r=alexcrichtonbors-3/+21
Now it is possible to specify run-flags in tests. For example, by using `run-flags: --bench` the Bencher is run.
2014-04-20Added run_flags directive to `compiletest`Adolfo Ochagavía-3/+21
Now it is possible to specify run-flags in tests. For example, by using `run-flags: --bench` the Bencher is run.
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-110/+113
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-4/+3
2014-04-10auto merge of #13440 : huonw/rust/strbuf, r=alexcrichtonbors-3/+4
libstd: Implement `StrBuf`, a new string buffer type like `Vec`, and port all code over to use it. Rebased & tests-fixed version of https://github.com/mozilla/rust/pull/13269
2014-04-10Remove some internal ~[] from several libraries.Huon Wilson-1/+1
Some straggling instances of `~[]` across a few different libs. Also, remove some public ones from workcache.
2014-04-10libstd: Implement `StrBuf`, a new string buffer type like `Vec`, andPatrick Walton-3/+4
port all code over to use it.
2014-04-06auto merge of #13165 : sfackler/rust/io-vec, r=alexcrichtonbors-5/+5
`Reader`, `Writer`, `MemReader`, `MemWriter`, and `MultiWriter` now work with `Vec<u8>` instead of `~[u8]`. This does introduce some extra copies since `from_utf8_owned` isn't usable anymore, but I think that can't be helped until `~str`'s representation changes.
2014-04-06De-~[] Reader and WriterSteven Fackler-5/+5
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
2014-04-05auto merge of #13260 : pnkfelix/rust/fsk-fix-13247, r=alexcrichtonbors-0/+3
Fix #13247. r? @alexcrichton (or anyone else, really).
2014-04-03compiletest: Fix bitrotted win32 routinesklutzy-11/+13
2014-04-02Avoid injecting unfulfilled dependence in compiletest on libnative.Felix S. Klock II-0/+3
2014-03-31compiletest: Switch field privacy where necessaryAlex Crichton-40/+44
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-11/+5
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-4/+4
Closes #2569
2014-03-26auto merge of #13117 : alexcrichton/rust/no-crate-map, r=brsonbors-1/+3
This can be done now that logging has been moved out and libnative is the default (not libgreen)
2014-03-24auto merge of #12900 : alexcrichton/rust/rewrite-sync, r=brsonbors-1/+0
* Remove clone-ability from all primitives. All shared state will now come from the usage of the primitives being shared, not the primitives being inherently shareable. This allows for fewer allocations for stack-allocated primitives. * Add `Mutex<T>` and `RWLock<T>` which are stack-allocated primitives for purely wrapping a piece of data * Remove `RWArc<T>` in favor of `Arc<RWLock<T>>` * Remove `MutexArc<T>` in favor of `Arc<Mutex<T>>` * Shuffle around where things are located * The `arc` module now only contains `Arc` * A new `lock` module contains `Mutex`, `RWLock`, and `Barrier` * A new `raw` module contains the primitive implementations of `Semaphore`, `Mutex`, and `RWLock` * The Deref/DerefMut trait was implemented where appropriate * `CowArc` was removed, the functionality is now part of `Arc` and is tagged with `#[experimental]`. * The crate now has #[deny(missing_doc)] * `Arc` now supports weak pointers This is not a large-scale rewrite of the functionality contained within the `sync` crate, but rather a shuffling of who does what an a thinner hierarchy of ownership to allow for better composability.
2014-03-24green: Remove the dependence on the crate mapAlex Crichton-1/+3
This is the final nail in the coffin for the crate map. The `start` function for libgreen now has a new added parameter which is the event loop factory instead of inferring it from the crate map. The two current valid values for this parameter are `green::basic::event_loop` and `rustuv::event_loop`.
2014-03-23Snapshot cleanupAlex Crichton-1/+0
2014-03-23auto merge of #13102 : huonw/rust/totaleq-deriving, r=thestingerbors-1/+1
std: remove the `equals` method from `TotalEq`. `TotalEq` is now just an assertion about the `Eq` impl of a type (i.e. `==` is a total equality if a type implements `TotalEq`) so the extra method is just confusing. Also, a new method magically appeared as a hack to allow deriving to assert that the contents of a struct/enum are also TotalEq, because the deriving infrastructure makes it very hard to do anything but create a trait method. (You didn't hear about this horrible work-around from me :(.)
2014-03-23std: remove the `equals` method from `TotalEq`.Huon Wilson-1/+1
`TotalEq` is now just an assertion about the `Eq` impl of a type (i.e. `==` is a total equality if a type implements `TotalEq`) so the extra method is just confusing. Also, a new method magically appeared as a hack to allow deriving to assert that the contents of a struct/enum are also TotalEq, because the deriving infrastructure makes it very hard to do anything but create a trait method. (You didn't hear about this horrible work-around from me :(.)
2014-03-23iter: remove `to_owned_vec`Daniel Micay-1/+1
This needs to be removed as part of removing `~[T]`. Partial type hints are now allowed, and will remove the need to add a version of this method for `Vec<T>`. For now, this involves a few workarounds for partial type hints not completely working.
2014-03-21rustc: Switch defaults from libgreen to libnativeAlex Crichton-0/+5
The compiler will no longer inject libgreen as the default runtime for rust programs, this commit switches it over to libnative by default. Now that libnative has baked for some time, it is ready enough to start getting more serious usage as the default runtime for rustc generated binaries. We've found that there isn't really a correct decision in choosing a 1:1 or M:N runtime as a default for all applications, but it seems that a larger number of programs today would work more reasonable with a native default rather than a green default. With this commit come a number of bugfixes: * The main native task is now named "<main>" * The main native task has the stack bounds set up properly * #[no_uv] was renamed to #[no_start] * The core-run-destroy test was rewritten for both libnative and libgreen and one of the tests was modified to be more robust. * The process-detach test was locked to libgreen because it uses signal handling
2014-03-22Remove outdated and unnecessary std::vec_ng::Vec imports.Huon Wilson-6/+1
(And fix some tests.)
2014-03-21test: Make manual changes to deal with the fallout from removal ofPatrick Walton-119/+151
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
2014-03-20syntax: Tidy up parsing the new attribute syntaxAlex Crichton-0/+1
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec -> std::sliceDaniel Micay-2/+2
Closes #12702
2014-03-15log: Introduce liblog, the old std::loggingAlex Crichton-0/+3
This commit moves all logging out of the standard library into an external crate. This crate is the new crate which is responsible for all logging macros and logging implementation. A few reasons for this change are: * The crate map has always been a bit of a code smell among rust programs. It has difficulty being loaded on almost all platforms, and it's used almost exclusively for logging and only logging. Removing the crate map is one of the end goals of this movement. * The compiler has a fair bit of special support for logging. It has the __log_level() expression as well as generating a global word per module specifying the log level. This is unfairly favoring the built-in logging system, and is much better done purely in libraries instead of the compiler itself. * Initialization of logging is much easier to do if there is no reliance on a magical crate map being available to set module log levels. * If the logging library can be written outside of the standard library, there's no reason that it shouldn't be. It's likely that we're not going to build the highest quality logging library of all time, so third-party libraries should be able to provide just as high-quality logging systems as the default one provided in the rust distribution. With a migration such as this, the change does not come for free. There are some subtle changes in the behavior of liblog vs the previous logging macros: * The core change of this migration is that there is no longer a physical log-level per module. This concept is still emulated (it is quite useful), but there is now only a global log level, not a local one. This global log level is a reflection of the maximum of all log levels specified. The previously generated logging code looked like: if specified_level <= __module_log_level() { println!(...) } The newly generated code looks like: if specified_level <= ::log::LOG_LEVEL { if ::log::module_enabled(module_path!()) { println!(...) } } Notably, the first layer of checking is still intended to be "super fast" in that it's just a load of a global word and a compare. The second layer of checking is executed to determine if the current module does indeed have logging turned on. This means that if any module has a debug log level turned on, all modules with debug log levels get a little bit slower (they all do more expensive dynamic checks to determine if they're turned on or not). Semantically, this migration brings no change in this respect, but runtime-wise, this will have a perf impact on some code. * A `RUST_LOG=::help` directive will no longer print out a list of all modules that can be logged. This is because the crate map will no longer specify the log levels of all modules, so the list of modules is not known. Additionally, warnings can no longer be provided if a malformed logging directive was supplied. The new "hello world" for logging looks like: #[phase(syntax, link)] extern crate log; fn main() { debug!("Hello, world!"); }
2014-03-14lint: add lint for use of a `~[T]`.Huon Wilson-0/+1
This is useless at the moment (since pretty much every crate uses `~[]`), but should help avoid regressions once completely removed from a crate.
2014-03-12auto merge of #12414 : DaGenix/rust/failing-iterator-wrappers, r=alexcrichtonbors-1/+2
Most IO related functions return an IoResult so that the caller can handle failure in whatever way is appropriate. However, the `lines`, `bytes`, and `chars` iterators all supress errors. This means that code that needs to handle errors can't use any of these iterators. All three of these iterators were updated to produce IoResults. Fixes #12368
2014-03-12Update io iterators to produce IoResultsPalmer Cox-1/+2
Most IO related functions return an IoResult so that the caller can handle failure in whatever way is appropriate. However, the `lines`, `bytes`, and `chars` iterators all supress errors. This means that code that needs to handle errors can't use any of these iterators. All three of these iterators were updated to produce IoResults. Fixes #12368
2014-03-12rustc: Remove matching on ~str from the languageMichael Darakananda-15/+15
The `~str` type is not long for this world as it will be superseded by the soon-to-come DST changes for the language. The new type will be `~Str`, and matching over the allocation will no longer be supported. Matching on `&str` will continue to work, in both a pre and post DST world.
2014-03-04Rename all variables that have uppercase characters in their names to use ↵Palmer Cox-80/+80
only lowercase characters
2014-02-25auto merge of #12530 : alexcrichton/rust/make-check-no-rpath, r=brsonbors-2/+20
This involves passing through LD_LIBRARY_PATH through more places, specifically in the compiletest, run-make, and doctest runners.
2014-02-23Roll std::run into std::io::processAlex Crichton-13/+16
The std::run module is a relic from a standard library long since past, and there's not much use to having two modules to execute processes with where one is slightly more convenient. This commit merges the two modules, moving lots of functionality from std::run into std::io::process and then deleting std::run. New things you can find in std::io::process are: * Process::new() now only takes prog/args * Process::configure() takes a ProcessConfig * Process::status() is the same as run::process_status * Process::output() is the same as run::process_output * I/O for spawned tasks is now defaulted to captured in pipes instead of ignored * Process::kill() was added (plus an associated green/native implementation) * Process::wait_with_output() is the same as the old finish_with_output() * destroy() is now signal_exit() * force_destroy() is now signal_kill() Closes #2625 Closes #10016
2014-02-21mk: Get "make check" passing with --disable-rpathAlex Crichton-2/+20
This involves passing through LD_LIBRARY_PATH through more places, specifically in the compiletest, run-make, and doctest runners.
2014-02-20auto merge of #12399 : michaelwoerister/rust/simd-fix, r=alexcrichtonbors-8/+19
Fixes #12333. I also re-enabled the *function-arg-initialization* test case, so if it passes again, fixes #12021.
2014-02-20auto merge of #12398 : alexcrichton/rust/rlibs-and-dylibs-2, r=cmrbors-2/+22
The new methodology can be found in the re-worded comment, but the gist of it is that -C prefer-dynamic doesn't turn off static linkage. The error messages should also be a little more sane now. Closes #12133
2014-02-20move extra::test to libtestLiigo Zhuang-5/+2
2014-02-19Tweak how preference factors into linkageAlex Crichton-2/+22
The new methodology can be found in the re-worded comment, but the gist of it is that -C prefer-dynamic doesn't turn off static linkage. The error messages should also be a little more sane now. Closes #12133
2014-02-19debuginfo: Fix a RUSTFLAGS incompatibility in test runner.Michael Woerister-8/+19
2014-02-16Allow configuration of uid/gid/detach on processesAlex Crichton-8/+2
This just copies the libuv implementation for libnative which seems reasonable enough (uid/gid fail on windows). Closes #12082
2014-02-14extern mod => extern crateAlex Crichton-2/+2
This was previously implemented, and it just needed a snapshot to go through