about summary refs log tree commit diff
path: root/src/librustc/front/std_inject.rs
AgeCommit message (Collapse)AuthorLines
2014-09-17move std_inject to libsyntaxNick Cameron-237/+0
2014-09-14rustc: fix fallout from using ptr::P.Eduard Burtescu-28/+24
2014-09-01Updated to new extern crate syntax.wickerwaka-1/+1
Added warning for old deprecated syntax
2014-08-16librustc: Forbid external crates, imports, and/or items from beingPatrick Walton-1/+14
declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]
2014-07-25rustc: Future proof runtime injectionBrian Anderson-2/+8
Rename and gensym the runtime on import, so that users can't refer to the `native` crate. This is unlikely to break code, but users should import the "native" crate directly. [breaking-change]
2014-07-21rustc: Allow the crate linked to as 'std' to be customizedBrian Anderson-1/+8
This adds the alt_std_name field to the Session's Options type. I'm using this in an external tool to control which libraries a crate links to.
2014-07-05rustc: Remove CrateId and all related supportAlex Crichton-18/+4
This commit removes all support in the compiler for the #[crate_id] attribute and all of its derivative infrastructure. A list of the functionality removed is: * The #[crate_id] attribute no longer exists * There is no longer the concept of a version of a crate * Version numbers are no longer appended to symbol names * The --crate-id command line option has been removed To migrate forward, rename #[crate_id] to #[crate_name] and only the name of the crate itself should be mentioned. The version/path of the old crate id should be removed. For a transitionary state, the #[crate_id] attribute is still accepted if the #[crate_name] is not present, but it is warned about if it is the only identifier present. RFC: 0035-remove-crate-id [breaking-change]
2014-06-27Update to 0.11.0 0.11.0Alex Crichton-1/+1
2014-06-15Register new snapshotsAlex Crichton-8/+0
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-1/+1
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-11std: Remove i18n/l10n from format!Alex Crichton-0/+8
* The select/plural methods from format strings are removed * The # character no longer needs to be escaped * The \-based escapes have been removed * '{{' is now an escape for '{' * '}}' is now an escape for '}' Closes #14810 [breaking-change]
2014-06-11rustc: Move the AST from @T to Gc<T>Alex Crichton-3/+5
2014-06-10auto merge of #14696 : jakub-/rust/dead-struct-fields, r=alexcrichtonbors-7/+3
This uncovered some dead code, most notably in middle/liveness.rs, which I think suggests there must be something fishy with that part of the code. The #[allow(dead_code)] annotations on some of the fields I am not super happy about but as I understand, marker type may disappear at some point.
2014-06-09Implement #[plugin_registrar]Keegan McAllister-1/+1
See RFC 22. [breaking-change]
2014-06-08Remove the dead code identified by the new lintJakub Wieczorek-7/+3
2014-05-24First sketch of lint passSteven Fackler-0/+6
Enough attributes are marked to cleanly compile an empty library.
2014-05-24Add AttrId to Attribute_Steven Fackler-4/+7
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-1/+1
2014-05-20Change std inject attributes to outer attributesKevin Ballard-23/+29
The #[phase(syntax,link)] attribute on `extern crate std` needs to be an outer attribute so it can pretty-print properly. Also add `#![no_std]` and `#[feature(phase)]` so compiling the pretty-printed source will work.
2014-05-13rustc: Make std_inject valid for pretty-printerklutzy-3/+25
Inject `extern crate {std, native}` before `use` statements. Add `#![feature(glob)]` since `use std::prelude::*` is used. (Unfortunately `rustc --pretty expanded` does not converge, since `extern crate` and `use std::prelude::*` is injected at every iteration.)
2014-05-12Add the patch number to version strings. Closes #13289Brian Anderson-1/+1
2014-05-11Reorganise driver code.Nick Cameron-2/+2
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-02rustc: Remove the session building_library flagAlex Crichton-2/+5
This has long since not been too relevant since the introduction of many crate type outputs. This commit removes the flag entirely, adjusting all logic to do the most reasonable thing when building both a library and an executable. Closes #13337
2014-04-26syntax: ViewItemUse no longer contains multiple view paths.Kang Seonghoon-1/+1
it reflected the obsolete syntax `use a, b, c;` and did not make past the parser (though it was a non-fatal error so we can continue). this legacy affected many portions of rustc and rustdoc as well, so this commit cleans them up altogether.
2014-04-14Use new attribute syntax in python files in src/etc too (#13478)Manish Goregaokar-2/+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'.
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