summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2014-03-29auto merge of #13188 : FlaPer87/rust/master, r=alexcrichtonbors-36/+0
2014-03-29Register new snapshotFlavio Percoco-36/+0
2014-03-28De-@ TokenTree.Eduard Burtescu-2/+4
2014-03-27serialize: use ResultSean McArthur-0/+37
All of Decoder and Encoder's methods now return a Result. Encodable.encode() and Decodable.decode() return a Result as well. fixes #12292
2014-03-26syntax: Permit visibility on tuple fieldsAlex Crichton-1/+10
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-23use TotalEq for HashMapDaniel Micay-78/+78
Closes #5283
2014-03-22doc: Remove Freeze / NoFreeze from docsFlavio Percoco-1/+1
2014-03-21auto merge of #13016 : huonw/rust/new-opt-vec, r=cmrbors-6/+6
Replace syntax::opt_vec with syntax::owned_slice The `owned_slice::OwnedSlice` is `(*T, uint)` (i.e. a direct equivalent to DSTs `~[T]`). This shaves two words off the old OptVec type; and also makes substituting in other implementations easy, by removing all the mutation methods. (And also everything that's very rarely/never used.)
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-6/+6
syntax::opt_vec is now entirely unused, and so can go.
2014-03-21Rewrite rc::Rc using cell::CellEdward Wang-8/+0
Since `Arc` has been using `Atomic`, this closes 12625. Closes #12625.
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-2/+7
It's now in the prelude.
2014-03-20auto merge of #12686 : FlaPer87/rust/shared, r=nikomatsakisbors-8/+0
`Share` implies that all *reachable* content is *threadsafe*. Threadsafe is defined as "exposing no operation that permits a data race if multiple threads have access to a &T pointer simultaneously". (NB: the type system should guarantee that if you have access to memory via a &T pointer, the only other way to gain access to that memory is through another &T pointer)... Fixes #11781 cc #12577 What this PR will do ================ - [x] Add Share kind and - [x] Replace usages of Freeze with Share in bounds. - [x] Add Unsafe<T> #12577 - [x] Forbid taking the address of a immutable static item with `Unsafe<T>` interior What's left to do in a separate PR (after the snapshot)? =========================================== - Remove `Freeze` completely
2014-03-20Relax interner's Share boundFlavio Percoco-8/+0
The interner uses `RefCell` internally which opted out from Share.
2014-03-20Replace Freeze bounds with Share boundsFlavio Percoco-4/+4
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-2/+2
Closes #12771
2014-03-20rename std::vec -> std::sliceDaniel Micay-1/+1
Closes #12702
2014-03-15rustc: Remove compiler support for __log_level()Alex Crichton-3/+0
This commit removes all internal support for the previously used __log_level() expression. The logging subsystem was previously modified to not rely on this magical expression. This also removes the only other function to use the module_data map in trans, decl_gc_metadata. It appears that this is an ancient function from a GC only used long ago. This does not remove the crate map entirely, as libgreen still uses it to hook in to the event loop provided by libgreen.
2014-03-14Added support for type placeholders (explicit requested typeMarvin Löbel-2/+1
inference in a type with `_` ). This enables partial type inference.
2014-03-13Apply @nikomatsakis' nits and comments patch.Eduard Burtescu-1/+1
2014-03-12Changed lists of lifetimes in ast and ty to use Vec instead of OptVec.Felix S. Klock II-4/+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-12alpha-rename .ident to .name in Lifetime, including in rustdoc.Felix S. Klock II-1/+1
2014-03-07create a sensible comparison trait hierarchyDaniel Micay-2/+2
* `Ord` inherits from `Eq` * `TotalOrd` inherits from `TotalEq` * `TotalOrd` inherits from `Ord` * `TotalEq` inherits from `Eq` This is a partial implementation of #12517.
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-37/+4
- 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-03syntax: make match arms store the expr directly.Huon Wilson-1/+1
Previously `ast::Arm` was always storing a single `ast::Expr` wrapped in an `ast::Block` (for historical reasons, AIUI), so we might as just store that expr directly. Closes #3085.
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-0/+3
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-49/+49
2014-02-26Replace callee_id with information stored in method_map.Eduard Burtescu-18/+5
2014-02-24std: minor whitespace cleanupErick Tryzelaar-19/+19
2014-02-24Move extra::json to libserializeAlex Crichton-2/+1
This also inverts the dependency between libserialize and libcollections. cc #8784
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-27/+28
This commit changes the ToStr trait to: impl<T: fmt::Show> ToStr for T { fn to_str(&self) -> ~str { format!("{}", *self) } } The ToStr trait has been on the chopping block for quite awhile now, and this is the final nail in its coffin. The trait and the corresponding method are not being removed as part of this commit, but rather any implementations of the `ToStr` trait are being forbidden because of the generic impl. The new way to get the `to_str()` method to work is to implement `fmt::Show`. Formatting into a `&mut Writer` (as `format!` does) is much more efficient than `ToStr` when building up large strings. The `ToStr` trait forces many intermediate allocations to be made while the `fmt::Show` trait allows incremental buildup in the same heap allocated buffer. Additionally, the `fmt::Show` trait is much more extensible in terms of interoperation with other `Writer` instances and in more situations. By design the `ToStr` trait requires at least one allocation whereas the `fmt::Show` trait does not require any allocations. Closes #8242 Closes #9806
2014-02-23auto merge of #12338 : edwardw/rust/hygienic-break-continue, r=cmrbors-4/+9
Makes labelled loops hygiene by performing renaming of the labels defined in e.g. `'x: loop { ... }` and then used in break and continue statements within loop body so that they act hygienically when used with macros. Closes #12262.
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-81/+81
2014-02-23Make break and continue hygienicEdward Wang-4/+9
Makes labelled loops hygiene by performing renaming of the labels defined in e.g. `'x: loop { ... }` and then used in break and continue statements within loop body so that they act hygienically when used with macros. Closes #12262.
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-3/+3
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-22auto merge of #12451 : edwardw/rust/ident-2-name, r=cmrbors-2/+1
Closes #7743.
2014-02-22Warn about unnecessary parentheses upon assignmentEduard Bopp-1/+1
Closes #12366. Parentheses around assignment statements such as let mut a = (0); a = (1); a += (2); are not necessary and therefore an unnecessary_parens warning is raised when statements like this occur. The warning mechanism was refactored along the way to allow for code reuse between the routines for checking expressions and statements. Code had to be adopted throughout the compiler and standard libraries to comply with this modification of the lint.
2014-02-22Represent lifetimes as Names instead of IdentsEdward Wang-2/+1
Closes #7743.
2014-02-20move extra::test to libtestLiigo Zhuang-2/+3
2014-02-14extern mod => extern crateAlex Crichton-1/+1
This was previously implemented, and it just needed a snapshot to go through
2014-02-14Removed the obsolete ast::CallSugar (previously used by `do`).Eduard Burtescu-9/+3
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-3/+2
2014-02-13Replace `crate` usage with `krate`Flavio Percoco-1/+1
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-07Removed @self and @Trait.Eduard Burtescu-2/+1
2014-02-06Remove reference to @str in commentFlorian Hahn-2/+2
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-2/+3
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
2014-02-02syntax: remove the unused Vstore enum.Huon Wilson-9/+0
Seems to have been replaced by ExprVstore.
2014-02-02syntax: remove the handling of @str and @[] from the parser completely.Huon Wilson-1/+0
2014-02-02syntax: convert LitBinary from @[u8] to Rc<~[u8]>.Huon Wilson-1/+2
2014-02-02libsyntax: Remove the `interner_get` function and all usesPatrick Walton-3/+4