about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/decodable.rs
AgeCommit message (Collapse)AuthorLines
2015-12-15Move built-in syntax extensions to a separate crateSeo Sanghyeon-223/+0
2015-08-29Allow #[derive()] to generate unsafe trait implsMichael Layzell-0/+1
2015-08-03syntax: Implement #![no_core]Alex Crichton-3/+4
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-8/+8
2015-05-22Let MultiItemDecorator take `&Annotatable` (fixes #25683)Manish Goregaokar-4/+4
2015-05-17Allow #[derive()] to generate unsafe methodsManish Goregaokar-0/+1
2015-05-12RebasingNick Cameron-1/+1
2015-04-30WIP refactor expansion of decorators and move derive to MultiDecoratorNick Cameron-8/+8
2015-04-21syntax: remove #![feature(box_syntax, box_patterns)]Erick Tryzelaar-3/+3
2015-04-15syntax: Change deriving methods to take a `&mut FnMut(P<Item>)`Erick Tryzelaar-19/+16
This allows #[derive(...)]` to create more than one impl
2015-03-03Switched to Box::new in many places.Felix S. Klock II-2/+2
Many of the modifications putting in `Box::new` calls also include a pointer to Issue 22405, which tracks going back to `box <expr>` if possible in the future. (Still tried to use `Box<_>` where it sufficed; thus some tests still have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.) Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-1/+1
where possible.
2015-02-12Made `Self` a keyword.Marvin Löbel-1/+1
It is only allowed in paths now, where it will either work inside a `trait` or `impl` item, or not resolve outside of it. [breaking-change] Closes #22137
2015-02-07Don't use std:: paths in syntax extensions when compiling a #![no_std] crateKeegan McAllister-1/+7
Fixes #16803. Fixes #14342. Fixes half of #21827 -- slice syntax is still broken.
2015-02-07Use path helper macros in derivingKeegan McAllister-1/+1
2015-01-25Associated types support for deriving::generic::TraitDefDzmitry Malyshau-1/+3
2015-01-21rollup merge of #21340: pshc/libsyntax-no-more-intsAlex Crichton-6/+6
Collaboration with @rylev! I didn't change `int` in the [quasi-quoter](https://github.com/pshc/rust/blob/99ae1a30f3ca28c0f7e431620560d30e44627124/src/libsyntax/ext/quote.rs#L328), because I'm not sure if there will be adverse effects. Addresses #21095.
2015-01-17libsyntax: rename functions from uint to usizePaul Collier-4/+4
2015-01-17libsyntax: uint types to usizePaul Collier-2/+2
2015-01-17s/deriving/derives in Comments/DocsEarl St Sauver-1/+1
There are a large number of places that incorrectly refer to deriving in comments, instead of derives. Fixes #20984
2015-01-15Avoid unnecessary closures when deriving RustcDecodableBjörn Steinbrink-4/+3
Currently, we build a closure that does nothing but pass its argument through to another function, this is rather wasteful and creates lots of unnecessary closures.
2015-01-07use slicing sugarJorge Aparicio-2/+1
2015-01-07Replace full slice notation with index callsNick Cameron-1/+1
2015-01-05syntax: remove remaining boxed closuresJorge Aparicio-1/+1
2015-01-04serialize: Use assoc types + less old_orphan_checkAlex Crichton-14/+16
This commit moves the libserialize crate (and will force the hand of the rustc-serialize crate) to not require the `old_orphan_check` feature gate as well as using associated types wherever possible. Concretely, the following changes were made: * The error type of `Encoder` and `Decoder` is now an associated type, meaning that these traits have no type parameters. * The `Encoder` and `Decoder` type parameters on the `Encodable` and `Decodable` traits have moved to the corresponding method of the trait. This movement alleviates the dependency on `old_orphan_check` but implies that implementations can no longer be specialized for the type of encoder/decoder being implemented. Due to the trait definitions changing, this is a: [breaking-change]
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-1/+1
2014-12-26Accept `?Sized` as well as `Sized?`Nick Cameron-2/+2
Includes a bit of refactoring to store `?` unbounds as bounds with a modifier, rather than in their own world, in the AST at least.
2014-12-22rollup merge of #20033: alexcrichton/deprecate-serialiseAlex Crichton-5/+27
This commit completes the deprecation story for the in-tree serialization library. The compiler will now emit a warning whenever it encounters `deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now marked `#[unstable]` for when feature staging is enabled. All users of serialization can migrate to the `rustc-serialize` crate on crates.io which provides the exact same interface as the libserialize library in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable` and require `extern crate "rustc-serialize" as rustc_serialize` at the crate root in order to expand correctly. To migrate all crates, add the following to your `Cargo.toml`: [dependencies] rustc-serialize = "0.1.1" And then add the following to your crate root: extern crate "rustc-serialize" as rustc_serialize; Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable` and `RustcDecodable`. [breaking-change]
2014-12-22serialize: Fully deprecate the libraryAlex Crichton-5/+27
This commit completes the deprecation story for the in-tree serialization library. The compiler will now emit a warning whenever it encounters `deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now marked `#[unstable]` for when feature staging is enabled. All users of serialization can migrate to the `rustc-serialize` crate on crates.io which provides the exact same interface as the libserialize library in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable` and require `extern crate "rustc-serialize" as rustc_serialize` at the crate root in order to expand correctly. To migrate all crates, add the following to your `Cargo.toml`: [dependencies] rustc-serialize = "0.1.1" And then add the following to your crate root: extern crate "rustc-serialize" as rustc_serialize; Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable` and `RustcDecodable`. [breaking-change]
2014-12-21Fallout of std::str stabilizationAlex Crichton-1/+1
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-11/+15
2014-11-26/*! -> //!Steve Klabnik-4/+1
Sister pull request of https://github.com/rust-lang/rust/pull/19288, but for the other style of block doc comment.
2014-11-17Switch to purely namespaced enumsSteven Fackler-8/+12
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-17Fix fallout from coercion removalNick Cameron-0/+1
2014-09-14syntax: fix fallout from using ptr::P.Eduard Burtescu-14/+13
2014-07-11Removed dead structures after changes to PartialOrd/Ord derivings.Felix S. Klock II-1/+0
Remove the `NonMatchesExplode` variant now that no deriving impl uses it. Removed `EnumNonMatching` entirely. Remove now irrelevant `on_matching` field and `HandleNonMatchingEnums` type. Removed unused `EnumNonMatchFunc` type def. Drive-by: revise `EnumNonMatchCollapsedFunc` doc. Made all calls to `expand_enum_method_body` go directly to `build_enum_match_tuple`. Alpha-rename `enum_nonmatch_g` back to `enum_nonmatch_f` to reduce overall diff noise. Inline sole call of `some_ordering_const`. Inline sole call of `ordering_const`. Removed a bunch of code that became dead after the above changes.
2014-07-11Revise the `const_nonmatching` flag with more info about author's intent.Felix S. Klock II-1/+1
In particular, I want authors of deriving modes to understand what they are opting into (namely quadratic code size or worse) when they select NonMatchesExplode.
2014-07-08Change DST syntax: type -> Sized?Nick Cameron-3/+2
closes #13367 [breaking-change] Use `Sized?` to indicate a dynamically sized type parameter or trait (used to be `type`). E.g., ``` trait Tr for Sized? {} fn foo<Sized? X: Share>(x: X) {} ```
2014-06-11syntax: Move the AST from @T to Gc<T>Alex Crichton-6/+8
2014-06-02syntax: Remove use of `pub use` globsklutzy-0/+1
`quote_expr!` now injects two more (priv) `use` globs. This may cause extra unused_imports warning.
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-1/+1
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-5/+6
2014-04-23auto merge of #13704 : edwardw/rust/doc-hidden, r=alexcrichtonbors-1/+1
Closes #13698
2014-04-23auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakisbors-1/+3
This alters the borrow checker's requirements on invoking closures from requiring an immutable borrow to requiring a unique immutable borrow. This means that it is illegal to invoke a closure through a `&` pointer because there is no guarantee that is not aliased. This does not mean that a closure is required to be in a mutable location, but rather a location which can be proven to be unique (often through a mutable pointer). For example, the following code is unsound and is no longer allowed: type Fn<'a> = ||:'a; fn call(f: |Fn|) { f(|| { f(|| {}) }); } fn main() { call(|a| { a(); }); } There is no replacement for this pattern. For all closures which are stored in structures, it was previously allowed to invoke the closure through `&self` but it now requires invocation through `&mut self`. The standard library has a good number of violations of this new rule, but the fixes will be separated into multiple breaking change commits. Closes #12224
2014-04-23Fix other bugs with new closure borrowingAlex Crichton-1/+3
This fixes various issues throughout the standard distribution and tests.
2014-04-23Honor hidden doc attribute of derivable trait methodsEdward Wang-1/+1
Closes #13698
2014-04-23Support unsized types with the `type` keywordNick Cameron-2/+3
2014-03-27serialize: use ResultSean McArthur-10/+20
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-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-1/+1
Closes #12771