about summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/generic.rs
AgeCommit message (Collapse)AuthorLines
2014-05-17syntax: Tighten search paths for inner modulesAlex Crichton-1304/+0
This is an implementation of RFC 16. A module can now only be loaded if the module declaring `mod name;` "owns" the current directory. A module is considered as owning its directory if it meets one of the following criteria: * It is the top-level crate file * It is a `mod.rs` file * It was loaded via `#[path]` * It was loaded via `include!` * The module was declared via an inline `mod foo { ... }` statement For example, this directory structure is now invalid // lib.rs mod foo; // foo.rs mod bar; // bar.rs; fn bar() {} With this change `foo.rs` must be renamed to `foo/mod.rs`, and `bar.rs` must be renamed to `foo/bar.rs`. This makes it clear that `bar` is a submodule of `foo`, and can only be accessed through `foo`. RFC: 0016-module-file-system-hierarchy Closes #14180 [breaking-change]
2014-05-13syntax: Preserve attributes in #[deriving]Alex Crichton-11/+25
Now that the #[deriving] attribute is removed, the raw_pointers_deriving lint was broken. This commit restores the lint by preserving lint attributes across #[deriving] to the implementations and using #[automatically_derived] as the trigger for activating the lint.
2014-05-08libsyntax: Remove uses of `~str` from libsyntax, and fix falloutPatrick Walton-1/+1
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-1/+1
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-04-24auto merge of #13559 : FlaPer87/rust/remove-special-root, r=nikomatsakisbors-12/+11
This patch removes the special auto-rooting for `@` from the borrow checker. With `@` moving into a library, it doesn't make sense to keep this code around anymore. It also simplifies `trans` by removing root checking from there @nikomatsakis Closes: #11586
2014-04-23auto merge of #13704 : edwardw/rust/doc-hidden, r=alexcrichtonbors-16/+2
Closes #13698
2014-04-23auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakisbors-3/+11
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-3/+11
This fixes various issues throughout the standard distribution and tests.
2014-04-23syntax: fix de-@rooting falloutFlavio Percoco-12/+11
2014-04-23Honor hidden doc attribute of derivable trait methodsEdward Wang-16/+2
Closes #13698
2014-04-23Support unsized types with the `type` keywordNick Cameron-1/+5
2014-04-23Add a span to ast::TyParamNick Cameron-1/+1
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-1/+1
2014-04-10Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalFn and ↵Kasey Carrothers-1/+1
updated associated variable and function names.
2014-04-08Register new snapshotsAlex Crichton-3/+3
2014-03-31syntax: Switch field privacy as necessaryAlex Crichton-23/+25
2014-03-31vec: convert `append` and `append_one` to methodsDaniel Micay-3/+1
These were only free functions on `~[T]` because taking self by-value used to be broken.
2014-03-30Removed deprecated functions `map` and `flat_map` for vectors and slices.Marvin Löbel-16/+18
2014-03-26auto merge of #13145 : alexcrichton/rust/flip-some-defaults, r=brsonbors-3/+3
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: Permit visibility on tuple fieldsAlex Crichton-3/+3
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-25Changed `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by ↵Marvin Löbel-2/+2
value
2014-03-22Migrate all users of opt_vec to owned_slice, delete opt_vec.Huon Wilson-5/+5
syntax::opt_vec is now entirely unused, and so can go.
2014-03-21syntax: make OptVec immutable.Huon Wilson-10/+15
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-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-3/+3
Closes #12771
2014-03-18Docify std::vec_ngSteven Fackler-2/+2
I also removed a couple of methods that were silly and added sort.
2014-03-15Tag derived impls with #[automatically_derived]Steven Fackler-8/+4
This will enable rustdoc to treat them specially.
2014-03-12Update users for the std::rand -> librand move.Huon Wilson-1/+1
2014-03-01libsyntax: Fix errors arising from the automated `~[T]` conversionPatrick Walton-20/+34
2014-03-01libsyntax: Mechanically change `~[T]` to `Vec<T>`Patrick Walton-50/+48
2014-02-27Fix syntax::ext::deriving{,::*} docs formatting.Chris Morgan-4/+5
The most significant fix is for `syntax::ext::deriving::encodable`, where one of the blocks of code, auspiciously containing `<S>` (recall that Markdown allows arbitrary HTML to be contained inside it), was not formatted as a code block, with a fun but messy effect.
2014-02-24Update rustc/syntax docs now that rustdoc lexes all non-`notrust` code blocks.Huon Wilson-12/+12
This includes blocks made by indentation, so they need to be changed to explicitly have ```notrust ... ``` fences..
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-6/+6
This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version.
2014-02-21syntax: Allow syntax extensions to have attributesErick Tryzelaar-8/+11
2014-02-19librustc: Remove unique vector patterns from the language.Patrick Walton-18/+19
Preparatory work for removing unique vectors from the language, which is itself preparatory work for dynamically sized types.
2014-02-14Fix all code examplesAlex Crichton-12/+14
2014-02-14auto merge of #12234 : sfackler/rust/restructure-item-decorator, r=huonwbors-19/+15
The old method of building up a list of items and threading it through all of the decorators was unwieldy and not really scalable as non-deriving ItemDecorators become possible. The API is now that the decorator gets an immutable reference to the item it's attached to, and a callback that it can pass new items to. If we want to add syntax extensions that can modify the item they're attached to, we can add that later, but I think it'll have to be separate from ItemDecorator to avoid strange ordering issues. @huonw
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-3/+5
2014-02-13Tweak ItemDecorator APISteven Fackler-19/+15
The old method of building up a list of items and threading it through all of the decorators was unwieldy and not really scalable as non-deriving ItemDecorators become possible. The API is now that the decorator gets an immutable reference to the item it's attached to, and a callback that it can pass new items to. If we want to add syntax extensions that can modify the item they're attached to, we can add that later, but I think it'll have to be separate from ItemDecorator to avoid strange ordering issues.
2014-02-11libsyntax -- fix unsafe sharing in closuresNiko Matsakis-4/+6
2014-02-08Update deriving to pass around the `cx` linearlyNiko Matsakis-82/+122
2014-02-08Fixed error starting with uppercasemr.Shu-6/+6
Error messages cleaned in librustc/middle Error messages cleaned in libsyntax Error messages cleaned in libsyntax more agressively Error messages cleaned in librustc more aggressively Fixed affected tests Fixed other failing tests Last failing tests fixed
2014-02-08syntax: convert deriving to take &mut ExtCtxt.Huon Wilson-16/+16
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-1/+1
- `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-02librustc: De-`@str` `NameAndSpan`Patrick Walton-1/+1
2014-02-02libsyntax: De-`@str` literal strings in the ASTPatrick Walton-1/+4
2014-02-02libsyntax: Introduce an `InternedString` type to reduce `@str` in thePatrick Walton-2/+10
compiler and use it for attributes
2014-01-31Fix minor doc typosVirgile Andreani-2/+2
2014-01-30Implement default type parameters in generics.Eduard Burtescu-1/+1
2014-01-27auto merge of #11826 : huonw/rust/7621-deriving-errors, r=alexcrichtonbors-3/+5
cc #7621. See the commit message. I'm not sure if we should merge this now, or wait until we can write `Clone::clone(x)` which will directly solve the above issue with perfect error messages.