summary refs log tree commit diff
path: root/src/librustc/lib.rs
AgeCommit message (Collapse)AuthorLines
2014-06-27Update to 0.11.0 0.11.0Alex Crichton-2/+2
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-3/+1
This commit removes superfluous to_string calls from various places
2014-06-24Replace enum LintId with an extensible alternativeKeegan McAllister-0/+9
2014-06-24Move lint.rs out of middleKeegan McAllister-1/+2
We're going to have more modules under lint, and the paths get unwieldy. We also plan to have lints run at multiple points in the compilation pipeline.
2014-06-24auto merge of #14963 : w3ln4/rust/master, r=alexcrichtonbors-0/+1
The aim of these changes is not working out a generic bi-endianness architectures support but to allow people develop for little endian MIPS machines (issue #7190).
2014-06-24Added Mipsel architecture supportPawel Olzacki-0/+1
2014-06-22Register new snapshotsAlex Crichton-1/+0
2014-06-21auto merge of #15029 : aturon/rust/stability-index, r=brsonbors-0/+1
This commit makes several changes to the stability index infrastructure: * Stability levels are now inherited lexically, i.e., each item's stability level becomes the default for any nested items. * The computed stability level for an item is stored as part of the metadata. When using an item from an external crate, this data is looked up and cached. * The stability lint works from the computed stability level, rather than manual stability attribute annotations. However, the lint still checks only a limited set of item uses (e.g., it does not check every component of a path on import). This will be addressed in a later PR, as part of issue #8962. * The stability lint only applies to items originating from external crates, since the stability index is intended as a promise to downstream crates. * The "experimental" lint is now _allow_ by default. This is because almost all existing crates have been marked "experimental", pending library stabilization. With inheritance in place, this would generate a massive explosion of warnings for every Rust program. The lint should be changed back to deny-by-default after library stabilization is complete. * The "deprecated" lint still warns by default. The net result: we can begin tracking stability index for the standard libraries as we stabilize, without impacting most clients. Closes #13540.
2014-06-20librustc: Put `#[unsafe_destructor]` behind a feature gate.Patrick Walton-2/+3
Closes #8142. This is not the semantics we want long-term. You can continue to use `#[unsafe_destructor]`, but you'll need to add `#![feature(unsafe_destructor)]` to the crate attributes. [breaking-change]
2014-06-18Add stability inheritanceAaron Turon-0/+1
This commit makes several changes to the stability index infrastructure: * Stability levels are now inherited lexically, i.e., each item's stability level becomes the default for any nested items. * The computed stability level for an item is stored as part of the metadata. When using an item from an external crate, this data is looked up and cached. * The stability lint works from the computed stability level, rather than manual stability attribute annotations. However, the lint still checks only a limited set of item uses (e.g., it does not check every component of a path on import). This will be addressed in a later PR, as part of issue #8962. * The stability lint only applies to items originating from external crates, since the stability index is intended as a promise to downstream crates. * The "experimental" lint is now _allow_ by default. This is because almost all existing crates have been marked "experimental", pending library stabilization. With inheritance in place, this would generate a massive explosion of warnings for every Rust program. The lint should be changed back to deny-by-default after library stabilization is complete. * The "deprecated" lint still warns by default. The net result: we can begin tracking stability index for the standard libraries as we stabilize, without impacting most clients. Closes #13540.
2014-06-17Mark all crates except std as experimentalBrian Anderson-0/+1
2014-06-14Register new snapshotsAlex Crichton-8/+1
2014-06-13librustc: Forbid `transmute` from being called on types whose size isPatrick Walton-0/+1
only known post-monomorphization, and report `transmute` errors before the code is generated for that `transmute`. This can break code that looked like: unsafe fn f<T>(x: T) { let y: int = transmute(x); } Change such code to take a type parameter that has the same size as the type being transmuted to. Closes #12898. [breaking-change]
2014-06-13Dump results of analysis phase as CSVNick Cameron-0/+1
Adds the option -Zsave-analysis which will dump the results of syntax and type checking into CSV files. These can be interpreted by tools such as DXR to provide semantic information about Rust programs for code search, cross-reference, etc. Authored by Nick Cameron and Peter Elmers (@pelmers; including enums, type parameters/generics).
2014-06-11sync: Move underneath libstdAlex Crichton-1/+0
This commit is the final step in the libstd facade, #13851. The purpose of this commit is to move libsync underneath the standard library, behind the facade. This will allow core primitives like channels, queues, and atomics to all live in the same location. There were a few notable changes and a few breaking changes as part of this movement: * The `Vec` and `String` types are reexported at the top level of libcollections * The `unreachable!()` macro was copied to libcore * The `std::rt::thread` module was moved to librustrt, but it is still reexported at the same location. * The `std::comm` module was moved to libsync * The `sync::comm` module was moved under `sync::comm`, and renamed to `duplex`. It is now a private module with types/functions being reexported under `sync::comm`. This is a breaking change for any existing users of duplex streams. * All concurrent queues/deques were moved directly under libsync. They are also all marked with #![experimental] for now if they are public. * The `task_pool` and `future` modules no longer live in libsync, but rather live under `std::sync`. They will forever live at this location, but they may move to libsync if the `std::task` module moves as well. [breaking-change]
2014-06-09Document rustc::pluginKeegan McAllister-7/+1
2014-06-09Use phase(plugin) in bootstrap cratesKeegan McAllister-0/+5
Do this to avoid warnings on post-stage0 builds.
2014-06-09Implement #[plugin_registrar]Keegan McAllister-0/+8
See RFC 22. [breaking-change]
2014-06-06Move Def out of syntax crate, where it does not belongNiko Matsakis-0/+1
2014-06-05Fallout from the libcollections movementAlex Crichton-1/+0
2014-05-27Move std::{reflect,repr,Poly} to a libdebug crateAlex Crichton-5/+6
This commit moves reflection (as well as the {:?} format modifier) to a new libdebug crate, all of which is marked experimental. This is a breaking change because it now requires the debug crate to be explicitly linked if the :? format qualifier is used. This means that any code using this feature will have to add `extern crate debug;` to the top of the crate. Any code relying on reflection will also need to do this. Closes #12019 [breaking-change]
2014-05-27std: Rename strbuf operations to stringRicho Healey-1/+1
[breaking-change]
2014-05-21Change static.rust-lang.org to doc.rust-lang.orgAlex Crichton-1/+1
The new documentation site has shorter urls, gzip'd content, and index.html redirecting functionality.
2014-05-19rustc: Add official support for weak failureAlex Crichton-0/+1
This commit is part of the ongoing libstd facade efforts (cc #13851). The compiler now recognizes some language items as "extern { fn foo(...); }" and will automatically perform the following actions: 1. The foreign function has a pre-defined name. 2. The crate and downstream crates can only be built as rlibs until a crate defines the lang item itself. 3. The actual lang item has a pre-defined name. This is essentially nicer compiler support for the hokey core-depends-on-std-failure scheme today, but it is implemented the same way. The details are a little more hidden under the covers. In addition to failure, this commit promotes the eh_personality and rust_stack_exhausted functions to official lang items. The compiler can generate calls to these functions, causing linkage errors if they are left undefined. The checking for these items is not as precise as it could be. Crates compiling with `-Z no-landing-pads` will not need the eh_personality lang item, and crates compiling with no split stacks won't need the stack exhausted lang item. For ease, however, these items are checked for presence in all final outputs of the compiler. It is quite easy to define dummy versions of the functions necessary: #[lang = "stack_exhausted"] extern fn stack_exhausted() { /* ... */ } #[lang = "eh_personality"] extern fn eh_personality() { /* ... */ } cc #11922, rust_stack_exhausted is now a lang item cc #13851, libcollections is blocked on eh_personality becoming weak
2014-05-16libgetopts: Remove all uses of `~str` from `libgetopts`Patrick Walton-1/+4
2014-05-15Graphviz based flow graph pretty-printing.Felix S. Klock II-1/+1
Passing `--pretty flowgraph=<NODEID>` makes rustc print a control flow graph. In pratice, you will also need to pass the additional option: `-o <FILE>` to emit output to a `.dot` file for graphviz. (You can only print the flow-graph for a particular block in the AST.) ---- An interesting implementation detail is the way the code puts both the node index (`cfg::CFGIndex`) and a reference to the payload (`cfg::CFGNode`) into the single `Node` type that is used for labelling and walking the graph. I had once mistakenly thought that I only wanted the `cfg::CFGNode`, but for labelling, you really want the cfg index too, rather than e.g. trying to use the `ast::NodeId` as the label (which breaks down e.g. due to `ast::DUMMY_NODE_ID`). ---- As a drive-by fix, I had to fix `rustc::middle::cfg::construct` interface to reflect changes that have happened on the master branch while I was getting this integrated into the compiler. (The next commit actually adds tests of the `--pretty flowgraph` functionality, so that should ensure that the `rustc::middle::cfg` code does not go stale again.)
2014-05-12Add the patch number to version strings. Closes #13289Brian Anderson-1/+1
2014-05-12librustc: Remove all uses of `~str` from librustc.Patrick Walton-1/+0
2014-05-11Reorganise driver code.Nick Cameron-319/+1
The goal of this refactoring is to make the rustc driver code easier to understand and use. Since this is as close to an API as we have, I think it is important that it is nice. On getting stuck in, I found that there wasn't as much to change as I'd hoped to make the stage... fns easier to use by tools. This patch only moves code around - mostly just moving code to different files, but a few extracted method refactorings too. To summarise the changes: I added driver::config which handles everything about configuring the compiler. driver::session now just defines and builds session objects. I moved driver code from librustc/lib.rs to librustc/driver/mod.rs so all the code is one place. I extracted methods to make emulating the compiler without being the compiler a little easier. Within the driver directory, I moved code around to more logically fit in the modules.
2014-05-08Handle fallout in librustcKevin Ballard-1/+1
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-4/+5
2014-05-06auto merge of #13892 : alexcrichton/rust/mixing-rlib-dylib-deps, r=brsonbors-0/+1
Currently, rustc requires that a linkage be a product of 100% rlibs or 100% dylibs. This is to satisfy the requirement that each object appear at most once in the final output products. This is a bit limiting, and the upcoming libcore library cannot exist as a dylib, so these rules must change. The goal of this commit is to enable *some* use cases for mixing rlibs and dylibs, primarily libcore's use case. It is not targeted at allowing an exhaustive number of linkage flavors. There is a new dependency_format module in rustc which calculates what format each upstream library should be linked as in each output type of the current unit of compilation. The module itself contains many gory details about what's going on here. cc #10729
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-2/+2
2014-05-02rustc: Add some suppot for mixing rlibs and dylibsAlex Crichton-0/+1
Currently, rustc requires that a linkage be a product of 100% rlibs or 100% dylibs. This is to satisfy the requirement that each object appear at most once in the final output products. This is a bit limiting, and the upcoming libcore library cannot exist as a dylib, so these rules must change. The goal of this commit is to enable *some* use cases for mixing rlibs and dylibs, primarily libcore's use case. It is not targeted at allowing an exhaustive number of linkage flavors. There is a new dependency_format module in rustc which calculates what format each upstream library should be linked as in each output type of the current unit of compilation. The module itself contains many gory details about what's going on here. cc #10729
2014-05-01auto merge of #13877 : thestinger/rust/de-tilde-str-vec, r=alexcrichtonbors-1/+1
2014-04-30librustc: Remove `~"string"` and `&"string"` from the languagePatrick Walton-1/+1
2014-04-24Pre-step towards issue #12624 and others: Introduce ExprUseVisitor, remove theNiko Matsakis-1/+1
moves computation. ExprUseVisitor is a visitor that walks the AST for a function and calls a delegate to inform it where borrows, copies, and moves occur. In this patch, I rewrite the gather_loans visitor to use ExprUseVisitor, but in future patches, I think we could rewrite regionck, check_loans, and possibly other passes to use it as well. This would refactor the repeated code between those places that tries to determine where copies/moves/etc occur.
2014-04-23Move task::task() to TaskBuilder::new()Steven Fackler-2/+2
The constructor for `TaskBuilder` is being changed to an associated function called `new` for consistency with the rest of the standard library. Closes #13666 [breaking-change]
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-6/+6
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-2/+2
2014-04-16Move `--ls` behind `-Z ls`Flavio Percoco-2/+2
Closes #13549
2014-04-10rustc: Add a realpath utility functionAlex Crichton-0/+1
This is required in rustc to resolve symlinks for utilities such as the sysroot and the rpath values which are encoded into binaries.
2014-04-10Generalized the pretty-print entry points to support `-o <file>`.Felix S. Klock II-1/+1
2014-04-08Register new snapshotsAlex Crichton-1/+1
2014-04-06auto merge of #13165 : sfackler/rust/io-vec, r=alexcrichtonbors-1/+1
`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-1/+1
There's a little more allocation here and there now since from_utf8_owned can't be used with Vec.
2014-04-06auto merge of #13315 : alexcrichton/rust/libc, r=alexcrichton,mebors-0/+2
Rebasing of #12526 with a very obscure bug fixed on windows.
2014-04-04Register new snapshotsAlex Crichton-3/+0
2014-04-04Fix fallout from std::libc separationCorey Richardson-0/+2
2014-04-03Bump version to 0.11-preBrian Anderson-1/+1
This also changes some of the download links in the documentation to 'nightly'.