summary refs log tree commit diff
path: root/src/librustc/front/std_inject.rs
AgeCommit message (Collapse)AuthorLines
2014-03-31Bump version to 0.10Alex Crichton-1/+1
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-2/+1
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-21auto merge of #13016 : huonw/rust/new-opt-vec, r=cmrbors-3/+3
Replace syntax::opt_vec with syntax::owned_slice The `owned_slice::OwnedSlice` is `(*T, uint)` (i.e. a direct equivalent to DSTs `~[T]`). This shaves two words off the old OptVec type; and also makes substituting in other implementations easy, by removing all the mutation methods. (And also everything that's very rarely/never used.)
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-3/+3
syntax::opt_vec is now entirely unused, and so can go.
2014-03-21rustc: Switch defaults from libgreen to libnativeAlex Crichton-13/+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-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-3/+3
Closes #12771
2014-03-17De-@ Session usage.Eduard Burtescu-10/+10
2014-03-12Changed lists of lifetimes in ast and ty to use Vec instead of OptVec.Felix S. Klock II-2/+2
There is a broader revision (that does this across the board) pending in #12675, but that is awaiting the arrival of more data (to decide whether to keep OptVec alive by using a non-Vec internally). For this code, the representation of lifetime lists needs to be the same in both ScopeChain and in the ast and ty structures. So it seemed cleanest to just use `vec_ng::Vec`, now that it has a cheaper empty representation than the current `vec` code.
2014-03-07rename ast::ViewItemExternMod to ast::ViewItemExternCrate, and ↵Liigo Zhuang-3/+3
clean::ExternMod to clean::ExternCrate
2014-03-01librustc: Fix errors arising from the automated `~[T]` conversionPatrick Walton-20/+19
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-5/+5
2014-02-13Replace `crate` usage with `krate`Flavio Percoco-28/+28
This patch replaces all `crate` usage with `krate` before introducing the new keyword. This ensures that after introducing the keyword, there won't be any compilation errors. krate might not be the most expressive substitution for crate but it's a very close abbreviation for it. `module` was already used in several places already.
2014-02-02librustc: Fix merge fallout.Patrick Walton-5/+12
2014-01-24Move macro_rules! macros to libstdSteven Fackler-20/+46
They all have to go into a single module at the moment unfortunately. Ideally, the logging macros would live in std::logging, condition! would live in std::condition, format! in std::fmt, etc. However, this introduces cyclic dependencies between those modules and the macros they use which the current expansion system can't deal with. We may be able to get around this by changing the expansion phase to a two-pass system but that's for a later PR. Closes #2247 cc #11763
2014-01-20Register new snapshotsAlex Crichton-2/+1
Upgrade the version to 0.10-pre
2014-01-18Forbid unnecessary visibility on view itemsAlex Crichton-4/+4
For `use` statements, this means disallowing qualifiers when in functions and disallowing `priv` outside of functions. For `extern mod` statements, this means disallowing everything everywhere. It may have been envisioned for `pub extern mod foo` to be a thing, but it currently doesn't do anything (resolve doesn't pick it up), so better to err on the side of forwards-compatibility and forbid it entirely for now. Closes #9957
2014-01-15Add a configure to disable libstd version injectionAlex Crichton-3/+16
We'll use this when building snapshots so we can upgrade freely, but all compilers will inject a version by default.
2014-01-12Bump version to 0.10-preBrian Anderson-8/+3
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-29/+28
2014-01-02Bump version to 0.9Brian Anderson-1/+1
2014-01-02auto merge of #10696 : fhahn/rust/issue9543-remove-extern-mod-foo, r=pcwaltonbors-9/+7
This patch for #9543 throws an `obsolete syntax` error for `extern mod foo (name="bar")` . I was wondering if [this](https://github.com/fhahn/rust/compare/mozilla:master...fhahn:issue9543-remove-extern-mod-foo?expand=1#diff-da9d34ca1d0f6beee2838cf02e07345cR4444) is the correct place to do this? I think the wording of the error message could probably be improved as well. If this approach is OK, I'm going to run the whole test suite tomorrow and update the old syntax to the new one.
2014-01-02Inject std libs with versionsFlorian Hahn-3/+8
2014-01-01Remove `extern mod foo (name="bar")` syntax, closes #9543Florian Hahn-7/+0
2014-01-01syntax::codemap: Add static DUMMY_SPklutzy-7/+7
It replaces `dummy_sp()`.
2013-12-29Make ast_fold take &mut selfSteven Fackler-4/+4
2013-12-26librustc: De-`@mut` `building_library` in the sessionPatrick Walton-1/+1
2013-12-24rustc: Temporarily inject libgreen with librustuvAlex Crichton-0/+9
This measure is simply to allow programs to continue compiling as they once did. In the future, this needs a more robust solution to choose how to start with libgreen or libnative.
2013-11-26Support multiple item macrosSteven Fackler-2/+3
Closes #4375
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-2/+2
2013-10-29Move rust's uv implementation to its own crateAlex Crichton-7/+22
There are a few reasons that this is a desirable move to take: 1. Proof of concept that a third party event loop is possible 2. Clear separation of responsibility between rt::io and the uv-backend 3. Enforce in the future that the event loop is "pluggable" and replacable Here's a quick summary of the points of this pull request which make this possible: * Two new lang items were introduced: event_loop, and event_loop_factory. The idea of a "factory" is to define a function which can be called with no arguments and will return the new event loop as a trait object. This factory is emitted to the crate map when building an executable. The factory doesn't have to exist, and when it doesn't then an empty slot is in the crate map and a basic event loop with no I/O support is provided to the runtime. * When building an executable, then the rustuv crate will be linked by default (providing a default implementation of the event loop) via a similar method to injecting a dependency on libstd. This is currently the only location where the rustuv crate is ever linked. * There is a new #[no_uv] attribute (implied by #[no_std]) which denies implicitly linking to rustuv by default Closes #5019
2013-09-29Remove all usage of @ast::CrateAlex Crichton-8/+7
2013-09-26Update version numbers to 0.9-preBrian Anderson-1/+1
2013-09-23librustc: Change fold to use traits instead of `@fn`.Patrick Walton-83/+96
2013-09-21Update version numbers to 0.8Brian Anderson-1/+1
2013-09-10Delay assignment of node ids until after expansion. Ensures that each AST nodeNiko Matsakis-2/+2
has a unique id. Fixes numerous bugs in macro expansion and deriving. Add two representative tests. Fixes #7971 Fixes #6304 Fixes #8367 Fixes #8754 Fixes #8852 Fixes #2543 Fixes #7654
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-2/+2
2013-08-27librustc: Add support for type parameters in the middle of paths.Patrick Walton-5/+12
For example, `foo::<T>::bar::<U>`. This doesn't enforce that the type parameters are in the right positions, however.
2013-08-09std/rustc/rustpkg/syntax: Support the `extern mod = ...` formTim Chevalier-1/+1
This commit allows you to write: extern mod x = "a/b/c"; which means rustc will search in the RUST_PATH for a package with ID a/b/c, and bind it to the name `x` if it's found. Incidentally, move get_relative_to from back::rpath into std::path
2013-07-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-9/+9
`crate => Crate` `local => Local` `blk => Block` `crate_num => CrateNum` `crate_cfg => CrateConfig` Also, Crate and Local are not wrapped in spanned<T> anymore.
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-11/+5
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so that `rustc --cfg 'foo(bar)'` now works.
2013-07-17librustc: Remove all uses of the `Copy` bound.Patrick Walton-1/+1
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-3/+3
2013-07-17rustc: implement a `#[no_implicit_prelude]` attribute.Huon Wilson-1/+19
It disables the insertion of `use std::prelude::*;` into the top of all the modules below the item on which it is placed (including that item itself).
2013-07-08Bump version numbers to 0.8-preBrian Anderson-1/+1
2013-07-07De-managed ast::PathJames Miller-1/+1
2013-07-07Stop allocating view_items with @James Miller-2/+2
2013-06-30Bump version from 0.7-pre to 0.7Brian Anderson-1/+1
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-2/+1
2013-06-27Remove many shared pointersPhilipp Brüschweiler-2/+2
Mostly just low-haning fruit, i.e. function arguments that were @ even though & would work just as well. Reduces librustc.so size by 200k when compiling without -O, by 100k when compiling with -O.