about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2014-08-08auto merge of #16285 : alexcrichton/rust/rename-share, r=huonwbors-2/+2
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-07Rename `Share` to `Sync`Alex Crichton-2/+2
This leaves the `Share` trait at `std::kinds` via a `#[deprecated]` `pub use` statement, but the `NoShare` struct is no longer part of `std::kinds::marker` due to #12660 (the build cannot bootstrap otherwise). All code referencing the `Share` trait should now reference the `Sync` trait, and all code referencing the `NoShare` type should now reference the `NoSync` type. The functionality and meaning of this trait have not changed, only the naming. Closes #16281 [breaking-change]
2014-08-07Temporary bootstrapping hack: introduce syntax for r egion bounds like `'b:'a`,Niko Matsakis-7/+32
meaning `'b outlives 'a`. Syntax currently does nothing but is needed for full fix to #5763. To use this syntax, the issue_5763_bootstrap feature guard is required.
2014-08-06AST refactoring: merge PatWild and PatWildMulti into one variant with a flag.Felix S. Klock II-2/+2
2014-08-05Fixes missing overflow lint for i64 #14269Falco Hirschenberger-16/+21
The `type_overflow` lint, doesn't catch the overflow for `i64` because the overflow happens earlier in the parse phase when the `u64` as biggest possible int gets casted to `i64` , without checking the for overflows. We can't lint in the parse phase, so a refactoring of the `LitInt` type was necessary. The types `LitInt`, `LitUint` and `LitIntUnsuffixed` where merged to one type `LitInt` which stores it's value as `u64`. An additional parameter was added which indicate the signedness of the type and the sign of the value.
2014-08-01Fix misspelled comments.Joseph Crail-1/+1
2014-08-01auto merge of #16141 : alexcrichton/rust/rollup, r=alexcrichtonbors-5/+8
2014-07-31auto merge of #15999 : Kimundi/rust/fix_folder, r=nikomatsakisbors-6/+6
Note: This PR is motivated by an attempt to write an custom syntax extension that tried to use `syntax::fold`, and that could only do so by fixing bugs in it and copying out private functions. --- Refactored `syntax::fold` Prior to this, the code there had a few issues: - Default implementations inconsistenly either had the prefix `noop_` or not. - Some default methods where implemented in terms of a public noop function for user code to call, others where implemented directly on the trait and did not allow users of the trait to reuse the code. - Some of the default implementations where private, and thus not reusable for other implementors. - There where some bugs where default implemntations called other default implementations directly, rather than to the underlying Folder, with the result of some ast nodes never being visted even if the user implemented that method. (For example, the current Folder never folded struct fields) This commit solves this situation somewhat radically by making __all__ `fold_...` functions in the module into Folder methods, and implementing them all in terms of public `noop_...` functions for other implementors to call out to. Some public functions had to be renamed to fit the new system, so this is a breaking change. --- Also added a few trait implementations to `ast` types
2014-07-31rustrt: Make begin_unwind take a single file/line pointerBrian Anderson-5/+8
Smaller text size.
2014-07-30auto merge of #16037 : erickt/rust/quote_arm, r=acrichtobors-0/+67
This adds support for `quote_arm!(cx, $pat => $expr)`, and `macro_rules!(($a:arm) => (...))`. It also fixes a bug in pretty printing, where this would generate invalid code: ``` match { 5i } { 1 => 2, _ => 3, } ``` It would generate this code: ``` match { 5i } { 1 => 2 _ => 3 } ``` Finally, it adds a couple helper methods to `ExtCtxt`.
2014-07-29syntax: add support for quoting armsErick Tryzelaar-0/+11
2014-07-29Fix a bug pretty printing `match { 5i } { _ => { } }`Erick Tryzelaar-0/+2
This also always puts a trailing comma on the last non-block expr.
2014-07-29syntax: allow quasiquoter to inline `Vec<Stmt>`sErick Tryzelaar-0/+2
2014-07-29syntax: add some more extension helper methodsErick Tryzelaar-0/+52
2014-07-29libsyntax: Don't ICE on macro invocation in count expr of fixed array type.Luqman Aden-2/+5
2014-07-29Refactored syntax::fold.Marvin Löbel-6/+6
Prior to this, the code there had a few issues: - Default implementations inconsistently either had the prefix `noop_` or not. - Some default methods where implemented in terms of a public noop function for user code to call, others where implemented directly on the trait and did not allow users of the trait to reuse the code. - Some of the default implementations where private, and thus not reusable for other implementors. - There where some bugs where default implementations called other default implementations directly, rather than to the underlying Folder, with the result of some AST nodes never being visited even if the user implemented that method. (For example, the current Folder never folded struct fields) This commit solves this situation somewhat radically by making _all_ `fold_...` functions in the module into Folder methods, and implementing them all in terms of public `noop_...` functions for other implementors to call out to. Some public functions had to be renamed to fit the new system, so this is a breaking change. [breaking-change]
2014-07-24librustc: Stop desugaring `for` expressions and translate them directly.Patrick Walton-97/+7
This makes edge cases in which the `Iterator` trait was not in scope and/or `Option` or its variants were not in scope work properly. This breaks code that looks like: struct MyStruct { ... } impl MyStruct { fn next(&mut self) -> Option<int> { ... } } for x in MyStruct { ... } { ... } Change ad-hoc `next` methods like the above to implementations of the `Iterator` trait. For example: impl Iterator<int> for MyStruct { fn next(&mut self) -> Option<int> { ... } } Closes #15392. [breaking-change]
2014-07-22auto merge of #15871 : dotdash/rust/unnamed_fmtstr, r=pcwaltonbors-1/+6
2014-07-22auto merge of #15867 : cmr/rust/rewrite-lexer4, r=alexcrichtonbors-0/+2
2014-07-21Add a ton of ignore-lexer-testCorey Richardson-0/+2
2014-07-22Refactoring: Only use `MacroExpander` for expanding outside ofMarvin Löbel-26/+13
`syntax::ext::expand`
2014-07-21Moved `syntax::ext::base::SyntaxEnv` into `syntax::ext::base::ExtCtx`Marvin Löbel-201/+213
2014-07-21Allow merging of statics generated by format!()Björn Steinbrink-1/+6
2014-07-21syntax: Join consecutive string literals in format strings togetherroot-10/+33
Emit a single rt::Piece per consecutive string literals. String literals are split on {{ or }} escapes. Saves a small amount of static storage and emitted code size.
2014-07-21repair macro docsJohn Clements-10/+7
In f1ad425199b0d89dab275a8c8f6f29a73d316f70, I changed the handling of macros, to prevent macro invocations from occurring in fully expanded source. Instead, I added a side table. It contained only the spans of the macros, because this was the only information required in order to make macro export work. However, librustdoc was also affected by this change, since it extracts macro information in a similar way. As a result of the earlier change, exported macros were no longer documented. In order to repair this, I've adjusted the side table to contain whole items, rather than just the spans.
2014-07-20auto merge of #15808 : jakub-/rust/use-mod, r=alexcrichtonbors-1/+1
Implements RFC #168.
2014-07-20auto merge of #15814 : kvark/rust/ast, r=huonwbors-2/+6
Makes working with syntax deriving a bit more pleasuring. For instance, once can use local (non-static) strings anywhere inside `TraitDef` now.
2014-07-20Implement new mod import sugarJakub Wieczorek-1/+1
Implements RFC #168.
2014-07-20auto merge of #15785 : treeman/rust/fix-15780, r=alexcrichtonbors-2/+11
Fix for #15780.
2014-07-19Fixed lifetimes on syntax deriving structs, implemented CloneDzmitry Malyshau-2/+6
2014-07-18Special case for 0 arguments given in format!Jonas Hietala-4/+4
2014-07-18Correct plural of arguments in format_args!Jonas Hietala-2/+11
2014-07-18librustc: Implement unboxed closures with mutable receiversPatrick Walton-8/+29
2014-07-18auto merge of #15732 : bgamari/rust/to-tokens, r=alexcrichtonbors-3/+35
Here I add a `ToTokens` impl for `Attribute_` and `Option<T>`, as well as generalize the impl for `Vec<T>`
2014-07-18auto merge of #15725 : aochagavia/rust/vec, r=alexcrichtonbors-1/+1
* Deprecated `to_owned` in favor of `to_vec` * Deprecated `into_owned` in favor of `into_vec` [breaking-change]
2014-07-17librustc: Remove cross-borrowing of `Box<T>` to `&T` from the language,Patrick Walton-13/+17
except where trait objects are involved. Part of issue #15349, though I'm leaving it open for trait objects. Cross borrowing for trait objects remains because it is needed until we have DST. This will break code like: fn foo(x: &int) { ... } let a = box 3i; foo(a); Change this code to: fn foo(x: &int) { ... } let a = box 3i; foo(&*a); [breaking-change]
2014-07-17Rename functions in the CloneableVector traitAdolfo Ochagavía-1/+1
* Deprecated `to_owned` in favor of `to_vec` * Deprecated `into_owned` in favor of `into_vec` [breaking-change]
2014-07-17syntax: Add ToTokens impl for MethodBen Gamari-0/+2
2014-07-17syntax: Add quote_method!Ben Gamari-0/+13
2014-07-16libsyntax: Remove `Send` from `PtrTy` in `deriving`.Patrick Walton-6/+0
It'll be complex to port to the new explicit-self regime and it seems to be unused.
2014-07-16syntax: Generalize ToTokens impl for Vec<T>Ben Gamari-3/+4
It will now `flat_map` over the elements of a `Vec<T>` if `T: ToTokens`
2014-07-16syntax: Add ToTokens for Attribute_Ben Gamari-0/+7
2014-07-16syntax: Add ToTokens for Option<T>Ben Gamari-0/+9
2014-07-15Fix errorsAdolfo Ochagavía-1/+0
2014-07-15Deprecate `str::from_utf8_owned`Adolfo Ochagavía-5/+5
Use `String::from_utf8` instead [breaking-change]
2014-07-13macro expansion for methodsJohn Clements-25/+47
Closes #4621
2014-07-13expansion abstractionJohn Clements-144/+114
2014-07-13add make_method method to MacResult traitJohn Clements-1/+36
this allows macro results to be parsed as methods
2014-07-13remove no-stmt checkJohn Clements-4/+0
nothing wrong with a statement expanding into 0 stmts, that I can see.
2014-07-13macro method unit test case fixJohn Clements-2/+2