about summary refs log tree commit diff
path: root/src/libsyntax/fold.rs
AgeCommit message (Collapse)AuthorLines
2015-01-17libsyntax: uint types to usizePaul Collier-2/+2
2015-01-15auto merge of #21052 : nick29581/rust/methods-ext, r=sfacklerbors-42/+45
Allows modifiers to be used on methods, associated types, etc. r? @sfackler
2015-01-15syntax: add fully qualified UFCS expressions.Eduard Burtescu-1/+5
2015-01-15Syntax extensions on trait and impl items.Nick Cameron-42/+45
Allows modifiers to be used on methods, associated types, etc.
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-5/+9
Conflicts: src/libflate/lib.rs src/libstd/lib.rs src/libstd/macros.rs src/libsyntax/feature_gate.rs src/libsyntax/parse/parser.rs src/libsyntax/show_span.rs src/test/auxiliary/macro_crate_test.rs src/test/compile-fail/lint-stability.rs src/test/run-pass/intrinsics-math.rs src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05rollup merge of #20554: huonw/mut-patternAlex Crichton-1/+1
Conflicts: src/librustc_typeck/check/_match.rs
2015-01-05Reserve the keyword 'macro'Keegan McAllister-4/+4
2015-01-05remove TyClosureJorge Aparicio-11/+0
2015-01-05Reformat metadata for exported macrosKeegan McAllister-1/+5
Instead of copy-pasting the whole macro_rules! item from the original .rs file, we serialize a separate name, attributes list, and body, the latter as pretty-printed TTs. The compilation of macro_rules! macros is decoupled somewhat from the expansion of macros in item position. This filters out comments, and facilitates selective imports.
2015-01-05Change `&` pat to only work with &T, and `&mut` with &mut T.Huon Wilson-1/+1
This implements RFC 179 by making the pattern `&<pat>` require matching against a variable of type `&T`, and introducing the pattern `&mut <pat>` which only works with variables of type `&mut T`. The pattern `&mut x` currently parses as `&(mut x)` i.e. a pattern match through a `&T` or a `&mut T` that binds the variable `x` to have type `T` and to be mutable. This should be rewritten as follows, for example, for &mut x in slice.iter() { becomes for &x in slice.iter() { let mut x = x; Due to this, this is a [breaking-change] Closes #20496.
2015-01-04Add syntax for negative implementations of traitsFlavio Percoco-2/+3
This commit introduces the syntax for negative implmenetations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC #3
2015-01-02rollup merge of #20341: nikomatsakis/impl-trait-for-trait-2Alex Crichton-1/+1
Conflicts: src/librustc/middle/traits/mod.rs src/libstd/io/mod.rs src/test/run-pass/builtin-superkinds-self-type.rs
2015-01-02Fix fallout from change, adding explicit `Sized` annotations where necessary.Niko Matsakis-1/+1
2015-01-02Make type in ast::Local optionalSeo Sanghyeon-1/+1
2014-12-29rollup merge of #20194: nick29581/dst-syntaxAlex Crichton-5/+3
Part of #19607. r? @nikomatsakis
2014-12-30Remove ExprSlice by hacking the compilerNick Cameron-6/+0
[breaking-change] The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
2014-12-30Add hypothetical support for ranges with only an upper boundNick Cameron-1/+1
Note that this doesn't add the surface syntax.
2014-12-29Slash the ast::Stmt type from 104 to 24 bytes.Huon Wilson-1/+1
(on platforms with 64-bit pointers.) The StmtMac variant is rather large and also fairly rare, so let's optimise the common case.
2014-12-26Accept `?Sized` as well as `Sized?`Nick Cameron-5/+3
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-24Add syntax for rangesNick Cameron-0/+4
2014-12-20Add support for multiple region bounds in where clausesJared Roesch-2/+2
2014-12-20Add parser support for generalized where clausesJared Roesch-4/+11
Implement support in the parser for generalized where clauses, as well as the conversion of ast::WherePredicates to ty::Predicate in `collect.rs`.
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-3/+3
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-16AST refactor: make the place in ExprBox an option.Felix S. Klock II-1/+1
This is to allow us to migrate away from UnUniq in a followup commit, and thus unify the code paths related to all forms of `box`.
2014-12-14Parse `unsafe impl` but don't do anything particularly interesting with the ↵Niko Matsakis-3/+4
results.
2014-12-14Parse `unsafe trait` but do not do anything with it beyond parsing and ↵Niko Matsakis-2/+3
integrating into rustdoc etc.
2014-12-14Rename FnStyle trait to Unsafety.Niko Matsakis-10/+10
2014-12-14Remove `proc` types/expressions from the parser, compiler, andNiko Matsakis-15/+0
language. Recommend `move||` instead.
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-3/+3
2014-12-12Add support for equality constraints on associated typesNick Cameron-8/+40
2014-11-26Rote changes due to the fact that ast paths no longer carry this extraneous ↵Niko Matsakis-4/+6
bounds.
2014-11-23Remove type parameters from ExprField and ExprTupFieldAdolfo Ochagavía-6/+4
2014-11-20auto merge of #19113 : nikomatsakis/rust/unboxed-boxed-closure-unification, ↵bors-8/+3
r=acrichto Use the expected type to infer the argument/return types of unboxed closures. Also, in `||` expressions, use the expected type to decide if the result should be a boxed or unboxed closure (and if an unboxed closure, what kind). This supercedes PR #19089, which was already reviewed by @pcwalton.
2014-11-19Merge the ExprFnBlock and ExprUnboxedClosure into one ExprClosure with an ↵Niko Matsakis-8/+3
optional unboxed closure kind.
2014-11-19Refactor QPath to take an ast::TraitRefNiko Matsakis-6/+16
2014-11-18Convert TyPolyTraitRef to accept arbitary bounds, so that things likeNiko Matsakis-4/+6
`Box<for<'a> Foo<&'a T> + 'a>` can be accepted. Also cleanup the visitor/fold in general, exposing more callbacks.
2014-11-16Complete the removal of ty_nil, ast::LitNil, ast::TyBot and ast::TyUniqJakub Bukaj-8/+11
[breaking-change] This will break any uses of macros that assumed () being a valid literal.
2014-11-09auto merge of #18743 : nikomatsakis/rust/hrtb-refactor-2, r=pcwaltonbors-6/+18
Various miscellaneous changes pushing towards HRTB support: 1. Update parser and adjust ast to support `for<'a,'b>` syntax, both in closures and trait bounds. Warn on the old syntax (not error, for stage0). 2. Refactor TyTrait representation to include a TraitRef. 3. Purge `once_fns` feature gate and `once` keyword. r? @pcwalton This is a [breaking-change]: - The `once_fns` feature is now officially deprecated. Rewrite using normal closures or unboxed closures. - The new `for`-based syntax now issues warnings (but not yet errors): - `fn<'a>(T) -> U` becomes `for<'a> fn(T) -> U` - `<'a> |T| -> U` becomes `for<'a> |T| -> U`
2014-11-08auto merge of #18634 : alexcrichton/rust/cfg-attr-crate-level, r=sfacklerbors-4/+33
This commit implements processing these two attributes at the crate level as well as at the item level. When #[cfg] is applied at the crate level, then the entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute is processed as usual in that the attribute is included or not depending on whether the cfg matches. This was spurred on by motivations of #18585 where #[cfg_attr] annotations will be applied at the crate-level. cc #18585
2014-11-07Update parser with `for` syntaxNiko Matsakis-6/+18
2014-11-07rustc: Process #[cfg]/#[cfg_attr] on cratesAlex Crichton-4/+33
This commit implements processing these two attributes at the crate level as well as at the item level. When #[cfg] is applied at the crate level, then the entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute is processed as usual in that the attribute is included or not depending on whether the cfg matches. This was spurred on by motivations of #18585 where #[cfg_attr] annotations will be applied at the crate-level. cc #18585
2014-11-07auto merge of #17830 : pczarn/rust/interp_tt, r=pnkfelixbors-8/+12
Closes #14197 Removes the `matchers` nonterminal. If you're using `$foo:matchers` in a macro, write `$foo:tt` instead. [breaking-change]
2014-11-07Add `ast::SequenceRepetition`Piotr Czarnecki-5/+6
2014-11-06Remove the unboxed closure `|:|` notation from types and trait references ↵Niko Matsakis-23/+0
completely.
2014-11-06Support parenthesized paths `Foo(A,B) -> C` that expand to `Foo<(A,B),C>`. ↵Niko Matsakis-3/+47
These paths also bind anonymous regions (or will, once HRTB is fully working). Fixes #18423.
2014-11-05Remove `Matcher`sPiotr Czarnecki-2/+0
2014-11-05Use `TokenTree`s in lhs of macrosPiotr Czarnecki-4/+9
2014-11-03Restructure AST so that the associated type definition carriesNiko Matsakis-7/+4
bounds like any other "type parameter".
2014-10-30Use common variants for open and close delimitersBrendan Zabarauskas-12/+8
This common representation for delimeters should make pattern matching easier. Having a separate `token::DelimToken` enum also allows us to enforce the invariant that the opening and closing delimiters must be the same in `ast::TtDelimited`, removing the need to ensure matched delimiters when working with token trees.
2014-10-29Rename fail! to panic!Steve Klabnik-2/+2
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]