about summary refs log tree commit diff
path: root/src/librustc/front
AgeCommit message (Collapse)AuthorLines
2014-07-11make walk/visit_mac opt-in onlyJohn Clements-0/+5
macros can expand into arbitrary items, exprs, etc. This means that using a default walker or folder on an AST before macro expansion is complete will miss things (the things that the macros expand into). As a partial fence against this, this commit moves the default traversal of macros into a separate procedure, and makes the default trait implementation signal an error. This means that Folders and Visitors can traverse macros if they want to, but they need to explicitly add an impl that calls the walk_mac or fold_mac procedure This should prevent problems down the road.
2014-07-11Add scaffolding for assigning alpha-numeric codes to rustc diagnosticsJakub Wieczorek-0/+5
2014-07-08auto merge of #15493 : brson/rust/tostr, r=pcwaltonbors-1/+1
This updates https://github.com/rust-lang/rust/pull/15075. Rename `ToStr::to_str` to `ToString::to_string`. The naive renaming ends up with two `to_string` functions defined on strings in the prelude (the other defined via `collections::str::StrAllocating`). To remedy this I removed `StrAllocating::to_string`, making all conversions from `&str` to `String` go through `Show`. This has a measurable impact on the speed of this conversion, but the sense I get from others is that it's best to go ahead and unify `to_string` and address performance for all `to_string` conversions in `core::fmt`. `String::from_str(...)` still works as a manual fast-path. Note that the patch was done with a script, and ended up renaming a number of other `*_to_str` functions, particularly inside of rustc. All the ones I saw looked correct, and I didn't notice any additional API breakage. Closes #15046.
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-1/+1
[breaking-change]
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-2/+2
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-07-05rustc: Remove CrateId and all related supportAlex Crichton-25/+8
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-25auto merge of #15160 : alexcrichton/rust/remove-f128, r=brsonbors-4/+1
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-24Remove the quad_precision_float feature gateAlex Crichton-4/+1
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-24Convert builtin lints to uppercase names for style consistencyKeegan McAllister-1/+1
2014-06-24Replace enum LintId with an extensible alternativeKeegan McAllister-1/+1
2014-06-24Move lint.rs out of middleKeegan McAllister-1/+1
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-23librustc: Feature gate lang items and intrinsics.Patrick Walton-9/+40
If you define lang items in your crate, add `#[feature(lang_items)]`. If you define intrinsics (`extern "rust-intrinsic"`), add `#[feature(intrinsics)]`. Closes #12858. [breaking-change]
2014-06-22librustc: Fix poorly formatted doc in feature_gateTom Jakubowski-1/+1
The #![feature(...)] line had been rendering in the docs as a header because of Markdown syntax.
2014-06-20librustc: Put `#[unsafe_destructor]` behind a feature gate.Patrick Walton-0/+12
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-15Register new snapshotsAlex Crichton-18/+0
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-3/+3
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/+18
* 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-48/+52
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-09librustc: Implement sugar for the `FnMut` traitPatrick Walton-0/+6
2014-06-09auto merge of #14590 : pcwalton/rust/overloaded-call, r=nick29581bors-0/+4
gate. This is part of unboxed closures. r? @nick29581
2014-06-09Implement #[plugin_registrar]Keegan McAllister-9/+5
See RFC 22. [breaking-change]
2014-06-09librustc: Implement overloading for the call operator behind a featurePatrick Walton-0/+4
gate. This is part of unboxed closures.
2014-06-08Remove the dead code identified by the new lintJakub Wieczorek-7/+3
2014-05-27std: Rename strbuf operations to stringRicho Healey-2/+2
[breaking-change]
2014-05-24Get "make check" to work with unused-attributeSteven Fackler-1/+1
There's a fair number of attributes that have to be whitelisted since they're either looked for by rustdoc, in trans, or as needed. These can be cleaned up in the future.
2014-05-24First sketch of lint passSteven Fackler-1/+7
Enough attributes are marked to cleanly compile an empty library.
2014-05-24Add AttrId to Attribute_Steven Fackler-5/+9
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-1/+3
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-3/+3
2014-05-20Change std inject attributes to outer attributesKevin Ballard-24/+30
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-14libtest: Remove all uses of `~str` from `libtest`.Patrick Walton-1/+1
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-12librustc: Remove all uses of `~str` from librustc.Patrick Walton-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-08Handle more falloutKevin Ballard-3/+3
os::args() no longer auto-borrows to &[~str].
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-3/+3
2014-05-04auto merge of #13905 : alexcrichton/rust/issue-13337, r=thestingerbors-17/+16
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-05-03Temporary patch to accept arbitrary lifetimes (behind feature gate) in bound ↵Niko Matsakis-2/+9
lists. This is needed to bootstrap fix for #5723.
2014-05-02rustc: Remove the session building_library flagAlex Crichton-17/+16
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-28auto merge of #13791 : lifthrasiir/rust/mod-inner-span, r=huonwbors-0/+3
This PR is primarily motivated by (and fixes) #12926. We currently only have a span for the individual item itself and not for the referred contents. This normally does not cause a problem since both are located in the same file; it *is* possible that the contained statement or item is located in the other file (the syntax extension can do that), but even in that case the syntax extension should be located in the same file as the item. The module item (i.e. `mod foo;`) is the only exception here, and thus warrants a special treatment. Rustdoc would now distinguish `mod foo;` from `mod foo {...}` by checking if the span for the module item and module contents is in different files. If it's the case, we'd prefer module contents over module item. There are alternative strategies, but as noted above we will have some corner cases if we don't record the contents span explicitly.
2014-04-27syntax: `Mod` records the span for inner contents.Kang Seonghoon-0/+3
this is useful when the module item and module contents are defined from different files (like rustdoc). in most cases the original span for the module item would be used; in other cases, the span for module contents is available separately at the `inner` field.
2014-04-26syntax: ViewItemUse no longer contains multiple view paths.Kang Seonghoon-13/+11
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-23Allow attributes on match armsSteven Fackler-1/+22
RFC: 0008-match-arm-attributes
2014-04-23auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakisbors-9/+9
This alters the borrow checker's requirements on invoking closures from requiring an immutable borrow to requiring a unique immutable borrow. This means that it is illegal to invoke a closure through a `&` pointer because there is no guarantee that is not aliased. This does not mean that a closure is required to be in a mutable location, but rather a location which can be proven to be unique (often through a mutable pointer). For example, the following code is unsound and is no longer allowed: type Fn<'a> = ||:'a; fn call(f: |Fn|) { f(|| { f(|| {}) }); } fn main() { call(|a| { a(); }); } There is no replacement for this pattern. For all closures which are stored in structures, it was previously allowed to invoke the closure through `&self` but it now requires invocation through `&mut self`. The standard library has a good number of violations of this new rule, but the fixes will be separated into multiple breaking change commits. Closes #12224
2014-04-23Fix other bugs with new closure borrowingAlex Crichton-9/+9
This fixes various issues throughout the standard distribution and tests.
2014-04-22auto merge of #13398 : nick29581/rust/unsized-enum, r=nikomatsakisbors-2/+2
Now with proper checking of enums and allows unsized fields as the last field in a struct or variant. This PR only checks passing of unsized types and distinguishing them from sized ones. To be safe we also need to control storage. Closes issues #12969 and #13121, supersedes #13375 (all the discussion there is valid here too).
2014-04-22add support for quadruple precision floating pointDaniel Micay-2/+7
This currently requires linking against a library like libquadmath (or libgcc), because compiler-rt barely has any support for this and most hardware does not yet have 128-bit precision floating point. For this reason, it's currently hidden behind a feature gate. When compiler-rt is updated to trunk, some tests can be added for constant evaluation since there will be support for the comparison operators. Closes #13381