about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2015-01-06[breaking change] Revert Entry behaviour to take keys by value.Dylan Ede-3/+3
2015-01-06syntax: implement 'macro input future proofing'Corey Richardson-8/+140
See RFC 550 (https://github.com/rust-lang/rfcs/pull/550) for the motivation and details. If this breaks your code, add one of the listed tokens after the relevant non-terminal in your matcher. [breaking-change]
2015-01-05rollup merge of #20482: kmcallister/macro-reformAlex Crichton-146/+135
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 #20556: japaric/no-for-sizedAlex Crichton-2/+2
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/test/compile-fail/issue-19009.rs
2015-01-05rollup merge of #20568: huonw/ungate-AT-globsAlex Crichton-15/+7
These aren't in their final form, but are all aiming to be part of 1.0, so at the very least encouraging usage now to find the bugs is nice. Also, the widespread roll-out of associated types in the standard library indicates they're getting good, and it's lame to have to activate a feature in essentially every crate ever.
2015-01-05rollup merge of #20554: huonw/mut-patternAlex Crichton-1/+1
Conflicts: src/librustc_typeck/check/_match.rs
2015-01-05Modernize macro_rules! invocationsKeegan McAllister-9/+11
macro_rules! is like an item that defines a macro. Other items don't have a trailing semicolon, or use a paren-delimited body. If there's an argument for matching the invocation syntax, e.g. parentheses for an expr macro, then I think that applies more strongly to the *inner* delimiters on the LHS, wrapping the individual argument patterns.
2015-01-05Reserve the keyword 'macro'Keegan McAllister-6/+6
2015-01-05Allow selective macro importKeegan McAllister-2/+5
2015-01-05Move #[macro_reexport] to extern crateKeegan McAllister-59/+14
2015-01-05syntax: remove remaining boxed closuresJorge Aparicio-33/+29
2015-01-05Reformat metadata for exported macrosKeegan McAllister-72/+34
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-18/+27
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-05sed -i -s 's/ for Sized?//g' **/*.rsJorge Aparicio-2/+2
2015-01-05Implement macro re-exportKeegan McAllister-1/+49
Fixes #17103.
2015-01-05Add a special macro nonterminal $crateKeegan McAllister-6/+43
2015-01-05Replace LetSyntaxTT with MacroRulesTTKeegan McAllister-57/+30
The implementation of LetSyntaxTT was specialized to macro_rules! in various ways. This gets rid of the false generality and simplifies the code.
2015-01-05Ungate default type parameters.Huon Wilson-15/+7
These are in scope for 1.0, and this is good to e.g. find as many bugs as possible.
2015-01-04serialize: Use assoc types + less old_orphan_checkAlex Crichton-30/+32
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-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-05auto merge of #20285 : FlaPer87/rust/oibit-send-and-friends, r=nikomatsakisbors-1/+2
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-04Add syntax for negative implementations of traitsFlavio Percoco-1/+2
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-04[breaking change] Update entry API as part of RFC 509.Ben Foppa-11/+8
2015-01-03Remove deprecated functionalityAlex Crichton-104/+0
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-26/+26
2015-01-03sed -i -s 's/\bmod}/self}/g' **/*.rsJorge Aparicio-1/+1
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-1/+1
2015-01-03use assoc types in binop traitsJorge Aparicio-1/+3
2015-01-03syntax: fix falloutJorge Aparicio-1/+1
2015-01-02Merge remote-tracking branch 'origin/master' into rollupAlex Crichton-22/+34
Conflicts: src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
2015-01-02rollup merge of #20425: sanxiyn/opt-local-tyAlex Crichton-3/+3
This avoids having ast::Ty nodes which have no counterpart in the source.
2015-01-02std: Stabilize the prelude moduleAlex Crichton-3/+1
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-3/+3
2015-01-02Accept `derive` instead of `deriving`Nick Cameron-22/+34
[breaking-change] `deriving is still accepted, but gives a deprecation warning
2014-12-31syntax: unbox closures used in let bindingsJorge Aparicio-7/+7
2014-12-31syntax: unbox closures used in function argumentsJorge Aparicio-6/+6
2014-12-30Fallout from stabilizationAaron Turon-12/+11
2014-12-29rollup merge of #20194: nick29581/dst-syntaxAlex Crichton-18/+16
Part of #19607. r? @nikomatsakis
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-28auto merge of #20136 : eddyb/rust/format-args, r=alexcrichtonbors-147/+99
We have the technology: no longer do you need to write closures to use `format_args!`. This is a `[breaking-change]`, as it forces you to clean up old hacks - if you had code like this: ```rust format_args!(fmt::format, "{} {} {}", a, b, c) format_args!(|args| { w.write_fmt(args) }, "{} {} {}", x, y, z) ``` change it to this: ```rust fmt::format(format_args!("{} {} {}", a, b, c)) w.write_fmt(format_args!("{} {} {}", x, y, z)) ``` To allow them to be called with `format_args!(...)` directly, several functions were modified to take `fmt::Arguments` by value instead of by reference. Also, `fmt::Arguments` derives `Copy` now in order to preserve all usecases that were previously possible.
2014-12-27syntax: change format_args! to produce fmt::Arguments instead of calling a ↵Eduard Burtescu-66/+29
function with them.
2014-12-27syntax: use std::string::String unqualified in format.Eduard Burtescu-13/+12
2014-12-27syntax: turn the match-call generated by format_args inside-out.Eduard Burtescu-39/+41
2014-12-27syntax: format: put static arrays in their own blocks to avoid needing a ↵Eduard Burtescu-40/+39
wrapper block.
2014-12-27syntax: format: remove unused method_statics field.Eduard Burtescu-15/+4
2014-12-27auto merge of #19916 : SimonSapin/rust/ascii-reform, r=sfacklerbors-0/+1
Implements [RFC 486](https://github.com/rust-lang/rfcs/pull/486). Fixes #19908. * Rename `to_ascii_{lower,upper}` to `to_ascii_{lower,upper}case`, per #14401 * Remove the `Ascii` type and associated traits: `AsciiCast`, `OwnedAsciiCast`, `AsciiStr`, `IntoBytes`, and `IntoString`. * As a replacement, add `.is_ascii()` to `AsciiExt`, and implement `AsciiExt` for `u8` and `char`. [breaking-change]
2014-12-26Keep track of the whole error chainFlavio Percoco-2/+5
2014-12-26Accept `?Sized` as well as `Sized?`Nick Cameron-18/+16
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-25Remove Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes, IntoString.Simon Sapin-0/+1
As a replacement, add is_ascii() to AsciiExt, and implement AsciiExt for u8 and char. [breaking-change]
2014-12-23Rename include_bin! to include_bytes!Chris Wong-1/+10
According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway. We keep the old name around for now, but trigger a deprecation warning when it is used. [RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md [breaking-change]