summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2013-09-06renaming test casesJohn Clements-6/+12
2013-09-06flip the switch on let renamingJohn Clements-1/+1
2013-09-06add hygiene support fns, move them around.John Clements-60/+175
also adds test cases
2013-09-06compare macro tokens hygienically (commented out)John Clements-2/+19
2013-09-06rename resolve to mtwt_resolveJohn Clements-4/+3
2013-09-06commenting out special Eq implementation for nowJohn Clements-2/+13
See the comments for details on why I'm leaving this code in, though commented out.
2013-09-06disallow ident equality checks when contexts are not equalJohn Clements-1/+14
2013-09-05auto merge of #8997 : fhahn/rust/issue_8985, r=catamorphism,brsonbors-1/+1
Patch for #8985
2013-09-05auto merge of #8992 : chris-morgan/rust/unreachable-macro, r=brsonbors-0/+30
Rationale: having a function which fails means that the location of failure which is output is that of the unreachable() function, rather than the caller. This is part of #8991 but is not all of it; current usage of ``std::util::unreachable()`` must remain so for the moment, until a new snapshot is made; then I will remove that function entirely in favour of using this macro.
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-1/+1
2013-09-05Remove the __log function for __log_levelAlex Crichton-84/+50
Also redefine all of the standard logging macros to use more rust code instead of custom LLVM translation code. This makes them a bit easier to understand, but also more flexibile for future types of logging. Additionally, this commit removes the LogType language item in preparation for changing how logging is performed.
2013-09-04auto merge of #8875 : alexcrichton/rust/fix-inner-static-library-bug, r=huonwbors-13/+63
These commits fix bugs related to identically named statics in functions of implementations in various situations. The commit messages have most of the information about what bugs are being fixed and why. As a bonus, while I was messing around with name mangling, I improved the backtraces we'll get in gdb by removing `__extensions__` for the trait/type being implemented and by adding the method name as well. Yay!
2013-09-05Add an ``unreachable!()`` macro.Chris Morgan-0/+30
Rationale: having a function which fails means that the location of failure which is output is that of the unreachable() function, rather than the caller. This is part of #8991 but is not all of it; current usage of ``std::util::unreachable()`` must remain so for the moment, until a new snapshot is made; then I will remove that function entirely in favour of using this macro.
2013-09-04Improve name mangling for gdbAlex Crichton-29/+40
Remove __extensions__ from method symbols as well as the meth_XXX. The XXX is now used to append a few characters at the end of the name of the symbol. Closes #6602
2013-09-04auto merge of #8977 : pnkfelix/rust/fsk-followup-on-6009-rebased, r=alexcrichtonbors-2/+1
Fix #6009. Rebased version of #8970. Inherits review from alexcrichton.
2013-09-04debuginfo: Fixed some merge falloutMichael Woerister-1/+1
2013-09-04debuginfo: Support for variables captured in closures and closure type ↵Michael Woerister-4/+4
descriptions.
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