about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2015-01-05rollup merge of #20554: huonw/mut-patternAlex Crichton-2/+7
Conflicts: src/librustc_typeck/check/_match.rs
2015-01-05rollup merge of #20424: jroesch/tuple-struct-where-clause-fixAlex Crichton-40/+89
Fixes #17904. All the cases that I believe we should support are detailed in the test case, let me know if there is there is any more desired behavior. cc @japaric. r? @nikomatsakis or whoever is appropriate.
2015-01-05rollup merge of #20099: P1start/parse-more-macro-opsAlex Crichton-5/+10
Closes #20093.
2015-01-05Reserve the keyword 'macro'Keegan McAllister-3/+4
2015-01-06Fix the obsolete messageNick Cameron-1/+1
2015-01-06FalloutNick Cameron-1/+1
2015-01-06Obsolete `Sized? T`Nick Cameron-3/+9
[breaking-change] Use `T: ?Sized`
2015-01-06Remove the prefix in ObsoleteSyntax variantsNick Cameron-34/+34
2015-01-05syntax: remove dead codeJorge Aparicio-2/+1
2015-01-05syntax: make the closure type `f: |uint| -> bool` syntax obsoleteJorge Aparicio-16/+18
2015-01-05remove TyClosureJorge Aparicio-8/+2
2015-01-05tweak the obsolete syntax messageJorge Aparicio-2/+2
2015-01-05Reformat metadata for exported macrosKeegan McAllister-0/+4
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-05Rename macro_escape to macro_useKeegan McAllister-1/+2
In the future we want to support #[macro_use(foo, bar)] mod macros; but it's not an essential part of macro reform. Reserve the syntax for now.
2015-01-05Stop using macro_escape as an inner attributeKeegan McAllister-3/+3
In preparation for the rename.
2015-01-05syntax: obsolete the `for Sized?` syntaxJorge Aparicio-2/+12
2015-01-05Allow leading :: in use itemsKeegan McAllister-0/+4
2015-01-05Add a special macro nonterminal $crateKeegan McAllister-3/+30
2015-01-05Refactor struct parsing and add testsJared Roesch-45/+76
2015-01-04serialize: Use assoc types + less old_orphan_checkAlex Crichton-0/+17
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-05Change `&` pat to only work with &T, and `&mut` with &mut T.Huon Wilson-2/+7
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-05auto merge of #20285 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakisbors-1/+16
This commit introduces the syntax for negative implementations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC rust-lang/rfcs#127 r? @nikomatsakis
2015-01-04Fix the parsing of where-clauses for structsJared Roesch-3/+21
2015-01-04Add syntax for negative implementations of traitsFlavio Percoco-1/+16
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-03Remove deprecated functionalityAlex Crichton-10/+2
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-16/+16
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-3/+3
2015-01-03syntax: fix falloutJorge Aparicio-1/+1
2015-01-03auto merge of #20154 : P1start/rust/qualified-assoc-type-generics, ↵bors-34/+10
r=nikomatsakis This modifies `Parser::eat_lt` to always split up `<<`s, instead of doing so only when a lifetime name followed or the `force` parameter (now removed) was `true`. This is because `Foo<<TYPE` is now a valid start to a type, whereas previously only `Foo<<LIFETIME` was valid. This is a [breaking-change]. Change code that looks like this: ```rust let x = foo as bar << 13; ``` to use parentheses, like this: ```rust let x = (foo as bar) << 13; ``` Closes #17362.
2015-01-02rollup merge of #20410: japaric/assoc-typesAlex Crichton-1/+3
Conflicts: src/liballoc/lib.rs src/libcollections/lib.rs src/libcollections/slice.rs src/libcore/ops.rs src/libcore/prelude.rs src/libcore/ptr.rs src/librustc/middle/traits/project.rs src/libstd/c_str.rs src/libstd/io/mem.rs src/libstd/io/mod.rs src/libstd/lib.rs src/libstd/path/posix.rs src/libstd/path/windows.rs src/libstd/prelude.rs src/libstd/rt/exclusive.rs src/libsyntax/lib.rs src/test/compile-fail/issue-18566.rs src/test/run-pass/deref-mut-on-ref.rs src/test/run-pass/deref-on-ref.rs src/test/run-pass/dst-deref-mut.rs src/test/run-pass/dst-deref.rs src/test/run-pass/fixup-deref-mut.rs src/test/run-pass/issue-13264.rs src/test/run-pass/overloaded-autoderef-indexing.rs
2015-01-02Merge remote-tracking branch 'origin/master' into rollupAlex Crichton-0/+4
Conflicts: src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
2015-01-02rollup merge of #20425: sanxiyn/opt-local-tyAlex Crichton-6/+2
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-02core: use assoc types in `Deref[Mut]`Jorge Aparicio-1/+3
2015-01-02std: Stabilize the prelude moduleAlex Crichton-2/+6
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2015-01-02Make type in ast::Local optionalSeo Sanghyeon-6/+2
2015-01-02Accept `self` in place of `mod` in use itemsNick Cameron-0/+4
[breaking-change] `mod` is still accepted, but gives a deprecated warning
2015-01-02Fallout - change array syntax to use `;`Nick Cameron-2/+2
2015-01-02Accept ranges with only a maximum value: `..expr`Nick Cameron-4/+11
2015-01-02Disallow [_, ..n] syntax for fixed length arrays and repeating array ↵Nick Cameron-15/+2
constructors Closes #19999 [breaking-change] Use [_; n] instead.
2014-12-31syntax: unbox closures used in let bindingsJorge Aparicio-5/+5
2014-12-30Parse arbitrary operators after expr-like macro invocations in statement ↵P1start-5/+10
position Closes #20093.
2014-12-29rollup merge of #20266: nick29581/dxr-useAlex Crichton-3/+4
r? @huonw
2014-12-29rollup merge of #20264: nagisa/threadrngAlex Crichton-1/+1
Since runtime is removed, rust has no tasks anymore and everything is moving from being task-* to thread-*. Let’s rename TaskRng as well! This is a breaking change. If a breaking change for consistency is not desired, feel free to close.
2014-12-29rollup merge of #20194: nick29581/dst-syntaxAlex Crichton-21/+74
Part of #19607. r? @nikomatsakis
2014-12-30Remove ExprSlice by hacking the compilerNick Cameron-4/+11
[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-29Rebase fixes.Huon Wilson-3/+3
I've totally mangled the history with these rebases; sorry, future programmer!
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-28Rename TaskRng to ThreadRngSimonas Kazlauskas-1/+1
Since runtime is removed, rust has no tasks anymore and everything is moving from being task-* to thread-*. Let’s rename TaskRng as well! * Rename TaskRng to ThreadRng * Rename task_rng to thread_rng [breaking-change]
2014-12-28Fix spans for `use` view statements and their treatment in save-analysisNick Cameron-3/+4