summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-09-04stop treating char as an integer typeDaniel Micay-22/+41
Closes #7609
2013-09-04Make non-pub condition! expand to non-pub mod. Fix #6009.Felix S. Klock II-2/+1
2013-09-03auto merge of #8963 : jmgrosen/rust/issue-8881, r=alexcrichtonbors-0/+8
2013-09-03Fixes #8881. condition! imports parent's pub identifiersjmgrosen-0/+8
2013-09-03auto merge of #8921 : huonw/rust/stability, r=brsonbors-0/+58
Significant progress on #6875, enough that I'll open new bugs and turn that into a metabug when this lands. Description & example in the commit message.
2013-09-03auto merge of #8945 : alexcrichton/rust/ifmt-dont-move, r=thestingerbors-2/+6
2013-09-04Implement support for indicating the stability of items.Huon Wilson-0/+58
There are 6 new compiler recognised attributes: deprecated, experimental, unstable, stable, frozen, locked (these levels are taken directly from Node's "stability index"[1]). These indicate the stability of the item to which they are attached; e.g. `#[deprecated] fn foo() { .. }` says that `foo` is deprecated. This comes with 3 lints for the first 3 levels (with matching names) that will detect the use of items marked with them (the `unstable` lint includes items with no stability attribute). The attributes can be given a short text note that will be displayed by the lint. An example: #[warn(unstable)]; // `allow` by default #[deprecated="use `bar`"] fn foo() { } #[stable] fn bar() { } fn baz() { } fn main() { foo(); // "warning: use of deprecated item: use `bar`" bar(); // all fine baz(); // "warning: use of unmarked item" } The lints currently only check the "edges" of the AST: i.e. functions, methods[2], structs and enum variants. Any stability attributes on modules, enums, traits and impls are not checked. [1]: http://nodejs.org/api/documentation.html [2]: the method check is currently incorrect and doesn't work.
2013-09-03auto merge of #8939 : Kimundi/rust/master, r=huonwbors-1400/+1400
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-1400/+1400
2013-09-03auto merge of #8940 : ↵bors-2/+11
pnkfelix/rust/fsk-8468-allow-underscore-paramname-in-trait-default-method, r=alexcrichton Fix #8468. (Though the right answer in the end, as noted on the dialogue on the ticket, might be to just require trait methods to name their parameters, regardless of whether they have a default method implementation or not.)
2013-09-03Incorporate review feedback. Fix #8468.Felix S. Klock II-4/+1
2013-09-02Don't have format! move out of local variablesAlex Crichton-2/+6
2013-09-02Remove __extensions__ in names for a "pretty name"Alex Crichton-5/+36
As with the previous commit, this is targeted at removing the possibility of collisions between statics. The main use case here is when there's a type-parametric function with an inner static that's compiled as a library. Before this commit, any impl would generate a path item of "__extensions__". This changes this identifier to be a "pretty name", which is either the last element of the path of the trait implemented or the last element of the type's path that's being implemented. That doesn't quite cut it though, so the (trait, type) pair is hashed and again used to append information to the symbol. Essentially, __extensions__ was removed for something nicer for debugging, and then some more information was added to symbol name by including a hash of the trait being implemented and type it's being implemented for. This should prevent colliding names for inner statics in regular functions with similar names.
2013-09-02Fix inner statics having the same symbol nameAlex Crichton-0/+8
Before, the path name for all items defined in methods of traits and impls never took into account the name of the method. This meant that if you had two statics of the same name in two different methods the statics would end up having the same symbol named (even after mangling) because the path components leading to the symbol were exactly the same (just __extensions__ and the static name). It turns out that if you add the symbol "A" twice to LLVM, it automatically makes the second one "A1" instead of "A". What this meant is that in local crate compilations we never found this bug. Even across crates, this was never a problem. The problem arises when you have generic methods that don't get generated at compile-time of a library. If the statics were re-added to LLVM by a client crate of a library in a different order, you would reference different constants (the integer suffixes wouldn't be guaranteed to be the same). This fixes the problem by adding the method name to symbol path when building the ast_map. In doing so, two symbols in two different methods are disambiguated against.
2013-09-03Allow _ param name in trait default method for #8468.Felix S. Klock II-2/+14
2013-09-02libsyntax: Remove obsolete fixme.Luqman Aden-1/+0
2013-09-02switch __field__ hack to <unnamed_field>Daniel Micay-1/+1
avoids conflict with fields actually named `__field__`
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-357/+359
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-565/+565
2013-08-30fix various warningsErick Tryzelaar-1/+1
2013-08-28auto merge of #8718 : bblum/rust/typeof, r=pcwaltonbors-3/+39
r? anybody
2013-08-27librustc: Fix merge fallout.Patrick Walton-46/+3
2013-08-27librustc: Ensure that type parameters are in the right positions in paths.Patrick Walton-22/+66
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
2013-08-27librustc: Add support for type parameters in the middle of paths.Patrick Walton-301/+505
For example, `foo::<T>::bar::<U>`. This doesn't enforce that the type parameters are in the right positions, however.
2013-08-27librustc: Remove `&const` and `*const` from the language.Patrick Walton-19/+14
They are still present as part of the borrow check.
2013-08-27auto merge of #8797 : ↵bors-2/+2
nikomatsakis/rust/issue-8625-assign-to-andmut-in-borrowed-loc-2, r=pcwalton Fixes for #8625 to prevent assigning to `&mut` in borrowed or aliasable locations. The old code was insufficient in that it failed to catch bizarre cases like `& &mut &mut`. r? @pnkfelix
2013-08-27Remove remnants of implicit selfNiko Matsakis-2/+2
2013-08-24Introduce alternate forms of loggingAlex Crichton-23/+30
These new macros are all based on format! instead of fmt! and purely exist for bootstrapping purposes. After the next snapshot, all uses of logging will be migrated to these macros, and then after the next snapshot after that we can drop the `2` suffix on everything
2013-08-24Settle on the format/write/print family of namesAlex Crichton-11/+36
2013-08-24Implement a wrapper macro around fprintf -- ifmtfAlex Crichton-22/+50
2013-08-23Emit a better error for attempted unsafe-pointer-self. Close #8306.Ben Blum-0/+13
2013-08-23Parse and reserve typeof keyword. #3228Ben Blum-3/+26
2013-08-22Add `self` to the ast_map for provided methods. Closes #8010.Michael Sullivan-5/+11
2013-08-22auto merge of #8626 : kballard/rust/issue-8615, r=catamorphismbors-1/+0
Fixes #8615.
2013-08-21std/extra: changing XXX to FIXME; cleanupTim Chevalier-2/+9
* Get rid of by-value-self workarounds; it works now * Remove type annotations, they're not needed anymore
2013-08-21auto merge of #8582 : thestinger/rust/container, r=thestingerbors-6/+5
5f3a637 r=huonw 934a5eb r=thestinger 0f6e90a r=cmr
2013-08-20auto merge of #8573 : mrordinaire/rust/struct-new-as-field-name, r=alexcrichtonbors-23/+0
fix for #8088, along with a test.
2013-08-20rm obsolete integer to_str{,_radix} free functionsDaniel Micay-6/+5
2013-08-19Don't skip token after @'staticKevin Ballard-1/+0
Fixes #8615.
2013-08-19auto merge of #8535 : nikomatsakis/rust/issue-3678-wrappers-be-gone-2, r=graydonbors-0/+79
Long-standing branch to remove foreign function wrappers altogether. Calls to C functions are done "in place" with no stack manipulation; the scheme relies entirely on the correct use of `#[fixed_stack_segment]` to guarantee adequate stack space. A linter is added to detect when `#[fixed_stack_segment]` annotations are missing. An `externfn!` macro is added to make it easier to declare foreign fns and wrappers in one go: this macro may need some refinement, though, for example it might be good to be able to declare a group of foreign fns. I leave that for future work (hopefully somebody else's work :) ). Fixes #3678.
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+79
2013-08-19auto merge of #8564 : alexcrichton/rust/ifmt+++, r=graydonbors-23/+20
See discussion in #8489, but this selects option 3 by adding a `Default` trait to be implemented by various basic types. Once this makes it into a snapshot I think it's about time to start overhauling all current use-cases of `fmt!` to move towards `ifmt!`. The goal is to replace `%X` with `{}` in 90% of situations, and this commit should enable that.
2013-08-18auto merge of #8556 : sfackler/rust/quote, r=alexcrichtonbors-154/+114
They previously required one called "ext_cx" to be in scope. Fixes part of #7727
2013-08-18auto merge of #8560 : kballard/rust/reserve-yield, r=pcwaltonbors-4/+7
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-18quote_*! macros take an ExtCtxSteven Fackler-154/+114
They previously required one called "ext_cx" to be in scope. Fixes part of #7727
2013-08-18auto merge of #8551 : huonw/rust/speling, r=alexcrichtonbors-3/+3
(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
2013-08-18auto merge of #8550 : kballard/rust/token-start-err-msg, r=catamorphismbors-1/+3
The span was fixed at some point to point to the correct character, but the error message is still bad. Update it to emit the actual character in question (potentially escaped). Fixes #3747.
2013-08-17auto merge of #8547 : kballard/rust/trait-parse-err-msg, r=alexcrichtonbors-1/+1
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-18fix for #8088 (Cannot name a struct field `new` due to ancient syntax)Do Nhat Minh-23/+0
remove code for parsing ancient syntax added a run-pass test
2013-08-17Fix warnings in librustc and libsyntaxErick Tryzelaar-1/+0