about summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2014-04-20Allow inheritance between structs.Nick Cameron-1/+3
No subtyping, no interaction with traits. Partially addresses #9912.
2014-04-16rustc: Remove private enum variantsAlex Crichton-2/+1
This removes the `priv` keyword from the language and removes private enum variants as a result. The remaining use cases of private enum variants were all updated to be a struct with one private field that is a private enum. RFC: 0006-remove-priv Closes #13535
2014-04-13auto merge of #13452 : Ryman/rust/fix_uint_as_u, r=alexcrichtonbors-2/+2
Fixes #13359.
2014-04-13libsyntax: update helper to stringify TyU* and TyI* to take into account ↵Kevin Butler-2/+2
having a value. Fixes #13359.
2014-04-11syntax: remove ast::Sigil.Eduard Burtescu-20/+2
2014-04-10Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and ↵Kasey Carrothers-11/+11
updated associated variable and function names.
2014-04-04syntax: remove obsolete mutability from ExprVec and ExprRepeat.Eduard Burtescu-2/+2
2014-04-03auto merge of #13237 : alexcrichton/rust/private-tuple-structs, r=brsonbors-6/+6
This is the final commit need to implement [RFC #4](https://github.com/rust-lang/rfcs/blob/master/active/0004-private-fields.md), it makes all tuple struct fields private by default, overridable with the `pub` keyword. I'll note one divergence from the original RFC which is outlined in the first commit.
2014-04-03syntax: Remove AbiSet, use one AbiAlex Crichton-4/+4
This change removes the AbiSet from the AST, converting all usage to have just one Abi value. The current scheme selects a relevant ABI given a list of ABIs based on the target architecture and how relevant each ABI is to that architecture. Instead of this mildly complicated scheme, only one ABI will be allowed in abi strings, and pseudo-abis will be created for special cases as necessary. For example the "system" abi exists for stdcall on win32 and C on win64. Closes #10049
2014-03-31rustc: Switch tuple structs to have private fieldsAlex Crichton-6/+6
This is a continuation of the work done in #13184 to make struct fields private by default. This commit finishes RFC 4 by making all tuple structs have private fields by default. Note that enum variants are not affected. A tuple struct having a private field means that it cannot be matched on in a pattern match (both refutable and irrefutable), and it also cannot have a value specified to be constructed. Similarly to private fields, switching the type of a private field in a tuple struct should be able to be done in a backwards compatible way. The one snag that I ran into which wasn't mentioned in the RFC is that this commit also forbids taking the value of a tuple struct constructor. For example, this code now fails to compile: mod a { pub struct A(int); } let a: fn(int) -> a::A = a::A; //~ ERROR: first field is private Although no fields are bound in this example, it exposes implementation details through the type itself. For this reason, taking the value of a struct constructor with private fields is forbidden (outside the containing module). RFC: 0004-private-fields
2014-03-31syntax: Switch field privacy as necessaryAlex Crichton-144/+144
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