summary refs log tree commit diff
path: root/src/libsyntax/ast_util.rs
AgeCommit message (Collapse)AuthorLines
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-10/+12
2014-03-26syntax: Permit visibility on tuple fieldsAlex Crichton-2/+1
This change is in preparation for #8122. Nothing is currently done with these visibility qualifiers, they are just parsed and accepted by the compiler. RFC: 0004-private-fields
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-5/+5
syntax::opt_vec is now entirely unused, and so can go.
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-2/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-2/+2
Closes #12771
2014-03-12Suggest explicit lifetime parameter on some errorsKiet Tran-0/+21
Some types of error are caused by missing lifetime parameter on function or method declaration. In such cases, this commit generates some suggestion about what the function declaration could be. This does not support method declaration yet.
2014-03-12Changed lists of lifetimes in ast and ty to use Vec instead of OptVec.Felix S. Klock II-3/+4
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-1/+1
clean::ExternMod to clean::ExternCrate
2014-03-05Refactor and fix FIXME's in mtwt hygiene codeEdward Wang-457/+1
- Moves mtwt hygiene code into its own file - Fixes FIXME's which leads to ~2x speed gain in expansion pass - It is now @-free
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-10/+13
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-55/+55
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-6/+6
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-26Replace callee_id with information stored in method_map.Eduard Burtescu-6/+0
2014-02-25Use only the appropriate trait when looking up operator overloads.Eduard Burtescu-41/+19
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-2/+2
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-2/+19
2014-02-13auto merge of #12061 : pongad/rust/delorderable, r=cmrbors-3/+3
#12057
2014-02-13Removed num::OrderableMichael Darakananda-3/+3
2014-02-13Replace `crate` usage with `krate`Flavio Percoco-2/+2
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-02libsyntax: Remove the `interner_get` function and all usesPatrick Walton-1/+4
2014-01-27Demote self to an (almost) regular argument and remove the env param.Eduard Burtescu-27/+14
Fixes #10667 and closes #10259.
2014-01-25Uppercase numeric constantsChris Wong-2/+2
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` Fixes #10010.
2014-01-21[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behaviorSimon Sapin-1/+1
2014-01-21[std::vec] Rename .last_opt() to .last(), drop the old .last() behaviorSimon Sapin-2/+2
2014-01-21Remove unnecessary parentheses.Huon Wilson-5/+5
2014-01-17auto merge of #11585 : nikomatsakis/rust/issue-3511-rvalue-lifetimes, r=pcwaltonbors-5/+1
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way. r? @pcwalton
2014-01-17syntax::ast: Remove/Recover testsklutzy-17/+19
`xorpush_test` and `test_marksof` are at `syntax::ast_util`. Fixes #7952
2014-01-15Issue #3511 - Rationalize temporary lifetimes.Niko Matsakis-5/+1
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way.
2014-01-13librustc: Remove `@` pointer patterns from the languagePatrick Walton-1/+10
2014-01-11Remove re-exports of std::io::stdio::{print, println} in the prelude.Brendan Zabarauskas-1/+1
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-84/+83
2014-01-06Disowned the Visitor.Eduard Burtescu-41/+14
2014-01-03librustc: Remove `@mut` support from the parserPatrick Walton-6/+6
2014-01-03libsyntax: Remove an unnecessary `@mut io::Reader`Patrick Walton-8/+10
2014-01-03libsyntax: De-`@mut` `SCTable`Patrick Walton-10/+14
2014-01-03libsyntax: De-`@mut` `SCTable::rename_memo`Patrick Walton-4/+5
2014-01-03libsyntax: De-`@mut` `SCTable::mark_memo`Patrick Walton-4/+5
2014-01-03libsyntax: De-`@mut` `SCTable::table`Patrick Walton-13/+36
2014-01-03libsyntax: De-`@mut` the resolve tablePatrick Walton-5/+8
2014-01-01Remove `extern mod foo (name="bar")` syntax, closes #9543Florian Hahn-1/+1
2013-12-12Remove fk_anonSeo Sanghyeon-1/+1
2013-12-11Make 'self lifetime illegal.Erik Price-7/+7
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-01auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichtonbors-1/+1
2013-12-01ast: Remove one `@` and fix the falloutPhilipp Brüschweiler-1/+1
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-22/+11
critical enum sizes.
2013-11-28Register new snapshotsAlex Crichton-8/+8
2013-11-26auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichtonbors-15/+9
### Rationale There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**. Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**. ### Potential problems Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it. ### Results Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3). Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference). However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.
2013-11-27Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.Eduard Burtescu-15/+9
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-2/+2
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-1/+1