summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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.
2014-03-20syntax: Tidy up parsing the new attribute syntaxAlex Crichton-47/+41
2014-03-20Added new attribute syntax with backward compatibility.Daniel Fagnan-11/+51
Signed-off-by: Daniel Fagnan <dnfagnan@gmail.com>
2014-03-21syntax: make OptVec immutable.Huon Wilson-60/+22
This is the first step to replacing OptVec with a new representation: remove all mutability. Any mutations have to go via `Vec` and then make to `OptVec`. Many of the uses of OptVec are unnecessary now that Vec has no-alloc emptiness (and have been converted to Vec): the only ones that really need it are the AST and sty's (and so on) where there are a *lot* of instances of them, and they're (mostly) immutable.
2014-03-20Register new snapshotsAlex Crichton-3/+3
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-84/+7
It's now in the prelude.
2014-03-20auto merge of #12686 : FlaPer87/rust/shared, r=nikomatsakisbors-9/+1
`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-20auto merge of #13028 : thestinger/rust/vec_ng, r=huonwbors-76/+76
Closes #12771
2014-03-20Relax interner's Share boundFlavio Percoco-12/+1
The interner uses `RefCell` internally which opted out from Share.
2014-03-20Replace Freeze bounds with Share boundsFlavio Percoco-5/+8