summary refs log tree commit diff
path: root/src/libsyntax/ast_map.rs
AgeCommit message (Collapse)AuthorLines
2014-01-06Disowned the Visitor.Eduard Burtescu-215/+150
2014-01-03librustc: Remove `@mut` support from the typechecker and borrow checkerPatrick Walton-1/+1
2014-01-03libsyntax: De-`@mut` (and de-`@`) the AST mapping contextPatrick Walton-4/+4
2014-01-03libsyntax: De-`@mut` the path in the AST mapping contextPatrick Walton-12/+25
2014-01-03librustc: De-`@mut` the AST mapPatrick Walton-33/+61
2014-01-03librustc: De-`@mut` the span handlerPatrick Walton-3/+3
2014-01-01auto merge of #11255 : klutzy/rust/small-cleanup, r=pcwaltonbors-4/+4
This patchset removes some `@`s and unnecessary traits, and replaces a function (`dummy_sp()`) returning constant value by static variable.
2014-01-02syntax: expand impl_pretty_name to handle more cases.Huon Wilson-16/+61
The resulting symbol names aren't very pretty at all: trait Trait { fn method(&self); } impl<'a> Trait for ~[(&'a int, fn())] { fn method(&self) {} } gives Trait$$UP$$VEC$$TUP_2$$BP$int$$FN$$::method::...hash...::v0.0 However, at least it contain some reference to the Self type, unlike `Trait$__extensions__::method:...`, which is what the symbol name used to be for anything other than `impl Trait for foo::bar::Baz` (which became, and still becomes, `Trait$Baz::method`).
2014-01-01syntax::diagnostic: Remove unnecessary traitsklutzy-4/+4
This removes trait `handler` and `span_handler`, and renames `HandlerT` to `Handler`, `CodemapT` to `SpanHandler`.
2013-12-19Generalize item_span into node_span, which works on more types.Edward Z. Yang-5/+14
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-15/+11
critical enum sizes.
2013-11-28Register new snapshotsAlex Crichton-13/+13
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-2/+2
2013-11-26Take &Pat in visit_patSeo Sanghyeon-2/+2
2013-11-24Add comments to ast, ast_map, ty, and pat_utilKiet Tran-0/+6
2013-11-19libsyntax: Change all uses of `&fn` to `||`.Patrick Walton-4/+3
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-0/+12
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-2/+2
Who doesn't like a massive renaming?
2013-10-10Remove named extern blocks from the ASTAlex Crichton-7/+1
There's currently a fair amount of code which is being ignored on unnamed blocks (which are the default now), and I opted to leave it commented out for now. I intend on very soon revisiting on how we perform linking with extern crates in an effort to support static linking.
2013-10-01librustc: Inline cross-crate tuple struct constructorsPatrick Walton-2/+2
2013-09-30syntax: Remove usage of fmt!Alex Crichton-17/+17
2013-09-15debuginfo: Basic support for trait objects.Michael Woerister-0/+10
2013-09-13Refactor libsyntax Visitor impls to use default methods.Lindsey Kuper-77/+1
2013-09-06Remove even more usage of clownshoes in symbolsAlex Crichton-23/+23
This removes another large chunk of this odd 'clownshoes' identifier showing up in symbol names. These all originated from external crates because the encoded items were encoded independently of the paths calculated in ast_map. The encoding of these paths now uses the helper function in ast_map to calculate the "pretty name" for an impl block. Unfortunately there is still no information about generics in the symbol name, but it's certainly vastly better than before hash::__extensions__::write::_version::v0.8 becomes hash::Writer$SipState::write::hversion::v0.8 This also fixes bugs in which lots of methods would show up as `meth_XXX`, they now only show up as `meth` and throw some extra characters onto the version string.
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-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-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-04Implement support for indicating the stability of items.Huon Wilson-0/+20
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-03Modernized a few more types in syntax::astMarvin Löbel-16/+16
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-02Renamed syntax::ast::ident -> IdentMarvin Löbel-7/+7
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-5/+5
2013-08-22Add `self` to the ast_map for provided methods. Closes #8010.Michael Sullivan-5/+11
2013-08-15Switch to new <V:Visitor> visitor (rather than @Visitor).Felix S. Klock II-51/+52
Alpha-renamed top-level visit_* functions to walk_*. (Motivation: Distinguish visit action and recursive traversal.) Abstract over `&mut self` rather than over `@mut self`. This required some acrobatics, notably the `impl<E> Visitor<E> for @mut Visitor<E>` and corresponding introduction of `@mut Visitor` and some local `let mut` bindings. Remove oldvisit reference. Added default implementations for all of the Visitor trait methods. Note that both `visit_expr_post` and `visit_ty` are no-op's by default, just like they are in `oldvisit::default_visitor`. Refactoring: extract logic to ease swapping visit for oldvisit (hopefully).
2013-08-11libsyntax: Update from `@Object` to `@mut Object` as requiredNiko Matsakis-25/+25
2013-08-05Make node_id_to_str print more useful info in some cases. Closes #2410.Michael Sullivan-4/+4
2013-08-03remove obsolete `foreach` keywordDaniel Micay-7/+7
this has been replaced by `for`
2013-08-02librustc: Introduce a new visitor type based on traits and port syntax to it.Patrick Walton-189/+288
This is preparation for removing `@fn`. This does *not* use default methods yet, because I don't know whether they work. If they do, a forthcoming PR will use them. This also changes the precedence of `as`.
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-7/+7
2013-07-29New naming convention for ast::{node_id, local_crate, crate_node_id, ↵Michael Woerister-4/+4
blk_check_mode, ty_field, ty_method}
2013-07-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-4/+4
`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-18Silence various warnings in bootstrap build.Felix S. Klock II-1/+0
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-28/+10
2013-07-17Made ast::blk not use spanned<T> anymore.Michael Woerister-1/+1
2013-07-11Get cross crate static default methods working. Closes #7569.Michael Sullivan-5/+8
2013-07-07De-managed ast::PathJames Miller-1/+1
2013-06-27Remove many shared pointersPhilipp Brüschweiler-1/+1
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.
2013-06-25great renaming propagation: syntaxCorey Richardson-5/+3