summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2014-04-03Test fixes from the rollupAlex Crichton-8/+8
2014-04-03Bump version to 0.11-preBrian Anderson-1/+1
This also changes some of the download links in the documentation to 'nightly'.
2014-04-03auto merge of #13286 : alexcrichton/rust/release, r=brsonbors-1/+1
Merging the 0.10 release into the master branch.
2014-04-03syntax: Remove AbiSet, use one AbiAlex Crichton-348/+100
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-04-02Fix fallout of requiring uint indicesAlex Crichton-2/+2
2014-03-31syntax: allow stmt/expr macro invocations to be delimited by [].Gábor Lehel-34/+22
this is useful for macros like vec! which construct containers
2014-03-31Switch some tuple structs to pub fieldsAlex Crichton-3/+3
This commit deals with the fallout of the previous change by making tuples structs have public fields where necessary (now that the fields are private by default).
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-297/+297
2014-03-31Bump version to 0.10Alex Crichton-1/+1
2014-03-31auto merge of #13221 : thestinger/rust/append, r=alexcrichtonbors-29/+14
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-29/+14
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-30Rename `from_iterator` to `from_iter` for consistency.Brian Anderson-3/+3
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-111/+117
2014-03-29auto merge of #13188 : FlaPer87/rust/master, r=alexcrichtonbors-98/+0
2014-03-28auto merge of #13170 : eddyb/rust/syntax-cleanup, r=alexcrichtonbors-444/+400
Removes all Cell's/RefCell's from lexer::Reader implementations and a couple @.
2014-03-29Register new snapshotFlavio Percoco-98/+0
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-15/+17
Closes #2569
2014-03-28syntax: Accept meta matchers in macrosAlex Crichton-16/+13
This removes the `attr` matcher and adds a `meta` matcher. The previous `attr` matcher is now ambiguous because it doesn't disambiguate whether it means inner attribute or outer attribute. The new behavior can still be achieved by taking an argument of the form `#[$foo:meta]` (the brackets are part of the macro pattern). Closes #13067
2014-03-28Remove a RefCell from pprust::State.Eduard Burtescu-10/+9
2014-03-28De-@ IdentInterner.Eduard Burtescu-8/+10
2014-03-28De-@ NamedMatch.Eduard Burtescu-26/+27
2014-03-28De-@ TokenTree.Eduard Burtescu-17/+26
2014-03-28Used inherited mutability in lexer::Reader.Eduard Burtescu-388/+333
2014-03-28Rename Pod into CopyFlavio Percoco-3/+3
Summary: So far, we've used the term POD "Plain Old Data" to refer to types that can be safely copied. However, this term is not consistent with the other built-in bounds that use verbs instead. This patch renames the Pod kind into Copy. RFC: 0003-opt-in-builtin-traits Test Plan: make check Reviewers: cmr Differential Revision: http://phabricator.octayn.net/D3
2014-03-27serialize: use ResultSean McArthur-16/+205
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-27Fix fallout of removing default boundsAlex Crichton-4/+4
This is all purely fallout of getting the previous commit to compile.
2014-03-26auto merge of #13079 : alexcrichton/rust/colons, r=cmrbors-65/+24
The previous syntax was `Foo:Bound<trait-parameters>`, but this is a little ambiguous because it was being parsed as `Foo: (Bound<trait-parameters)` rather than `Foo: (Bound) <trait-parameters>` This commit changes the syntax to `Foo<trait-parameters>: Bound` in order to be clear where the trait parameters are going. Closes #9265
2014-03-26auto merge of #13145 : alexcrichton/rust/flip-some-defaults, r=brsonbors-9/+18
This change prepares `rustc` to accept private fields by default. These changes will have to go through a snapshot before the rest of the changes can happen.
2014-03-26syntax: Tweak parsing bounds on generics pathsAlex Crichton-65/+24
The previous syntax was `Foo:Bound<trait-parameters>`, but this is a little ambiguous because it was being parsed as `Foo: (Bound<trait-parameters)` rather than `Foo: (Bound) <trait-parameters>` This commit changes the syntax to `Foo<trait-parameters>: Bound` in order to be clear where the trait parameters are going. Closes #9265
2014-03-26auto merge of #13152 : huonw/rust/wtf-are-things-in-spans, r=alexcrichtonbors-4/+27
Add some docs to ExpnInfo. Add a single overlooked `new_span` call to the folder (I'm pretty sure nothing reads this span, though, so it's probably pointless).
2014-03-26syntax: Permit visibility on tuple fieldsAlex Crichton-9/+18
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-27syntax: add a missing span rewrite in fold.Huon Wilson-1/+1
This was leaving Decls without the new spans; this is a minor change, since literally nothing reads in the code base reads the span of a Decl itself, always just its contents.
2014-03-27syntax: add a some docs/clarification to the fields of ExpnInfo.Huon Wilson-3/+26
2014-03-25Changed `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by ↵Marvin Löbel-11/+9
value
2014-03-24auto merge of #12998 : huonw/rust/log_syntax, r=alexcrichtonbors-35/+33
syntax: allow `trace_macros!` and `log_syntax!` in item position. Previously trace_macros!(true) fn main() {} would complain about `trace_macros` being an expression macro in item position. This is a pointless limitation, because the macro is purely compile-time, with no runtime effect. (And similarly for log_syntax.) This also changes the behaviour of `trace_macros!` very slightly, it used to be equivalent to macro_rules! trace_macros { (true $($_x: tt)*) => { true }; (false $($_x: tt)*) => { false } } I.e. you could invoke it with arbitrary trailing arguments, which were ignored. It is changed to accept only exactly `true` or `false` (with no trailing arguments) and expands to `()`.
2014-03-23auto merge of #13102 : huonw/rust/totaleq-deriving, r=thestingerbors-12/+17
std: remove the `equals` method from `TotalEq`. `TotalEq` is now just an assertion about the `Eq` impl of a type (i.e. `==` is a total equality if a type implements `TotalEq`) so the extra method is just confusing. Also, a new method magically appeared as a hack to allow deriving to assert that the contents of a struct/enum are also TotalEq, because the deriving infrastructure makes it very hard to do anything but create a trait method. (You didn't hear about this horrible work-around from me :(.)
2014-03-23std: remove the `equals` method from `TotalEq`.Huon Wilson-12/+17
`TotalEq` is now just an assertion about the `Eq` impl of a type (i.e. `==` is a total equality if a type implements `TotalEq`) so the extra method is just confusing. Also, a new method magically appeared as a hack to allow deriving to assert that the contents of a struct/enum are also TotalEq, because the deriving infrastructure makes it very hard to do anything but create a trait method. (You didn't hear about this horrible work-around from me :(.)
2014-03-23Register new snapshotsFlavio Percoco-1/+0
2014-03-23use TotalEq for HashMapDaniel Micay-89/+92
Closes #5283
2014-03-22auto merge of #13085 : edwardw/rust/saddest-cell, r=cmrbors-9/+8
2014-03-22auto merge of #13076 : FlaPer87/rust/remove-freeze, r=alexcrichtonbors-1/+1
This PR removes the `Freeze` kind and the `NoFreeze` marker completely. Fixes #12577 cc @nikomatsakis r?
2014-03-23Get rid of @CellEdward Wang-9/+8
2014-03-22syntax: Fix fallout of removing get()Alex Crichton-209/+159
2014-03-22doc: Remove Freeze / NoFreeze from docsFlavio Percoco-1/+1
2014-03-21auto merge of #13016 : huonw/rust/new-opt-vec, r=cmrbors-320/+243
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-267/+85
syntax::opt_vec is now entirely unused, and so can go.
2014-03-22syntax: add the OwnedSlice vector wrapper.Huon Wilson-0/+143
This is a stand-in until we have a saner `~[T]` type (i.e. a proper owned slice). It's a library version of what `~[T]` will be, i.e. an owned pointer and a length.
2014-03-22syntax: allow `trace_macros!` and `log_syntax!` in item position.Huon Wilson-35/+33
Previously trace_macros!(true) fn main() {} would complain about `trace_macros` being an expression macro in item position. This is a pointless limitation, because the macro is purely compile-time, with no runtime effect. (And similarly for log_syntax.) This also changes the behaviour of `trace_macros!` very slightly, it used to be equivalent to macro_rules! trace_macros { (true $($_x: tt)*) => { true }; (false $($_x: tt)*) => { false } } I.e. you could invoke it with arbitrary trailing arguments, which were ignored. It is changed to accept only exactly `true` or `false` (with no trailing arguments) and expands to `()`.
2014-03-21Rewrite rc::Rc using cell::CellEdward Wang-8/+0
Since `Arc` has been using `Atomic`, this closes 12625. Closes #12625.